add basic vars info
This commit is contained in:
parent
7be0248dcc
commit
e80c9bda6e
@ -6,12 +6,20 @@
|
||||
##################################
|
||||
# #
|
||||
# #
|
||||
# Version: 3.0 (1-Aug-2022) #
|
||||
# Version: 3.0 (1-Aug-2022) #
|
||||
# Author: Shr-Lnm #
|
||||
# #
|
||||
# #
|
||||
##################################
|
||||
|
||||
__author__ = "Shr-Lnm"
|
||||
__copyright__ = "Copyright 2018-2022"
|
||||
__credits__ = []
|
||||
# __license__ = "GNU" # Unknown licence!
|
||||
__version__ = "3.0.0" # python3 maybe ?
|
||||
__maintainer__ = "Shr-Lnm"
|
||||
__email__ = "mshkn@inbox.ru"
|
||||
__status__ = "Beta"
|
||||
|
||||
import os
|
||||
import shutil
|
||||
@ -33,9 +41,8 @@ currenPath = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
for f in listdir('.'):
|
||||
if isdir('./' + f) and f.lower().startswith('pyren3') and isdir('./' + f + '/serial'):
|
||||
sys.path.append(os.path.join(currenPath,f))
|
||||
sys.path.append(os.path.join(currenPath,f,"serial"))
|
||||
|
||||
sys.path.append(os.path.join(currenPath, f))
|
||||
sys.path.append(os.path.join(currenPath, f, "serial"))
|
||||
|
||||
if osname == 'nt':
|
||||
import pip
|
||||
@ -81,6 +88,7 @@ if osname == 'android':
|
||||
print("Error while using jnius")
|
||||
sys.exit()
|
||||
|
||||
|
||||
def update_from_gitlab():
|
||||
try:
|
||||
import os
|
||||
@ -103,7 +111,7 @@ def update_from_gitlab():
|
||||
|
||||
h_user_agent = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.3'}
|
||||
req = urllib.request.Request('https://gitlab.com/py_ren/pyren/-/archive/pyren3/pyren-pyren3.zip', headers=h_user_agent)
|
||||
filedata = urllib.request.urlopen(req, context=ctx, timeout = 10)
|
||||
filedata = urllib.request.urlopen(req, context=ctx, timeout=10)
|
||||
datatowrite = filedata.read()
|
||||
|
||||
with open('./pyren-pyren3.zip', 'wb') as f:
|
||||
@ -121,14 +129,14 @@ def update_from_gitlab():
|
||||
if os.path.altsep:
|
||||
arcname = arcname.replace(os.path.altsep, os.path.sep)
|
||||
arcname = os.path.splitdrive(arcname)[1].split(os.path.sep)[0]
|
||||
rootDirLen = len(arcname)+1
|
||||
rootDirLen = len(arcname) + 1
|
||||
dst = src[rootDirLen:]
|
||||
filename = os.path.basename(src)
|
||||
if not filename:
|
||||
if dst and not os.path.exists(dst):
|
||||
os.makedirs(dst)
|
||||
continue
|
||||
|
||||
|
||||
source = zip_file.open(src)
|
||||
target = open(dst, "wb")
|
||||
with source, target:
|
||||
@ -141,6 +149,7 @@ def update_from_gitlab():
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def getPathList():
|
||||
return ['./' + f for f in listdir('.') if isdir('./' + f) \
|
||||
and f.lower().startswith('pyren') \
|
||||
@ -148,10 +157,11 @@ def getPathList():
|
||||
|
||||
|
||||
def getLangList():
|
||||
#if not os.path.exists('./Location'):
|
||||
# if not os.path.exists('./Location'):
|
||||
# return []
|
||||
#return [f[10:-4] for f in listdir('./Location') if f.lower().startswith('diagoncan_')]
|
||||
return ['AL','CNT','CO','CR','CZ','DK','EL','FI','FR','GB','HG','IT','JP','NG','NL','PL','PO','RO','RU','SD','SL','SP','TR']
|
||||
# return [f[10:-4] for f in listdir('./Location') if f.lower().startswith('diagoncan_')]
|
||||
return ['AL', 'CNT', 'CO', 'CR', 'CZ', 'DK', 'EL', 'FI', 'FR', 'GB', 'HG', 'IT', 'JP', 'NG', 'NL', 'PL', 'PO', 'RO', 'RU', 'SD', 'SL', 'SP', 'TR']
|
||||
|
||||
|
||||
def getPortList():
|
||||
ret = []
|
||||
@ -263,7 +273,7 @@ def run(s, cmd):
|
||||
sys.argv = sys.argv + s.options.split()
|
||||
if cmd == 'term':
|
||||
sys.argv.append('--dialog')
|
||||
#sys.argv.append('--demo')
|
||||
# sys.argv.append('--demo')
|
||||
if cmd == 'ddt':
|
||||
sys.argv.append('--demo')
|
||||
os.chdir(s.path)
|
||||
@ -532,7 +542,7 @@ if osname != 'android':
|
||||
self.lCSV.configure(highlightbackground="#d9d9d9")
|
||||
self.lCSV.configure(highlightcolor="black")
|
||||
self.lCSV.configure(width=240)
|
||||
|
||||
|
||||
self.lKWP = tk.LabelFrame(self.root)
|
||||
self.lKWP.place(relx=0.5, rely=0.43, relheight=0.125, relwidth=0.48)
|
||||
self.lKWP.configure(relief=tk.GROOVE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user