def TaskerDo(argv): try: if len(argv) != 4 and len(argv) != 5: usage() if len(argv) >= 4: taskfile = argv[2] projectname = argv[3] if len(argv) == 5: path = argv[4] + os.sep else: path = os.getcwd() + os.sep tasker = Tasker() tasker.processTask(taskfile, projectname, path) tasker.runAnnotator(taskfile, projectname, path) tasktime = os.path.getmtime(taskfile) modifiedlist = tasker.listModified(taskfile, projectname, path).strip() if modifiedlist == '': modifiedlist = [] else: modifiedlist = modifiedlist.split('\n') if len(modifiedlist) == 0: print "\n - No descriptor pool modified. Exiting without uploading anything.\n" else: print "\n - The following descriptor pools will be uploaded:\n -" + ( '\n - ').join(modifiedlist) answer = raw_input("\n > Do you want to do it? (y/n) ") if answer.strip() == 'y': if tasker.uploadChanges(taskfile, projectname, path) == -1: print "\n - Error uploading descriptors\n" else: print "\n - Descriptors uploaded OK\n" else: print "\n - No descriptor uploaded\n" #tasker.clean() except TaskerError, err: print >> sys.stderr, err sys.exit(-1)
def TaskerDo( argv ): try: if len( argv ) != 4 and len( argv ) != 5: usage() if len( argv ) >= 4: taskfile = argv[2] projectname = argv[3] if len (argv ) == 5: path = argv[4] + os.sep else: path = os.getcwd() + os.sep tasker=Tasker() tasker.processTask( taskfile, projectname, path ) tasker.runAnnotator( taskfile, projectname, path ) tasktime = os.path.getmtime( taskfile ) modifiedlist = tasker.listModified( taskfile, projectname, path ).strip() if modifiedlist == '': modifiedlist = [] else: modifiedlist = modifiedlist.split('\n') if len( modifiedlist )==0: print "\n - No descriptor pool modified. Exiting without uploading anything.\n" else: print "\n - The following descriptor pools will be uploaded:\n -" + ( '\n - ' ).join( modifiedlist ) answer = raw_input( "\n > Do you want to do it? (y/n) " ) if answer.strip() == 'y': if tasker.uploadChanges( taskfile, projectname, path ) == -1: print "\n - Error uploading descriptors\n" else: print "\n - Descriptors uploaded OK\n" else: print "\n - No descriptor uploaded\n" #tasker.clean() except TaskerError, err: print >> sys.stderr, err sys.exit(-1)
def TaskerRunannotator( argv ): if len( argv ) != 5: usage() tasker=Tasker() tasker.runAnnotator( argv[2], argv[3], argv[4] )
def TaskerRunannotator(argv): if len(argv) != 5: usage() tasker = Tasker() tasker.runAnnotator(argv[2], argv[3], argv[4])