summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-03-28 11:20:31 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-03-28 11:20:31 +0200
commit0d2141c825b78d94212730d004b79c014cab3240 (patch)
tree112fe74aee5dad7be54f83ae73fa43c887998222
parent65993eb5969024256f6c9564a541b27f05cd1414 (diff)
Remove Paste class
Just use one class for clarity. Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xfb.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/fb.py b/fb.py
index 8e7487b..2a04de4 100755
--- a/fb.py
+++ b/fb.py
@@ -616,9 +616,9 @@ class FBClient:
def containerize_arg(self, arg):
if re.match('id://', arg):
id = arg.replace('id://', '')
- return Paste(id)
+ return File(id=id)
if arg.startswith(self.config['pastebin']):
- return Paste(self.extractId(arg))
+ return File(id=self.extractId(arg))
if re.match('https?://', arg):
outfile = os.path.join(self.tempdir, os.path.basename(arg.strip("/")))
self.curlw.dl_file(arg, outfile)
@@ -728,16 +728,13 @@ class File:
id = None
paste_url = None
- def __init__(self, path):
+ def __init__(self, path=None, id=None):
self.path = path
+ self.id = id
def should_upload(self):
return self.id is None
-class Paste(File):
- def __init__(self, id):
- self.id = id
-
if __name__ == '__main__':
try:
FBClient().run()