diff options
author | Florian Pritz <bluewind@xinu.at> | 2016-03-28 11:20:31 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2016-03-28 11:20:31 +0200 |
commit | 0d2141c825b78d94212730d004b79c014cab3240 (patch) | |
tree | 112fe74aee5dad7be54f83ae73fa43c887998222 | |
parent | 65993eb5969024256f6c9564a541b27f05cd1414 (diff) |
Remove Paste class
Just use one class for clarity.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-x | fb.py | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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() |