From 55d17c3776d312cdbeb77fb9e56d19d48f876153 Mon Sep 17 00:00:00 2001 From: Kamil Bugajski Date: Mon, 20 Aug 2012 17:16:40 +0200 Subject: [PATCH 1/3] =?UTF-8?q?zahl=20startet=20bei=201=20nach=20'=20'=20u?= =?UTF-8?q?nd=20gro=C3=9Fbuchstaben?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/piccreate.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/piccreate.py b/libs/piccreate.py index b446971..9540bf3 100644 --- a/libs/piccreate.py +++ b/libs/piccreate.py @@ -163,6 +163,8 @@ class Word: content = dict() content['posy'] = y g = self.font.GlyphGet(c) + if c ==' ' or c.isupper() : + counter = 0 content['posx'] = str(x) # die Position ist erst für den nächsten Buchstaben relevant x = g.GetLength() + x + glyph_space @@ -171,6 +173,7 @@ class Word: if params['counter_replace']: xn = g.GetAttribute('npattern') for i in range(1, int(xn)+1): + counter = counter + 1 content['x'+str(i)] = counter svgstr = svgstr + g.GetSVG(content) From 11cbfdb510f2070c616ecf2ee61760764b97d498 Mon Sep 17 00:00:00 2001 From: Kamil Bugajski Date: Mon, 20 Aug 2012 17:24:27 +0200 Subject: [PATCH 2/3] starte von 1 als switch --- libs/piccreate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/piccreate.py b/libs/piccreate.py index 9540bf3..90ec728 100644 --- a/libs/piccreate.py +++ b/libs/piccreate.py @@ -163,7 +163,7 @@ class Word: content = dict() content['posy'] = y g = self.font.GlyphGet(c) - if c ==' ' or c.isupper() : + if options.startfrom and (c ==' ' or c.isupper()) : counter = 0 content['posx'] = str(x) # die Position ist erst für den nächsten Buchstaben relevant @@ -375,6 +375,9 @@ Read Confg, create wakeup and scale this kind of jiffy box parser.add_option("-i", "--infile", dest="infile", help="csv file with input of names/content", action='store') + parser.add_option("-s", "--startfrom", dest="startfrom", + help="csv file with input of names/content", + action='store_true') parser.add_option("-o", "--outdir", dest="outdir", default=os.path.expandvars('$PICCREATE_OUT'), help="path to the directory where the maps will be generated", action='store') From 2b867baef7b6be31fc15d95639427e2a871ee424 Mon Sep 17 00:00:00 2001 From: Kamil Bugajski Date: Mon, 20 Aug 2012 17:35:42 +0200 Subject: [PATCH 3/3] vergleich mit re.match() --- libs/piccreate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/piccreate.py b/libs/piccreate.py index 90ec728..21cae3c 100644 --- a/libs/piccreate.py +++ b/libs/piccreate.py @@ -8,6 +8,7 @@ __license__ = 'BSD' import optparse import os +import re import ConfigParser from utils import CSVImport, CompleteEnding, get_translation from django.utils.encoding import smart_str, smart_unicode @@ -163,7 +164,7 @@ class Word: content = dict() content['posy'] = y g = self.font.GlyphGet(c) - if options.startfrom and (c ==' ' or c.isupper()) : + if options.startfrom and (re.match(c,' ') or c.isupper()) : counter = 0 content['posx'] = str(x) # die Position ist erst für den nächsten Buchstaben relevant