def test_ways2bfmap(self): properties = dict(line.strip().split('=') for line in open('/mnt/bfmap/test/test.properties')) bfmap.schema("localhost", 5432, properties[ "database"], "bfmap_ways", properties["user"], properties["password"], False) config = bfmap.config(properties["config"]) bfmap.ways2bfmap("localhost", 5432, properties["database"], "temp_ways", properties["user"], properties[ "password"], "localhost", 5432, properties["database"], "bfmap_ways", properties["user"], properties["password"], config, False) return
def test_ways2bfmap(self): properties = dict(line.strip().split('=') for line in open('/mnt/bfmap/test/test.properties')) bfmap.schema("localhost", 5432, properties["database"], "bfmap_ways", properties["user"], properties["password"], False) config = bfmap.config(properties["config"]) bfmap.ways2bfmap("localhost", 5432, properties["database"], "temp_ways", properties["user"], properties["password"], "localhost", 5432, properties["database"], "bfmap_ways", properties["user"], properties["password"], config, False) return
options.target_user == None or \ options.config == None: parser.print_help() exit(1) if options.source_password == None: source_password = getpass.getpass("Password (source database):") else: source_password = options.source_password if options.target_password == None: target_password = getpass.getpass("Password (target database):") else: target_password = options.target_password config = bfmap.config(options.config) print("Configuration imported.") if not bfmap.exists(options.target_host, options.target_port, options.target_database, options.target_table, options.target_user, target_password): print("Table '%s' does not exist in database '%s'." % (options.target_table, options.target_database)) else: print("Table '%s' already exists in database '%s'." % (options.target_table, options.target_database)) while True: value = raw_input( "Do you want to remove table '%s' (y/n)? [n]: " % options.target_table).lower() if value == '' or value == 'n': print("Cancelled by user.") exit(0)
options.target_user == None or \ options.config == None: parser.print_help() exit(1) if options.source_password == None: source_password = getpass.getpass("Password (source database):") else: source_password = options.source_password if options.target_password == None: target_password = getpass.getpass("Password (target database):") else: target_password = options.target_password config = bfmap.config(options.config) print("Configuration imported.") if not bfmap.exists(options.target_host, options.target_port, options.target_database, options.target_table, options.target_user, target_password): print("Table '%s' does not exist in database '%s'." % (options.target_table, options.target_database)) bfmap.schema(options.target_host, options.target_port, options.target_database, options.target_table, options.target_user, target_password, options.printonly) print("Table '%s' has been created." % options.target_table) else: print("Table '%s' already exists in database '%s'." % (options.target_table, options.target_database)) if not options.append: