From e533fb2a3b34c4283a6228ecb2f4900369bed250 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Fri, 18 Sep 2015 14:13:02 +0200 Subject: fb.py: Drop Enum dependency in favor of python2 Signed-off-by: Florian Pritz --- fb.py | 9 +++++++-- 1 file 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", -- cgit v1.2.3-24-g4f1b