Example #1
0
def storage():
    datapath = os.path.dirname(__file__) + '\data'
    imgpath = r'D:\\IMG'
    gmp = GMP(imgpath)
    regisration = Regisration(imgpath)
    license = License(imgpath)
    certificate = ProductionCertificate(datapath, imgpath)
    pga = Improtdrug(imgpath)
    for file in os.walk(datapath):
        id_code = randomidcode()
        for file_name in file[2]:
        # if 'GMP证书' in file_name:
            gmp.gmp(file[0], id_code)
        # elif "营业执照" in file_name:
            license.license(file[0], id_code)
        # elif "药品再注册批件" in file_name:
            regisration.regisration(file[0], id_code)
        # elif '药品生产许可证' in file_name:
            certificate.recognize(file[0], id_code)
        # elif '说明书' in file_name:
            introduction.run_introduction(file[0], id_code)
        # elif '进口药品注册证' in file_name:
            try:
                pga.start(file[0], id_code, 'shuai', '')
            except Exception as e:
                logmgr = LogMgr()
                logmgr.error(file[0]+ ":" + str(e))
                continue


            break
Example #2
0
                 tweetbot.login()
                 if len(Q) > 140:
                     print('''\
                         This quote is more than 140 characters long.\n\
                         This tweet will be truncated to 140 characters.\n\
                         Proceed? (Y/n):''')
                     choice2 = input()
                     if choice2 == 'y' or choice2 =='Y' :
                         tweetbot.post(Q, successMessage = "You've just tweeted an awesome Quote!")
                     elif choice2 == 'n' or choice2 == 'N':
                         pass
                     else:
                         raise UnknownCommandException("Unknown choice {}".format(choice2))
                 else:
                     tweetbot.post(Q, successMessage = "You've just tweeted an awesome Quote!")
         elif sys.argv[1] == 'donate':
             print("Donation of Quotes is under construction. Will be operational soon")
             pass
         elif sys.argv[1] == 'license':
             license.license()
         else:
             raise UnknownCommandException("Unknown command {}".format(sys.argv[1]))
     
     except IndexError:
         print('''\nUse \'python src/main.py quote\' to get a quote\n'''\
             '''Use \'python src/main.py donate\' to donate a quote to QuoteGarden API\n'''\
             '''Use \'python src/main.py license\' to get license information''');
     except UnknownCommandException:
         print("\n{} is not a known MotivateU command".format(sys.argv[1]))
 except:
     print("You're not connected to the internet. Check your internet connection and try again")