Declared main() for packaging

This commit is contained in:
Jordan ERNST 2019-02-04 16:47:28 +01:00
parent 36a4339172
commit 23b3543ba9
2 changed files with 66 additions and 63 deletions

View File

@ -28,6 +28,7 @@ config = 'IFPass.conf'
def initialisation(): def initialisation():
global clientsfile, IFPassdir, clientsfile, clientID, imgdir, dateexp, titre, dateinsc, firstname, surname, clientsbkpfile, pngtemplate, fonttemplate, fullname, picture, pdftemplate, printername, AcrobatReader
conf = configparser.ConfigParser() conf = configparser.ConfigParser()
conf.optionxform = str # For case sensitive config file conf.optionxform = str # For case sensitive config file
@ -286,6 +287,7 @@ def membersearch():
print(colored("Aucun membre n'a été trouvé.", 'red', attrs=['bold'])) print(colored("Aucun membre n'a été trouvé.", 'red', attrs=['bold']))
def main():
while "The program is running": while "The program is running":
init() # Initialisation of colorama init() # Initialisation of colorama
IFPassdir, printername, AcrobatReader, clientsfile, clientsbkpfile, imgdir, pdftemplate, pngtemplate, fonttemplate = initialisation() IFPassdir, printername, AcrobatReader, clientsfile, clientsbkpfile, imgdir, pdftemplate, pngtemplate, fonttemplate = initialisation()
@ -331,6 +333,7 @@ while "The program is running":
if correct: if correct:
os.system('cls') os.system('cls')
if version != 'devnocam': if version != 'devnocam':
global picture
picture = getpic() picture = getpic()
clientID = getclientID() clientID = getclientID()
barcode = barcode_gen(clientID) barcode = barcode_gen(clientID)

View File

@ -1,10 +1,10 @@
[Application] [Application]
name=IFPass name=IFPass
version=2.2 version=2.2
target=IFPass.py entry_point=IFPass:main
[Python] [Python]
version=3.7.2 version=3.7.1
[Include] [Include]
# Packages from PyPI that your application requires, one per line # Packages from PyPI that your application requires, one per line