diff options
author | Florian Pritz <bluewind@xinu.at> | 2015-09-18 14:13:02 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-09-18 14:13:02 +0200 |
commit | e533fb2a3b34c4283a6228ecb2f4900369bed250 (patch) | |
tree | 9f11132281412fa362f46ae24b8311834cebe070 | |
parent | d9da4b54d00c3521ee06216c3f9a0a1ab6481cff (diff) |
fb.py: Drop Enum dependency in favor of python2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-x | fb.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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", |