mirror of
https://gitlab.os-k.eu/neox/CNIRevelator.git
synced 2023-08-25 14:03:10 +02:00
Working on Launcher
This commit is contained in:
parent
a9ea152e74
commit
23989a9ffa
BIN
id-card.png
BIN
id-card.png
Binary file not shown.
Before Width: | Height: | Size: 3.9 KiB |
9
make.bat
9
make.bat
@ -1,9 +1,18 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
title Compilation de CNIRLauncher
|
||||||
|
|
||||||
|
call pyinstaller -w -D --exclude-module PyQt5 --bootloader-ignore-signals --add-data "C:\users\adrie\Anaconda3\Lib\site-packages\tld\res\effective_tld_names.dat.txt";"tld\res" --add-data "id-card.ico";"id-card.ico" -i "id-card.ico" -n CNILauncher src\launcher\CNIRLauncher.py
|
||||||
|
|
||||||
title Compilation de CNIRevelator
|
title Compilation de CNIRevelator
|
||||||
|
|
||||||
call pyinstaller -w -D --exclude-module PyQt5 --bootloader-ignore-signals --add-data "C:\users\adrie\Anaconda3\Lib\site-packages\tld\res\effective_tld_names.dat.txt";"tld\res" --add-data "id-card.ico";"id-card.ico" -i "id-card.ico" -n CNIRevelator src\analyzer\CNI_Revelator.py
|
call pyinstaller -w -D --exclude-module PyQt5 --bootloader-ignore-signals --add-data "C:\users\adrie\Anaconda3\Lib\site-packages\tld\res\effective_tld_names.dat.txt";"tld\res" --add-data "id-card.ico";"id-card.ico" -i "id-card.ico" -n CNIRevelator src\analyzer\CNI_Revelator.py
|
||||||
|
|
||||||
copy LICENSE dist\CNIRevelator\
|
copy LICENSE dist\CNIRevelator\
|
||||||
|
copy id-card.ico dist\CNIRevelator\
|
||||||
|
|
||||||
|
robocopy dist\CNILauncher dist\CNIRevelator /E /MOVE
|
||||||
|
|
||||||
|
rmdir dist\CNILauncher /Q /S
|
||||||
|
|
||||||
pause
|
pause
|
||||||
|
|
||||||
|
BIN
mrz.traineddata
BIN
mrz.traineddata
Binary file not shown.
BIN
ocr-0.2.zip
BIN
ocr-0.2.zip
Binary file not shown.
@ -25,28 +25,40 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
|
import threading
|
||||||
|
import traceback
|
||||||
|
|
||||||
import logger # logger.py
|
import updater # updater.py
|
||||||
import ihm # ihm.py
|
import ihm # ihm.py
|
||||||
|
import globs # globs.py
|
||||||
|
from globs import logfile
|
||||||
|
|
||||||
## Main function
|
## Main function
|
||||||
def main():
|
def main():
|
||||||
# Creating a log file and removing the old
|
|
||||||
logfile = logger.NewLoggingSystem()
|
# Starting the main update thread
|
||||||
|
mainThread.start()
|
||||||
|
|
||||||
# Hello world
|
# Hello world
|
||||||
logfile.printdbg('*** CNIRLauncher LOGFILE. Hello World ! ***')
|
logfile.printdbg('*** CNIRLauncher LOGFILE. Hello World ! ***')
|
||||||
|
logfile.printdbg('Files in directory : ' + str(os.listdir(globs.CNIRFolder)))
|
||||||
|
|
||||||
|
# Hello user
|
||||||
launcherWindow = ihm.LauncherWindow()
|
launcherWindow = ihm.LauncherWindow()
|
||||||
|
|
||||||
|
launcherWindow.progressBar.configure(mode='indeterminate', value=0, maximum=20)
|
||||||
|
launcherWindow.mainCanvas.itemconfigure(launcherWindow.msg, text='Chalut!')
|
||||||
|
launcherWindow.progressBar.start()
|
||||||
|
|
||||||
launcherWindow.mainloop()
|
launcherWindow.mainloop()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Bootstrap
|
## Bootstrap
|
||||||
main()
|
try:
|
||||||
sys.exit(0)
|
mainThread = threading.Thread(target=updater.umain, daemon=True)
|
||||||
|
main()
|
||||||
|
except Exception:
|
||||||
|
logfile.printerr("A FATAL ERROR OCCURED : " + str(traceback.format_exc()))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
sys.exit(0)
|
@ -23,8 +23,12 @@
|
|||||||
********************************************************************************
|
********************************************************************************
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
|
import logger # logger.py
|
||||||
|
|
||||||
CNIRTesserHash = '5b58db27f7bc08c58a2cb33d01533b034b067cf8'
|
CNIRTesserHash = '5b58db27f7bc08c58a2cb33d01533b034b067cf8'
|
||||||
#CNIRFolder = os.getenv('APPDATA') + '/CNIRevelator/'
|
CNIRFolder = os.getcwd()
|
||||||
CNIRFolder = "."
|
CNIRLColor = "#006699"
|
||||||
CNIRLColor = "#003380"
|
CNIRName = "CNIRevelator Launcher 3.x"
|
||||||
|
|
||||||
|
# Creating a log file and removing the old
|
||||||
|
logfile = logger.NewLoggingSystem()
|
BIN
src/launcher/id-card.ico
Normal file
BIN
src/launcher/id-card.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
@ -29,6 +29,7 @@ from tkinter import filedialog
|
|||||||
from tkinter import ttk
|
from tkinter import ttk
|
||||||
|
|
||||||
import globs # globs.py
|
import globs # globs.py
|
||||||
|
from globs import logfile
|
||||||
|
|
||||||
class LoginDialog(Toplevel):
|
class LoginDialog(Toplevel):
|
||||||
|
|
||||||
@ -59,7 +60,7 @@ class LoginDialog(Toplevel):
|
|||||||
y = hs / 2 - h / 2
|
y = hs / 2 - h / 2
|
||||||
self.geometry('%dx%d+%d+%d' % (w, h, x, y))
|
self.geometry('%dx%d+%d+%d' % (w, h, x, y))
|
||||||
|
|
||||||
def connecti(self):
|
def logingin(self):
|
||||||
global key
|
global key
|
||||||
global login
|
global login
|
||||||
login = self.entry_login.get().strip()
|
login = self.entry_login.get().strip()
|
||||||
@ -73,24 +74,25 @@ class LauncherWindow(Tk):
|
|||||||
Tk.__init__(self)
|
Tk.__init__(self)
|
||||||
self.configure(bg=globs.CNIRLColor)
|
self.configure(bg=globs.CNIRLColor)
|
||||||
self.resizable(width=False, height=False)
|
self.resizable(width=False, height=False)
|
||||||
|
self.queue = []
|
||||||
|
|
||||||
# Setting up the geometry
|
# Setting up the geometry
|
||||||
ws = self.winfo_screenwidth()
|
ws = self.winfo_screenwidth()
|
||||||
hs = self.winfo_screenheight()
|
hs = self.winfo_screenheight()
|
||||||
wheight = ws /4
|
wheight = hs /4
|
||||||
wwidth = hs /4
|
wwidth = ws /4
|
||||||
#self.update()
|
#self.update()
|
||||||
|
|
||||||
# Creating objects
|
# Creating objects
|
||||||
self.mainCanvas = Canvas(self, width=wwidth, height=wheight, bg=globs.CNIRLColor, highlightthickness=0)
|
self.mainCanvas = Canvas(self, width=wwidth, height=wheight*9/10, bg=globs.CNIRLColor, highlightthickness=0)
|
||||||
self.pBarZone = Canvas(self, width=wwidth, height=wheight/10, bg=globs.CNIRLColor)
|
self.pBarZone = Canvas(self, width=wwidth, height=wheight/10, bg=globs.CNIRLColor)
|
||||||
|
|
||||||
self.progressBar = ttk.Progressbar(self.pBarZone, orient=HORIZONTAL, length=wwidth-10, mode='determinate')
|
self.progressBar = ttk.Progressbar(self.pBarZone, orient=HORIZONTAL, length=wwidth-10, mode='determinate')
|
||||||
self.update()
|
#self.update()
|
||||||
|
|
||||||
self.mainCanvas.create_text((wwidth / 2), (wheight / 3), text=("TEST"), font='Calibri 30 bold', fill='white')
|
self.mainCanvas.create_text((wwidth / 2), (wheight / 3), text=(globs.CNIRName), font='Calibri 30 bold', fill='white')
|
||||||
self.msg = self.mainCanvas.create_text((wwidth / 2), (wheight / 1.15), text=' ', font='Calibri 9', fill='white')
|
self.msg = self.mainCanvas.create_text((wwidth / 2.05), (wheight / 1.20), text='Starting...', font='Calibri 9', fill='white')
|
||||||
self.update()
|
#self.update()
|
||||||
|
|
||||||
# Centering
|
# Centering
|
||||||
x = ws / 2 - wwidth / 2
|
x = ws / 2 - wwidth / 2
|
||||||
@ -102,11 +104,11 @@ class LauncherWindow(Tk):
|
|||||||
|
|
||||||
#self.after(2000, updating)
|
#self.after(2000, updating)
|
||||||
|
|
||||||
# if getattr(sys, 'frozen', False):
|
if getattr(sys, 'frozen', False):
|
||||||
# self.iconbitmap(sys._MEIPASS + '\\id-card.ico\\id-card.ico')
|
self.iconbitmap(sys._MEIPASS + '\\id-card.ico\\id-card.ico')
|
||||||
# else:
|
else:
|
||||||
# self.iconbitmap('id-card.ico')
|
self.iconbitmap('id-card.ico')
|
||||||
# logger.info('Success !')
|
logfile.printdbg('Launcher IHM successful')
|
||||||
self.protocol('WM_DELETE_WINDOW', lambda : self.destroy())
|
self.protocol('WM_DELETE_WINDOW', lambda : self.destroy())
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,4 +21,30 @@
|
|||||||
* You should have received a copy of the GNU General Public License *
|
* You should have received a copy of the GNU General Public License *
|
||||||
* along with CNIRevelator. If not, see <https:*www.gnu.org/licenses/>. *
|
* along with CNIRevelator. If not, see <https:*www.gnu.org/licenses/>. *
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
"""
|
"""
|
||||||
|
from globs import logfile
|
||||||
|
from win32com.client import Dispatch
|
||||||
|
|
||||||
|
import globs # globs.py
|
||||||
|
|
||||||
|
def createShortcut(path, target='', wDir='', icon=''):
|
||||||
|
ext = path[-3:]
|
||||||
|
if ext == 'url':
|
||||||
|
shortcut = file(path, 'w')
|
||||||
|
shortcut.write('[InternetShortcut]\n')
|
||||||
|
shortcut.write('URL=%s' % target)
|
||||||
|
shortcut.close()
|
||||||
|
else:
|
||||||
|
shell = Dispatch('WScript.Shell')
|
||||||
|
shortcut = shell.CreateShortCut(path)
|
||||||
|
shortcut.Targetpath = target
|
||||||
|
shortcut.WorkingDirectory = wDir
|
||||||
|
if icon == '':
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
shortcut.IconLocation = icon
|
||||||
|
shortcut.save()
|
||||||
|
|
||||||
|
def umain():
|
||||||
|
for i in range(0,155555555555555):
|
||||||
|
print(i)
|
Loading…
Reference in New Issue
Block a user