Skip to content
Snippets Groups Projects
Commit ea454655 authored by Auke Klazema's avatar Auke Klazema
Browse files

SW-598: Check on argument before asking password

parent 18909560
No related branches found
No related tags found
No related merge requests found
......@@ -184,24 +184,27 @@ if __name__ == '__main__':
dbPort = options.dbPort
dbUser = options.dbUser
dbPassword = getpass.getpass()
host = "{}:{}".format(dbHost, dbPort)
if len(args) != 3:
parser.print_help()
sys.exit(1)
stationname = str(args[0])
objecttype = str(args[1])
date_years = float(args[2])
dbPassword = getpass.getpass()
host = "{}:{}".format(dbHost, dbPort)
(X, Y, Z) = latlonhgt2xyz(52.9129392, 6.8690294, 54.1)
print X, Y, Z
(Xn, Yn, Zn) = i89toi2005([X, Y, Z], 2007.775342466)
print Xn, Yn, Zn
sys.exit(0)
date_years = float(sys.args[2])
db = pgdb.connect(user=dbUser, host=host, database=dbName, password=dbPassword)
cursor = db.cursor()
cursor.execute("select * from get_ref_objects(%s, %s)", (args[0], args[1]))
cursor.execute("select * from get_ref_objects(%s, %s)", (stationname, objecttype))
while (1):
record = cursor.fetchone()
if record is None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment