commit 56e54b5f0e6168c6bd8139be2cc3ab6dc2cf6f75 Author: aagbsn aagbsn@extc.org Date: Sun Aug 18 22:51:10 2013 +0200
Fix missing imports --- oonib/deck/handlers.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/oonib/deck/handlers.py b/oonib/deck/handlers.py index edbe361..b84d1de 100644 --- a/oonib/deck/handlers.py +++ b/oonib/deck/handlers.py @@ -1,4 +1,11 @@ +import glob +import json +import os +import re +import yaml + from oonib.handlers import OONIBHandler +from oonib import config, log
class DeckDescHandler(OONIBHandler): def get(self, deckID): @@ -21,6 +28,7 @@ class DeckListHandler(OONIBHandler): if not config.main.deck_dir: return path = os.path.abspath(config.main.deck_dir) + "/*" decknames = map(os.path.basename, glob.iglob(path)) + decknames = filter(lambda y: re.match("[a-z0-9]{40}", y), decknames) deckList = [] for deckname in decknames: f = open(os.path.join(config.main.deck_dir, deckname)) @@ -29,5 +37,3 @@ class DeckListHandler(OONIBHandler): 'description': d['description']}) f.close() self.write(json.dumps(deckList)) - -
tor-commits@lists.torproject.org