def main() : """ Mess with dates for testing purposes """ # Get the command line arguments p = optparse.OptionParser() p.add_option("--source_dir", action="store", dest="source_dir") p.add_option("--test_name", action="store", dest="test_name") opts, source_file_args = p.parse_args() #pylint: disable-msg=W0612 hostname = socket.gethostname().split('.')[0] while True : print "Enter Data or Alert D|A -> " mode = sys.stdin.readline() print "Enter New Date -> " date_string = sys.stdin.readline() date_object = datetime.strptime(date_string.rstrip(), '%Y %m %d %H:%M') if mode.rstrip() == 'D' : sync_data = SyncData(hostname, opts.source_dir, opts.test_name) sync_data.variable = date_object sync_data.write() else : sync_alert = SyncDataAlert(hostname, opts.source_dir, opts.test_name) sync_alert.variable = date_object sync_alert.write()