sys.path.append('/home/ou/ou/codes/lib/') import olib as ob #----------------------------------------------------------------------------- #- choose a job to perform - #----------------------------------------------------------------------------- jobs = {} jobs['a'] = "Yu's GPE Model" jobs['b'] = "test shallow water model" jobs['c'] = "swmod" #loopList = ['y','','yes','Y','yeah'] ob.greenLine() ob.printDic(jobs) ans = ob.greenInput('\n choose: ') # read codes of Yu's global primitive model #----------------------------------------------------------------------------- yesList = ['y','','Y','yes','yeah'] if ans == 'a' or ans == '': os.chdir('/home/ou/ou/codes/ymod') os.popen(r'"gvim" Main.f90') elif ans == 'b': os.chdir('/home/ou/temp/ymod/') os.popen(r'"gvim" Main.f90') elif ans == 'c': os.chdir('/home/ou/ou/codes/swmod') os.popen(r'"gvim" swmod.py') else: ob.greenText('do not select any job...')
sys.exit(1) elif case == 'c': workDir = '/home/ou/ou/docs/' os.chdir(workDir) mainTexFile = 'index.tex' includes = {} includes['a'] = ' 软件使用相关文档' includes['b'] = ' 书籍册子' includes['c'] = ' 自建文档' includes['d'] = ' 搜集文档' includes['e'] = ' 课件材料' includes['f'] = ' 表格通知名单' ob.greenLine() ob.printDic(includes) include = ob.greenInput('\n choose a category: ') if include in ['a','']: category = 'swdocs' elif include == 'b': category = 'books' elif include == 'c': category = 'created' elif include == 'd': category = 'collected' elif include == 'e': category = 'lectures' elif include == 'f': category = 'office' else: ob.redText('\n wrong selection.') sys.exit(1) gvim = 'gvim ' + 'include/'+ category + '.tex' os.popen(gvim) #----------------------------------------------------------------------------- # compile the tex source file compileIt = ob.greenInput('\n compile it?(y/n): ')