-
Boudjada Yasser committed with GitHub 2 years ago1 parent fe5b8c66
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
-
1 - #!/usr/bin/env python 2 - # coding:utf-8 3 - # code by : yasserbdj96 4 - # email : [email protected] 5 - 6 - #START{ 7 - #import os 8 - import pexpect 9 - import sys 10 - import shutil 11 - 12 - try: 13 - path=sys.argv[1] 14 - user=sys.argv[2] 15 - passw=sys.argv[3] 16 - except: 17 - print(f"USAGE : python3 {sys.argv[0]} <PATH> <USERNAME> <PASSWORD>") 18 - exit() 19 - 20 - #os.chdir(path) 21 - 22 - child=pexpect.spawn("python setup.py sdist bdist_wheel") 23 - #child.before 24 - child.interact() 25 - #print(child.read().decode("utf-8")) 26 - child.kill(0) 27 - 28 - child=pexpect.spawn("python -m twine upload dist/*") 29 - #child.before 30 - child.expect('Enter your username: ') 31 - child.sendline(user) 32 - child.expect('Enter your password: ') 33 - child.sendline(passw) 34 - #print(child.read().decode("utf-8")) 35 - child.interact() 36 - child.kill(0) 37 - 38 - """ 39 - rmv=["build","dist",path+".egg-info"] 40 - 41 - try: 42 - for i in range(len(rmv)): 43 - shutil.rmtree(rmv[i]) 44 - except OSError as e: 45 - print("Error: %s - %s." % (e.filename, e.strerror)) 46 - """ 47 - #}END.