From e2b7b6a477eeb04bf869dfcf75a29b9184723ec5 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 25 Dec 2013 12:48:02 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 4 ++-- src/argparser.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 0317125..b23115c 100644 --- a/Makefile +++ b/Makefile @@ -60,8 +60,8 @@ bin/argparser.bash: src/argparser.bash java: bin/ArgParser.jar bin/ArgParser.jar: src/argparser/ArgParser.java @mkdir -p bin - $(JAVAC) $(JAVA_OPTIMISE) -cp src -s src -d bin src/argparser/ArgParser.java - $(JAVAC) $(JAVA_OPTIMISE) -cp src -s src -d bin src/Test.java + $(JAVAC) $(JAVA_OPTIMISE) -encoding UTF-8 -cp src -s src -d bin src/argparser/ArgParser.java + $(JAVAC) $(JAVA_OPTIMISE) -encoding UTF-8 -cp src -s src -d bin src/Test.java cd bin ; jar cf ArgParser.jar argparser/ArgParser*.class .PHONY: c diff --git a/src/argparser.py b/src/argparser.py index 8f94c2e..9baa507 100644 --- a/src/argparser.py +++ b/src/argparser.py @@ -73,7 +73,7 @@ class ArgParser(): self.optmap = {} self.__out = sys.stderr.buffer if usestderr else sys.stdout.buffer self.abbreviations = abbreviations if abbreviations is not None else lambda arg, candidates : None - self.__abbreviations = lambda arg : self.abbreviations(arg, self.optmap.keys()) + self.__abbreviations = lambda arg : self.abbreviations(arg, list(self.optmap.keys())) @staticmethod @@ -81,7 +81,7 @@ class ArgParser(): ''' Gets the standard abbrevation expender - @return (str, itr)→str? The standard abbrevation expender + @return (str, list)→str? The standard abbrevation expender ''' one = lambda arg : arg[0] if len(arg) == 1 else None return lambda arg, candidates : one(list(filter(lambda a : a.startswith(arg), candidates))) -- cgit v1.2.3-70-g09d2