From 4cf2e75dc19d05f61fa5d1a5182fe4364b79ca95 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Fri, 21 Jun 2013 21:18:10 +0000 Subject: [PATCH] justification of numbers done with space instead of "0"s --- processing/pre/geom_unpack.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/processing/pre/geom_unpack.py b/processing/pre/geom_unpack.py index d8a2a7f89..50606a0d1 100755 --- a/processing/pre/geom_unpack.py +++ b/processing/pre/geom_unpack.py @@ -134,14 +134,14 @@ for file in files: #--- unpack input --------------------------------------------------------------------------------- wordsWritten = 0 for line in content: - words = map(str.lower,line.split()) - if len(words) > 1: # any packing keywords? - if (words[1] == 'to'): words = map(str,range(int(words[0]),int(words[2])+1)) - if (words[1] == 'of'): words = [words[2]]*int(words[0]) + words = line.split() + if len(words) > 2: # any packing keywords? + if words[1].lower() == 'to': words = map(str,range(int(words[0]),int(words[2])+1)) + elif words[1].lower() == 'of': words = [words[2]]*int(words[0]) for word in words: wordsWritten += 1 - file['output'].write(word.zfill(digits)+{True:'\n',False:' '}[wordsWritten%format == 0]) # newline every format words + file['output'].write(word.rjust(digits)+{True:'\n',False:' '}[wordsWritten%format == 0]) # newline every format words #--- output finalization -------------------------------------------------------------------------- if file['name'] != 'STDIN':