Ejemplo n.º 1
0
def make_cache(hos):
    os.chdir(hos)
    print >> sys.stderr, r'[' + hos + r']'
    lmr3796.set_env('doh.json')
    lmr3796.get_all_dept(True)
    lmr3796.get_all_doc(True)
    os.system('chown www-data:lmr3796 *.pickle')
    os.system('chmod 664 *.pickle')
    print >> sys.stderr, ''
    os.chdir('..')
Ejemplo n.º 2
0
def main():
    global status
    os.chdir('../deploy')
    for hos in HOS_NAME:
        os.chdir(hos)
        lmr3796.set_env('./doh.json')
        dept_id = json.loads(lmr3796.dept_handler())[2].items()[0][0]
        #dept_id = '0210'
        doc_id  = json.loads(lmr3796.dept_handler(dept_id))[2]['doctor'][0].items()[0][0]
        time    = json.loads(lmr3796.doc_handler(dept_id=dept_id, doc_id=doc_id))[3]['time'][0]
        try:
            reg(dept_id, doc_id, time) 
            can(dept_id, doc_id, time) 
            num(dept_id)
        except BaseException as e:
            print e
            status_dump(hos, dept_id, doc_id, time)
            raise
        os.chdir('..')
    return 0