Browse Source

Fix #56, GGC conversion now can handle server group in two digits

lennylxx 8 years ago
parent
commit
d99872b64b
1 changed files with 5 additions and 2 deletions
  1. 5 2
      tools/conv.py

+ 5 - 2
tools/conv.py

@@ -73,8 +73,11 @@ def main():
         ret += iata2sn(input[:-1])
         ret += iata2sn(input[:-1])
         ret += num2code(input[-1])
         ret += num2code(input[-1])
     elif sys.argv[1] == '-g':
     elif sys.argv[1] == '-g':
-        ret += sn2iata(input[:-1])
-        ret += code2num(input[-1])
+        lst = input.split('-')
+        ret += sn2iata(lst[0])
+        ret += "-"
+        ret += sn2iata(lst[1][0:3])
+        ret += code2num(lst[1][3:])
     else:
     else:
         print 'Unknown option.'
         print 'Unknown option.'
         sys.exit(1)
         sys.exit(1)