Ticket #3148: main_ep.diff
| File main_ep.diff, 1.8 kB (added by alberto@toscat.net, 7 months ago) |
|---|
-
sqlite2pg
old new 1 #!/usr/bin/ python1 #!/usr/bin/env python 2 2 3 3 # -*- coding: utf-8 -*- 4 4 # … … 65 65 66 66 def migrateTable(self, table): 67 67 """ Migrate the table specified. """ 68 if not opts.noclean:68 if not self.opts.noclean: 69 69 self.cleanTable(table) 70 70 m = getattr(self, ''.join(['migrate_', table.upper()]), None) 71 71 if not m: … … 129 129 scur = self.sdb.cursor() 130 130 pgcur = self.pgdb.cursor() 131 131 rows = row_exists = 0 132 if not opts.plist:132 if not self.opts.plist: 133 133 sql_select = "SELECT * FROM permission" 134 134 else: 135 135 subs = [] … … 163 163 scur = self.sdb.cursor() 164 164 pgcur = self.pgdb.cursor() 165 165 rows = row_exists = 0 166 if not opts.wlist:166 if not self.opts.wlist: 167 167 sql_select = "SELECT * FROM wiki" 168 168 else: 169 169 subs = [] … … 255 255 256 256 return rc 257 257 258 def doArgs( ):258 def doArgs(argv): 259 259 """ Look if you can't guess what this function does, just give up now. """ 260 260 global VERSION 261 261 … … 290 290 help="Do not clear PostgreSQL tables before transfer", 291 291 default=False) 292 292 293 (options, args) = parser.parse_args( )293 (options, args) = parser.parse_args(argv) 294 294 if not options.tracenv: 295 295 if not options.tracbase: 296 296 print ("You must specify the --tracenv or the --tracbase option") … … 326 326 return options 327 327 328 328 329 def main(argv): 330 opts = doArgs(argv) 331 Main(opts) 332 return 0 333 329 334 if __name__ == '__main__': 330 opts = doArgs() 331 Main(opts) 332 sys.exit(0) 335 sys.exit(main(sys.argv[1:])) 333 336
