summaryrefslogtreecommitdiffstats
path: root/fb.py
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-09-18 14:13:02 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-09-18 14:13:02 +0200
commite533fb2a3b34c4283a6228ecb2f4900369bed250 (patch)
tree9f11132281412fa362f46ae24b8311834cebe070 /fb.py
parentd9da4b54d00c3521ee06216c3f9a0a1ab6481cff (diff)
fb.py: Drop Enum dependency in favor of python2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'fb.py')
-rwxr-xr-xfb.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/fb.py b/fb.py
index 976ad49..40648d0 100755
--- a/fb.py
+++ b/fb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
-from enum import Enum
import argparse
import collections
import contextlib
@@ -22,6 +21,12 @@ import xdg.BaseDirectory
from io import BytesIO
+class Enum(set):
+ def __getattr__(self, name):
+ if name in self:
+ return name
+ raise AttributeError
+
# Source: http://stackoverflow.com/a/434328/953022
def chunker(seq, size):
return (seq[pos:pos + size] for pos in range(0, len(seq), size))
@@ -335,7 +340,7 @@ class FBClient:
if version.startswith('@'):
version = 'unknown-version'
- modes = Enum("modes", [
+ modes = Enum([
"upload",
"delete",
"get",