From 0d2141c825b78d94212730d004b79c014cab3240 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 28 Mar 2016 11:20:31 +0200 Subject: Remove Paste class Just use one class for clarity. Signed-off-by: Florian Pritz --- fb.py | 11 ++++------- 1 file 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() -- cgit v1.2.3-24-g4f1b