radboy 0.0.826__py3-none-any.whl → 0.0.827__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of radboy might be problematic. Click here for more details.
- radboy/Comm/__pycache__/RxTx.cpython-313.pyc +0 -0
- radboy/TasksMode/Tasks.py +2 -0
- radboy/TasksMode/__pycache__/Tasks.cpython-313.pyc +0 -0
- radboy/Unified/BACKUP.py +436 -0
- radboy/Unified/Unified.py +2 -328
- radboy/Unified/__pycache__/Unified.cpython-313.pyc +0 -0
- radboy/__init__.py +1 -1
- radboy/__pycache__/__init__.cpython-313.pyc +0 -0
- {radboy-0.0.826.dist-info → radboy-0.0.827.dist-info}/METADATA +1 -1
- {radboy-0.0.826.dist-info → radboy-0.0.827.dist-info}/RECORD +12 -11
- {radboy-0.0.826.dist-info → radboy-0.0.827.dist-info}/WHEEL +0 -0
- {radboy-0.0.826.dist-info → radboy-0.0.827.dist-info}/top_level.txt +0 -0
|
Binary file
|
radboy/TasksMode/Tasks.py
CHANGED
|
@@ -52,6 +52,7 @@ from radboy.DB.NW.NetWorth import *
|
|
|
52
52
|
from decimal import Decimal as DEC
|
|
53
53
|
from radboy.DB.lsToday import *
|
|
54
54
|
from radboy.DB.GEMINI import *
|
|
55
|
+
from radboy.Unified.BACKUP import *
|
|
55
56
|
|
|
56
57
|
def today():
|
|
57
58
|
dt=datetime.now()
|
|
@@ -6124,6 +6125,7 @@ where:
|
|
|
6124
6125
|
'''
|
|
6125
6126
|
self.clear_all=lambda self=self:clear_all(self)
|
|
6126
6127
|
if not init_only:
|
|
6128
|
+
BACKUP.daemon(None)
|
|
6127
6129
|
while True:
|
|
6128
6130
|
def mkT(text,self):
|
|
6129
6131
|
return text
|
|
Binary file
|
radboy/Unified/BACKUP.py
ADDED
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
import pandas as pd
|
|
2
|
+
import csv
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from colored import Fore,Style,Back
|
|
6
|
+
from barcode import Code39,UPCA,EAN8,EAN13
|
|
7
|
+
import barcode,qrcode,os,sys,argparse
|
|
8
|
+
from datetime import datetime,timedelta
|
|
9
|
+
import zipfile,tarfile
|
|
10
|
+
import base64,json
|
|
11
|
+
from ast import literal_eval
|
|
12
|
+
import sqlalchemy
|
|
13
|
+
from sqlalchemy import *
|
|
14
|
+
from sqlalchemy.orm import *
|
|
15
|
+
from sqlalchemy.ext.declarative import declarative_base as dbase
|
|
16
|
+
from sqlalchemy.ext.automap import automap_base
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
import upcean
|
|
19
|
+
from radboy.ExtractPkg.ExtractPkg2 import *
|
|
20
|
+
from radboy.Lookup.Lookup import *
|
|
21
|
+
from radboy.DayLog.DayLogger import *
|
|
22
|
+
from radboy.DB.db import *
|
|
23
|
+
from radboy.DB.Prompt import *
|
|
24
|
+
from radboy.DB.SMLabelImporter import *
|
|
25
|
+
from radboy.DB.ResetTools import *
|
|
26
|
+
|
|
27
|
+
from radboy.ConvertCode.ConvertCode import *
|
|
28
|
+
from radboy.setCode.setCode import *
|
|
29
|
+
from radboy.Locator.Locator import *
|
|
30
|
+
from radboy.ListMode2.ListMode2 import *
|
|
31
|
+
from radboy.TasksMode.Tasks import *
|
|
32
|
+
from radboy.ExportList.ExportListCurrent import *
|
|
33
|
+
from radboy.TouchStampC.TouchStampC import *
|
|
34
|
+
from radboy.EntryExtras.Extras import *
|
|
35
|
+
from radboy import VERSION
|
|
36
|
+
import radboy.possibleCode as pc
|
|
37
|
+
from radboy.Unified.clearalll import *
|
|
38
|
+
from dataclasses import dataclass
|
|
39
|
+
def format_bytes(size):
|
|
40
|
+
"""
|
|
41
|
+
Auto-convert bytes to a human-readable format.
|
|
42
|
+
|
|
43
|
+
this was generated by Google's AI Console.
|
|
44
|
+
"""
|
|
45
|
+
power = 2**10
|
|
46
|
+
n = 0
|
|
47
|
+
power_labels = {0 : '', 1: 'K', 2: 'M', 3: 'G', 4: 'T'}
|
|
48
|
+
while size > power:
|
|
49
|
+
size /= power
|
|
50
|
+
n += 1
|
|
51
|
+
return f"{size:.2f} {power_labels[n]}B"
|
|
52
|
+
@dataclass
|
|
53
|
+
class BACKUP:
|
|
54
|
+
def daemon(self,limit=None):
|
|
55
|
+
bus=[]
|
|
56
|
+
backup_dir=Path(detectGetOrSet("Backup Directory",f"RadBoy Backups/{VERSION}",setValue=False,literal=True))
|
|
57
|
+
now=datetime.now()
|
|
58
|
+
if limit is None:
|
|
59
|
+
limit=timedelta(days=-7)
|
|
60
|
+
for root,dirs,fnames in backup_dir.walk(top_down=True):
|
|
61
|
+
for file in fnames:
|
|
62
|
+
fx=root/Path(file)
|
|
63
|
+
#print(f"{Fore.dark_goldenrod}Checking for age limited backups to delete({fx} >= {limit})){Style.reset}")
|
|
64
|
+
ctime=datetime.fromtimestamp(fx.stat().st_ctime)
|
|
65
|
+
age=ctime-now
|
|
66
|
+
|
|
67
|
+
if age >= limit:
|
|
68
|
+
bus.append(fx)
|
|
69
|
+
if len(bus) <= 0:
|
|
70
|
+
print(f"{Fore.orange_red_1}A Backup needs to be made!{Style.reset}")
|
|
71
|
+
__class__(dtbf=True)
|
|
72
|
+
|
|
73
|
+
def __init__(self,dtbf=False):
|
|
74
|
+
self.backup_dir=Path(detectGetOrSet("Backup Directory",f"RadBoy Backups/{VERSION}",setValue=False,literal=True))
|
|
75
|
+
self.limit=timedelta(days=-90)
|
|
76
|
+
limit=self.limit
|
|
77
|
+
self.now=datetime.now()
|
|
78
|
+
|
|
79
|
+
#check for older than 6-months
|
|
80
|
+
for root,dirs,fnames in self.backup_dir.walk(top_down=True):
|
|
81
|
+
cta=len(fnames)
|
|
82
|
+
for num,file in enumerate(fnames):
|
|
83
|
+
fx=root/Path(file)
|
|
84
|
+
ctime=datetime.fromtimestamp(fx.stat().st_ctime)
|
|
85
|
+
age=ctime-self.now
|
|
86
|
+
print(std_colorize(f"{Fore.light_magenta}Checking for age limited backups to delete ({fx} AGE({age}) <= {limit}){Style.reset}",num,cta))
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
if age <= limit:
|
|
90
|
+
print(f"{Fore.light_red}Deleting {Fore.light_steel_blue}{fx}{Fore.light_red} because it is {Fore.spring_green_3b}{age}{Fore.light_red}, which is >= {Fore.light_yellow}{limit}{Style.reset}")
|
|
91
|
+
fx.unlink()
|
|
92
|
+
|
|
93
|
+
self.backup(dtbf=dtbf)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def backup(self,dtbf=False):
|
|
101
|
+
backup_dir=self.backup_dir
|
|
102
|
+
if backup_dir == None:
|
|
103
|
+
backup_dir=Path('.')
|
|
104
|
+
else:
|
|
105
|
+
backup_dir=Path(backup_dir)
|
|
106
|
+
if not backup_dir.exists():
|
|
107
|
+
backup_dir.mkdir(parents=True)
|
|
108
|
+
startTime=datetime.now()
|
|
109
|
+
self.startTime=startTime
|
|
110
|
+
print(f"{Fore.orange_red_1}Backing {Fore.light_yellow}Files {Fore.light_green}up!{Style.reset}")
|
|
111
|
+
backup=''
|
|
112
|
+
while True:
|
|
113
|
+
try:
|
|
114
|
+
def mkBool(text,data):
|
|
115
|
+
try:
|
|
116
|
+
if text.lower() in ['','true','y','yes','1']:
|
|
117
|
+
return True
|
|
118
|
+
elif text.lower() in ['n','false','no','0']:
|
|
119
|
+
return False
|
|
120
|
+
else:
|
|
121
|
+
return bool(eval(text))
|
|
122
|
+
except Exception as e:
|
|
123
|
+
print(e)
|
|
124
|
+
return False
|
|
125
|
+
if not dtbf:
|
|
126
|
+
date_file=Prompt.__init2__(None,func=mkBool,ptext="Date and Time restore File?",helpText="y/n?",data=self)
|
|
127
|
+
if date_file in [None,]:
|
|
128
|
+
return True
|
|
129
|
+
elif isinstance(date_file,bool):
|
|
130
|
+
if date_file:
|
|
131
|
+
d=datetime.now().strftime("%m-%d-%Y-%H-%M-%S")
|
|
132
|
+
backup=backup_dir/Path(f"codesAndBarcodes-{d}.tgz")
|
|
133
|
+
else:
|
|
134
|
+
backup=backup_dir/Path(f"codesAndBarcodes.tgz")
|
|
135
|
+
else:
|
|
136
|
+
backup=backup_dir/Path(f"codesAndBarcodes-{d}.tgz")
|
|
137
|
+
else:
|
|
138
|
+
d=datetime.now().strftime("%m-%d-%Y-%H-%M-%S")
|
|
139
|
+
backup=backup_dir/Path(f"codesAndBarcodes-{d}.tgz")
|
|
140
|
+
break
|
|
141
|
+
except Exception as e:
|
|
142
|
+
print(e)
|
|
143
|
+
return True
|
|
144
|
+
if backup.exists():
|
|
145
|
+
backup.unlink()
|
|
146
|
+
|
|
147
|
+
with tarfile.open(backup,"w:gz") as gzf:
|
|
148
|
+
#gzf.add("codesAndBarcodes.db")
|
|
149
|
+
#gzf.add("Images")
|
|
150
|
+
#gzf.add("LCL_IMG")
|
|
151
|
+
with open("Run.py","wb") as runner:
|
|
152
|
+
lines=f'''#!/usr/bin/env python3
|
|
153
|
+
from pathlib import Path
|
|
154
|
+
ROOTDIR=str(Path().cwd())
|
|
155
|
+
from radboy import RecordMyCodes as rmc
|
|
156
|
+
rmc.quikRn(rootdir=ROOTDIR)'''.encode()
|
|
157
|
+
runner.write(lines)
|
|
158
|
+
'''
|
|
159
|
+
try:
|
|
160
|
+
print("adding module...")
|
|
161
|
+
m=Path("module")
|
|
162
|
+
if m.exists():
|
|
163
|
+
shutil.rmtree(m)
|
|
164
|
+
m.mkdir()
|
|
165
|
+
else:
|
|
166
|
+
m.mkdir()
|
|
167
|
+
os.system(f"pip download MobileInventoryCLI=={VERSION} -d {m}")
|
|
168
|
+
gzf.add(m)
|
|
169
|
+
print("added module code!")
|
|
170
|
+
except Exception as e:
|
|
171
|
+
print("could not finish adding modules/")
|
|
172
|
+
'''
|
|
173
|
+
#shutil.rmtree(m)
|
|
174
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{Path('Run.py')}{Style.reset}")
|
|
175
|
+
gzf.add("Run.py")
|
|
176
|
+
|
|
177
|
+
while True:
|
|
178
|
+
try:
|
|
179
|
+
def mkBool(text,self):
|
|
180
|
+
if text.lower() in ['','n','no','-']:
|
|
181
|
+
return False
|
|
182
|
+
elif text.lower() in ['y','yes','+']:
|
|
183
|
+
return True
|
|
184
|
+
else:
|
|
185
|
+
try:
|
|
186
|
+
return bool(eval(text))
|
|
187
|
+
except Exception as e:
|
|
188
|
+
print(e)
|
|
189
|
+
return False
|
|
190
|
+
if not dtbf:
|
|
191
|
+
rmRunner=Prompt.__init2__(None,func=mkBool,ptext="Delete 'Run.py'",helpText="default == 'No'",data=self)
|
|
192
|
+
if rmRunner:
|
|
193
|
+
Path("Run.py").unlink()
|
|
194
|
+
else:
|
|
195
|
+
pass
|
|
196
|
+
break
|
|
197
|
+
except Exception as e:
|
|
198
|
+
print(e)
|
|
199
|
+
|
|
200
|
+
with open("version.txt","w+") as version_txt:
|
|
201
|
+
version_txt.write(VERSION)
|
|
202
|
+
|
|
203
|
+
if Path("version.txt").exists():
|
|
204
|
+
print(f'{Fore.spring_green_3b}Adding {Fore.green_yellow}{Path("version.txt")}{Style.reset}')
|
|
205
|
+
gzf.add("version.txt")
|
|
206
|
+
Path("version.txt").unlink()
|
|
207
|
+
|
|
208
|
+
api_key_file=Path("./api_key")
|
|
209
|
+
if api_key_file.exists():
|
|
210
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{api_key_file}{Style.reset}")
|
|
211
|
+
gzf.add(api_key_file)
|
|
212
|
+
|
|
213
|
+
msg=f'''
|
|
214
|
+
{Fore.orange_red_1}Getting system settings files, testing for existance, if not found leaving alone!!!{Style.reset}
|
|
215
|
+
'''
|
|
216
|
+
print(msg)
|
|
217
|
+
#from ExportUtility/ExportTableClass.py
|
|
218
|
+
import_odf=detectGetOrSet("ImportODF",value="ImportExcel.xlsx.ods",literal=True)
|
|
219
|
+
if import_odf:
|
|
220
|
+
import_odf=Path(import_odf)
|
|
221
|
+
if import_odf.exists():
|
|
222
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{import_odf}{Style.reset}")
|
|
223
|
+
gzf.add(import_odf)
|
|
224
|
+
|
|
225
|
+
import_excel=detectGetOrSet("ImportExcel",value="ImportExcel.xlsx",literal=True)
|
|
226
|
+
if import_excel:
|
|
227
|
+
import_excel=Path(import_excel)
|
|
228
|
+
if import_excel.exists():
|
|
229
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{import_excel}{Style.reset}")
|
|
230
|
+
gzf.add(import_excel)
|
|
231
|
+
|
|
232
|
+
export_folder=Path(detectGetOrSet("ExportTablesFolder",value="ExportedTables",literal=True))
|
|
233
|
+
if export_folder:
|
|
234
|
+
export_folder=Path(export_folder)
|
|
235
|
+
if export_folder.exists() and export_folder.is_dir():
|
|
236
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{export_folder}{Style.reset}")
|
|
237
|
+
gzf.add(export_folder)
|
|
238
|
+
|
|
239
|
+
bootable="__bootable__.py"
|
|
240
|
+
if bootable:
|
|
241
|
+
bootable=Path(bootable)
|
|
242
|
+
if bootable.exists() and bootable.is_file():
|
|
243
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{bootable}{Style.reset}")
|
|
244
|
+
gzf.add(bootable)
|
|
245
|
+
|
|
246
|
+
pay_ws=Path("EstimatedPayCalendarWorkSheet.txt")
|
|
247
|
+
pay_ws=Path(detectGetOrSet("EstimatedPayCalendarExportFile",pay_ws,setValue=False,literal=True))
|
|
248
|
+
if pay_ws:
|
|
249
|
+
if pay_ws.exists():
|
|
250
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{pay_ws}{Style.reset}")
|
|
251
|
+
gzf.add(pay_ws)
|
|
252
|
+
|
|
253
|
+
combinations_receipt=Path(detectGetOrSet("combinations_receipt","combos.json.csv",setValue=False,literal=True))
|
|
254
|
+
if combinations_receipt:
|
|
255
|
+
if combinations_receipt.exists():
|
|
256
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{combinations_receipt}{Style.reset}")
|
|
257
|
+
gzf.add(combinations_receipt)
|
|
258
|
+
|
|
259
|
+
WebArchiveStore_folder=Path(detectGetOrSet("WebArchiveDownloadsFilePath","WebArchiveDownloads",literal=True))
|
|
260
|
+
if WebArchiveStore_folder:
|
|
261
|
+
WebArchiveStore_folder=Path(WebArchiveStore_folder)
|
|
262
|
+
if WebArchiveStore_folder.exists() and WebArchiveStore_folder.is_dir():
|
|
263
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{WebArchiveStore_folder}{Style.reset}")
|
|
264
|
+
gzf.add(WebArchiveStore_folder)
|
|
265
|
+
#from DB/Prompt.py
|
|
266
|
+
scanout=detectGetOrSet('CMD_TO_FILE',str(Path('./SCANNER.TXT')))
|
|
267
|
+
if scanout:
|
|
268
|
+
scanout=Path(scanout)
|
|
269
|
+
if scanout.exists():
|
|
270
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{scanout}{Style.reset}")
|
|
271
|
+
gzf.add(scanout)
|
|
272
|
+
|
|
273
|
+
#from TouchStampC/TouchStampC.py
|
|
274
|
+
ts_outfile=detectGetOrSet("TouchStampSearchExport",value="TS_NOTE.txt",literal=True)
|
|
275
|
+
if ts_outfile:
|
|
276
|
+
ts_outfile=Path(ts_outfile)
|
|
277
|
+
if ts_outfile.exists():
|
|
278
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{ts_outfile}{Style.reset}")
|
|
279
|
+
gzf.add(ts_outfile)
|
|
280
|
+
|
|
281
|
+
#from Roster/Roster.py
|
|
282
|
+
src_t="Downloads/Roster.xlsx"
|
|
283
|
+
lcl_e_src=detectGetOrSet("localEXCEL",src_t,literal=True,setValue=False)
|
|
284
|
+
if lcl_e_src:
|
|
285
|
+
lcl_e_src=Path(lcl_e_src)
|
|
286
|
+
if lcl_e_src.exists():
|
|
287
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{lcl_e_src}{Style.reset}")
|
|
288
|
+
gzf.add(lcl_e_src)
|
|
289
|
+
#from TasksMode/Tasks.py
|
|
290
|
+
bcd_final_out=detectGetOrSet("IMG_GEN_OUT_QR","GENERATED_QR.png",literal=True)
|
|
291
|
+
if bcd_final_out:
|
|
292
|
+
bcd_final_out=Path(bcd_final_out)
|
|
293
|
+
if bcd_final_out.exists():
|
|
294
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{bcd_final_out}{Style.reset}")
|
|
295
|
+
gzf.add(bcd_final_out)
|
|
296
|
+
|
|
297
|
+
qr_final_out=detectGetOrSet("IMG_GEN_OUT","GENERATED_BCD",literal=True)
|
|
298
|
+
if qr_final_out:
|
|
299
|
+
qr_final_out=Path(qr_final_out+".png")
|
|
300
|
+
if qr_final_out.exists():
|
|
301
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{qr_final_out}{Style.reset}")
|
|
302
|
+
gzf.add(qr_final_out)
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
EMSGFILE=detectGetOrSet("OBFUSCATED MSG FILE","MSG.txt",literal=True)
|
|
306
|
+
if EMSGFILE:
|
|
307
|
+
EMSGFILE=Path(EMSGFILE)
|
|
308
|
+
if EMSGFILE.exists():
|
|
309
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{EMSGFILE}{Style.reset}")
|
|
310
|
+
gzf.add(EMSGFILE)
|
|
311
|
+
|
|
312
|
+
dbf=Path("codesAndBarcodes.db")
|
|
313
|
+
if dbf.exists():
|
|
314
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{dbf}{Style.reset}")
|
|
315
|
+
gzf.add(dbf)
|
|
316
|
+
|
|
317
|
+
password_file=Path('Password.txt')
|
|
318
|
+
if password_file:
|
|
319
|
+
password_file=Path(password_file)
|
|
320
|
+
if password_file.exists():
|
|
321
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{password_file}{Style.reset}")
|
|
322
|
+
gzf.add(password_file)
|
|
323
|
+
|
|
324
|
+
bld_list=Path('BLD.txt')
|
|
325
|
+
if bld_list:
|
|
326
|
+
bld_list=Path(bld_list)
|
|
327
|
+
if bld_list.exists():
|
|
328
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{bld_list}{Style.reset}")
|
|
329
|
+
gzf.add(bld_list)
|
|
330
|
+
|
|
331
|
+
EntryTXT=Path('EntryTXT.txt')
|
|
332
|
+
if EntryTXT:
|
|
333
|
+
EntryTXT=Path(EntryTXT)
|
|
334
|
+
if EntryTXT.exists():
|
|
335
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{EntryTXT}{Style.reset}")
|
|
336
|
+
gzf.add(EntryTXT)
|
|
337
|
+
|
|
338
|
+
ExtraTXT=Path('ExtraTXT.txt')
|
|
339
|
+
if ExtraTXT:
|
|
340
|
+
ExtraTXT=Path(ExtraTXT)
|
|
341
|
+
if ExtraTXT.exists():
|
|
342
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{ExtraTXT}{Style.reset}")
|
|
343
|
+
gzf.add(ExtraTXT)
|
|
344
|
+
|
|
345
|
+
extra_drugs=detectGetOrSet("extra_drugs","extra_drugs.csv",setValue=False,literal=True)
|
|
346
|
+
if extra_drugs:
|
|
347
|
+
extra_drugs=Path(extra_drugs)
|
|
348
|
+
if extra_drugs.exists():
|
|
349
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{extra_drugs}{Style.reset}")
|
|
350
|
+
gzf.add(extra_drugs)
|
|
351
|
+
|
|
352
|
+
generated_string=Path('GeneratedString.txt')
|
|
353
|
+
if generated_string:
|
|
354
|
+
generated_string=Path(generated_string)
|
|
355
|
+
if generated_string.exists():
|
|
356
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{generated_string}{Style.reset}")
|
|
357
|
+
gzf.add(generated_string)
|
|
358
|
+
|
|
359
|
+
holidays_file=Path('Holidays.txt')
|
|
360
|
+
if holidays_file:
|
|
361
|
+
holidays_file=Path(holidays_file)
|
|
362
|
+
if holidays_file.exists():
|
|
363
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{holidays_file}{Style.reset}")
|
|
364
|
+
gzf.add(holidays_file)
|
|
365
|
+
|
|
366
|
+
cost_report_xlsx_file=Path(detectGetOrSet("xlsx_cr_export","cost_report.xlsx",setValue=False,literal=True))
|
|
367
|
+
if cost_report_xlsx_file:
|
|
368
|
+
cost_report_xlsx_file=Path(cost_report_xlsx_file)
|
|
369
|
+
if cost_report_xlsx_file.exists():
|
|
370
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{cost_report_xlsx_file}{Style.reset}")
|
|
371
|
+
gzf.add(cost_report_xlsx_file)
|
|
372
|
+
|
|
373
|
+
cost_report_txt_file=Path(detectGetOrSet("text_cr_export","cost_report.txt",setValue=False,literal=True))
|
|
374
|
+
if cost_report_txt_file:
|
|
375
|
+
cost_report_txt_file=Path(cost_report_txt_file)
|
|
376
|
+
if cost_report_txt_file.exists():
|
|
377
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{cost_report_txt_file}{Style.reset}")
|
|
378
|
+
gzf.add(cost_report_txt_file)
|
|
379
|
+
|
|
380
|
+
bootable_directory=Path("RadBoy_Boot_Directory")
|
|
381
|
+
if bootable_directory.exists():
|
|
382
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{bootable_directory}{Style.reset}")
|
|
383
|
+
gzf.add(bootable_directory)
|
|
384
|
+
|
|
385
|
+
try:
|
|
386
|
+
recieptidFile=Path(detectGetOrSet("NanoIdFile","nanoid.txt",setValue=False,literal=True))
|
|
387
|
+
if recieptidFile.exists():
|
|
388
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{recieptidFile}{Style.reset}")
|
|
389
|
+
gzf.add(recieptidFile)
|
|
390
|
+
except Exception as e:
|
|
391
|
+
print(e)
|
|
392
|
+
pass
|
|
393
|
+
try:
|
|
394
|
+
recieptidFile=Path(detectGetOrSet("RecieptIdFile","reciept_id.txt",setValue=False,literal=True))
|
|
395
|
+
if recieptidFile.exists():
|
|
396
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{recieptidFile}{Style.reset}")
|
|
397
|
+
gzf.add(recieptidFile)
|
|
398
|
+
except Exception as e:
|
|
399
|
+
print(e)
|
|
400
|
+
pass
|
|
401
|
+
|
|
402
|
+
receiptsDirectory=detectGetOrSet("ReceiptsDirectory","Receipts",setValue=False,literal=True)
|
|
403
|
+
if receiptsDirectory:
|
|
404
|
+
receiptsDirectory=Path(receiptsDirectory)
|
|
405
|
+
if not receiptsDirectory.exists():
|
|
406
|
+
receiptsDirectory.mkdir(parents=True)
|
|
407
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{receiptsDirectory}{Style.reset}")
|
|
408
|
+
gzf.add(receiptsDirectory)
|
|
409
|
+
|
|
410
|
+
with Session(ENGINE) as session:
|
|
411
|
+
files=session.query(SystemPreference).filter(SystemPreference.name.icontains('ClipBoordImport_')).all()
|
|
412
|
+
for num,i in enumerate(files):
|
|
413
|
+
#print(num,json.loads(i.value_4_Json2DictString)[i.name],"Being Added from SystemPreference!")
|
|
414
|
+
try:
|
|
415
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{json.loads(i.value_4_Json2DictString)[i.name]}{Style.reset}")
|
|
416
|
+
gzf.add(json.loads(i.value_4_Json2DictString)[i.name])
|
|
417
|
+
except Exception as e:
|
|
418
|
+
print(e,"couldn't not add!")
|
|
419
|
+
|
|
420
|
+
imd=Path("Images")
|
|
421
|
+
if imd.exists():
|
|
422
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{imd}{Style.reset}")
|
|
423
|
+
gzf.add(imd)
|
|
424
|
+
lclimg=Path("LCL_IMG")
|
|
425
|
+
if lclimg.exists():
|
|
426
|
+
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{lclimg}{Style.reset}")
|
|
427
|
+
gzf.add(lclimg)
|
|
428
|
+
|
|
429
|
+
print(backup.absolute())
|
|
430
|
+
|
|
431
|
+
endTime=datetime.now()
|
|
432
|
+
msg=f'''{Fore.light_red}{backup}{Fore.light_steel_blue} Took {Fore.green_yellow}{endTime-startTime}{Fore.light_steel_blue} to backup'''
|
|
433
|
+
print(msg)
|
|
434
|
+
msg2=f"{Fore.orange_red_1}{format_bytes(os.stat(backup.absolute()).st_size)}{Fore.light_steel_blue} of Data, on {Fore.spring_green_3b}{datetime.fromtimestamp(os.stat(backup.absolute()).st_ctime)}{Style.reset}"
|
|
435
|
+
print(msg2)
|
|
436
|
+
return True
|
radboy/Unified/Unified.py
CHANGED
|
@@ -35,6 +35,7 @@ from radboy.EntryExtras.Extras import *
|
|
|
35
35
|
from radboy import VERSION
|
|
36
36
|
import radboy.possibleCode as pc
|
|
37
37
|
from radboy.Unified.clearalll import *
|
|
38
|
+
from radboy.Unified.BACKUP import *
|
|
38
39
|
def format_bytes(size):
|
|
39
40
|
"""
|
|
40
41
|
Auto-convert bytes to a human-readable format.
|
|
@@ -693,334 +694,7 @@ Location Fields:
|
|
|
693
694
|
print(os.system("clear "))
|
|
694
695
|
return True
|
|
695
696
|
elif args[0].lower() in ['backup',]:
|
|
696
|
-
|
|
697
|
-
if backup_dir == None:
|
|
698
|
-
backup_dir=Path('.')
|
|
699
|
-
else:
|
|
700
|
-
backup_dir=Path(backup_dir)
|
|
701
|
-
if not backup_dir.exists():
|
|
702
|
-
backup_dir.mkdir(parents=True)
|
|
703
|
-
startTime=datetime.now()
|
|
704
|
-
print(f"{Fore.orange_red_1}Backing {Fore.light_yellow}Files {Fore.light_green}up!{Style.reset}")
|
|
705
|
-
backup=''
|
|
706
|
-
while True:
|
|
707
|
-
try:
|
|
708
|
-
def mkBool(text,data):
|
|
709
|
-
try:
|
|
710
|
-
if text.lower() in ['','true','y','yes','1']:
|
|
711
|
-
return True
|
|
712
|
-
elif text.lower() in ['n','false','no','0']:
|
|
713
|
-
return False
|
|
714
|
-
else:
|
|
715
|
-
return bool(eval(text))
|
|
716
|
-
except Exception as e:
|
|
717
|
-
print(e)
|
|
718
|
-
return False
|
|
719
|
-
date_file=Prompt.__init2__(None,func=mkBool,ptext="Date and Time restore File?",helpText="y/n?",data=self)
|
|
720
|
-
if date_file in [None,]:
|
|
721
|
-
return True
|
|
722
|
-
elif isinstance(date_file,bool):
|
|
723
|
-
if date_file:
|
|
724
|
-
d=datetime.now().strftime("%m-%d-%Y-%H-%M-%S")
|
|
725
|
-
backup=backup_dir/Path(f"codesAndBarcodes-{d}.tgz")
|
|
726
|
-
else:
|
|
727
|
-
backup=backup_dir/Path(f"codesAndBarcodes.tgz")
|
|
728
|
-
else:
|
|
729
|
-
backup=backup_dir/Path(f"codesAndBarcodes-{d}.tgz")
|
|
730
|
-
break
|
|
731
|
-
except Exception as e:
|
|
732
|
-
print(e)
|
|
733
|
-
return True
|
|
734
|
-
if backup.exists():
|
|
735
|
-
backup.unlink()
|
|
736
|
-
|
|
737
|
-
with tarfile.open(backup,"w:gz") as gzf:
|
|
738
|
-
#gzf.add("codesAndBarcodes.db")
|
|
739
|
-
#gzf.add("Images")
|
|
740
|
-
#gzf.add("LCL_IMG")
|
|
741
|
-
with open("Run.py","wb") as runner:
|
|
742
|
-
lines=f'''#!/usr/bin/env python3
|
|
743
|
-
from pathlib import Path
|
|
744
|
-
ROOTDIR=str(Path().cwd())
|
|
745
|
-
from radboy import RecordMyCodes as rmc
|
|
746
|
-
rmc.quikRn(rootdir=ROOTDIR)'''.encode()
|
|
747
|
-
runner.write(lines)
|
|
748
|
-
'''
|
|
749
|
-
try:
|
|
750
|
-
print("adding module...")
|
|
751
|
-
m=Path("module")
|
|
752
|
-
if m.exists():
|
|
753
|
-
shutil.rmtree(m)
|
|
754
|
-
m.mkdir()
|
|
755
|
-
else:
|
|
756
|
-
m.mkdir()
|
|
757
|
-
os.system(f"pip download MobileInventoryCLI=={VERSION} -d {m}")
|
|
758
|
-
gzf.add(m)
|
|
759
|
-
print("added module code!")
|
|
760
|
-
except Exception as e:
|
|
761
|
-
print("could not finish adding modules/")
|
|
762
|
-
'''
|
|
763
|
-
#shutil.rmtree(m)
|
|
764
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{Path('Run.py')}{Style.reset}")
|
|
765
|
-
gzf.add("Run.py")
|
|
766
|
-
|
|
767
|
-
while True:
|
|
768
|
-
try:
|
|
769
|
-
def mkBool(text,self):
|
|
770
|
-
if text.lower() in ['','n','no','-']:
|
|
771
|
-
return False
|
|
772
|
-
elif text.lower() in ['y','yes','+']:
|
|
773
|
-
return True
|
|
774
|
-
else:
|
|
775
|
-
try:
|
|
776
|
-
return bool(eval(text))
|
|
777
|
-
except Exception as e:
|
|
778
|
-
print(e)
|
|
779
|
-
return False
|
|
780
|
-
rmRunner=Prompt.__init2__(None,func=mkBool,ptext="Delete 'Run.py'",helpText="default == 'No'",data=self)
|
|
781
|
-
if rmRunner:
|
|
782
|
-
Path("Run.py").unlink()
|
|
783
|
-
break
|
|
784
|
-
except Exception as e:
|
|
785
|
-
print(e)
|
|
786
|
-
|
|
787
|
-
with open("version.txt","w+") as version_txt:
|
|
788
|
-
version_txt.write(VERSION)
|
|
789
|
-
|
|
790
|
-
if Path("version.txt").exists():
|
|
791
|
-
print(f'{Fore.spring_green_3b}Adding {Fore.green_yellow}{Path("version.txt")}{Style.reset}')
|
|
792
|
-
gzf.add("version.txt")
|
|
793
|
-
Path("version.txt").unlink()
|
|
794
|
-
|
|
795
|
-
api_key_file=Path("./api_key")
|
|
796
|
-
if api_key_file.exists():
|
|
797
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{api_key_file}{Style.reset}")
|
|
798
|
-
gzf.add(api_key_file)
|
|
799
|
-
|
|
800
|
-
msg=f'''
|
|
801
|
-
{Fore.orange_red_1}Getting system settings files, testing for existance, if not found leaving alone!!!{Style.reset}
|
|
802
|
-
'''
|
|
803
|
-
print(msg)
|
|
804
|
-
#from ExportUtility/ExportTableClass.py
|
|
805
|
-
import_odf=detectGetOrSet("ImportODF",value="ImportExcel.xlsx.ods",literal=True)
|
|
806
|
-
if import_odf:
|
|
807
|
-
import_odf=Path(import_odf)
|
|
808
|
-
if import_odf.exists():
|
|
809
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{import_odf}{Style.reset}")
|
|
810
|
-
gzf.add(import_odf)
|
|
811
|
-
|
|
812
|
-
import_excel=detectGetOrSet("ImportExcel",value="ImportExcel.xlsx",literal=True)
|
|
813
|
-
if import_excel:
|
|
814
|
-
import_excel=Path(import_excel)
|
|
815
|
-
if import_excel.exists():
|
|
816
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{import_excel}{Style.reset}")
|
|
817
|
-
gzf.add(import_excel)
|
|
818
|
-
|
|
819
|
-
export_folder=Path(detectGetOrSet("ExportTablesFolder",value="ExportedTables",literal=True))
|
|
820
|
-
if export_folder:
|
|
821
|
-
export_folder=Path(export_folder)
|
|
822
|
-
if export_folder.exists() and export_folder.is_dir():
|
|
823
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{export_folder}{Style.reset}")
|
|
824
|
-
gzf.add(export_folder)
|
|
825
|
-
|
|
826
|
-
bootable="__bootable__.py"
|
|
827
|
-
if bootable:
|
|
828
|
-
bootable=Path(bootable)
|
|
829
|
-
if bootable.exists() and bootable.is_file():
|
|
830
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{bootable}{Style.reset}")
|
|
831
|
-
gzf.add(bootable)
|
|
832
|
-
|
|
833
|
-
pay_ws=Path("EstimatedPayCalendarWorkSheet.txt")
|
|
834
|
-
pay_ws=Path(detectGetOrSet("EstimatedPayCalendarExportFile",pay_ws,setValue=False,literal=True))
|
|
835
|
-
if pay_ws:
|
|
836
|
-
if pay_ws.exists():
|
|
837
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{pay_ws}{Style.reset}")
|
|
838
|
-
gzf.add(pay_ws)
|
|
839
|
-
|
|
840
|
-
combinations_receipt=Path(detectGetOrSet("combinations_receipt","combos.json.csv",setValue=False,literal=True))
|
|
841
|
-
if combinations_receipt:
|
|
842
|
-
if combinations_receipt.exists():
|
|
843
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{combinations_receipt}{Style.reset}")
|
|
844
|
-
gzf.add(combinations_receipt)
|
|
845
|
-
|
|
846
|
-
WebArchiveStore_folder=Path(detectGetOrSet("WebArchiveDownloadsFilePath","WebArchiveDownloads",literal=True))
|
|
847
|
-
if WebArchiveStore_folder:
|
|
848
|
-
WebArchiveStore_folder=Path(WebArchiveStore_folder)
|
|
849
|
-
if WebArchiveStore_folder.exists() and WebArchiveStore_folder.is_dir():
|
|
850
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{WebArchiveStore_folder}{Style.reset}")
|
|
851
|
-
gzf.add(WebArchiveStore_folder)
|
|
852
|
-
#from DB/Prompt.py
|
|
853
|
-
scanout=detectGetOrSet('CMD_TO_FILE',str(Path('./SCANNER.TXT')))
|
|
854
|
-
if scanout:
|
|
855
|
-
scanout=Path(scanout)
|
|
856
|
-
if scanout.exists():
|
|
857
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{scanout}{Style.reset}")
|
|
858
|
-
gzf.add(scanout)
|
|
859
|
-
|
|
860
|
-
#from TouchStampC/TouchStampC.py
|
|
861
|
-
ts_outfile=detectGetOrSet("TouchStampSearchExport",value="TS_NOTE.txt",literal=True)
|
|
862
|
-
if ts_outfile:
|
|
863
|
-
ts_outfile=Path(ts_outfile)
|
|
864
|
-
if ts_outfile.exists():
|
|
865
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{ts_outfile}{Style.reset}")
|
|
866
|
-
gzf.add(ts_outfile)
|
|
867
|
-
|
|
868
|
-
#from Roster/Roster.py
|
|
869
|
-
src_t="Downloads/Roster.xlsx"
|
|
870
|
-
lcl_e_src=detectGetOrSet("localEXCEL",src_t,literal=True,setValue=False)
|
|
871
|
-
if lcl_e_src:
|
|
872
|
-
lcl_e_src=Path(lcl_e_src)
|
|
873
|
-
if lcl_e_src.exists():
|
|
874
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{lcl_e_src}{Style.reset}")
|
|
875
|
-
gzf.add(lcl_e_src)
|
|
876
|
-
#from TasksMode/Tasks.py
|
|
877
|
-
bcd_final_out=detectGetOrSet("IMG_GEN_OUT_QR","GENERATED_QR.png",literal=True)
|
|
878
|
-
if bcd_final_out:
|
|
879
|
-
bcd_final_out=Path(bcd_final_out)
|
|
880
|
-
if bcd_final_out.exists():
|
|
881
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{bcd_final_out}{Style.reset}")
|
|
882
|
-
gzf.add(bcd_final_out)
|
|
883
|
-
|
|
884
|
-
qr_final_out=detectGetOrSet("IMG_GEN_OUT","GENERATED_BCD",literal=True)
|
|
885
|
-
if qr_final_out:
|
|
886
|
-
qr_final_out=Path(qr_final_out+".png")
|
|
887
|
-
if qr_final_out.exists():
|
|
888
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{qr_final_out}{Style.reset}")
|
|
889
|
-
gzf.add(qr_final_out)
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
EMSGFILE=detectGetOrSet("OBFUSCATED MSG FILE","MSG.txt",literal=True)
|
|
893
|
-
if EMSGFILE:
|
|
894
|
-
EMSGFILE=Path(EMSGFILE)
|
|
895
|
-
if EMSGFILE.exists():
|
|
896
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{EMSGFILE}{Style.reset}")
|
|
897
|
-
gzf.add(EMSGFILE)
|
|
898
|
-
|
|
899
|
-
dbf=Path("codesAndBarcodes.db")
|
|
900
|
-
if dbf.exists():
|
|
901
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{dbf}{Style.reset}")
|
|
902
|
-
gzf.add(dbf)
|
|
903
|
-
|
|
904
|
-
password_file=Path('Password.txt')
|
|
905
|
-
if password_file:
|
|
906
|
-
password_file=Path(password_file)
|
|
907
|
-
if password_file.exists():
|
|
908
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{password_file}{Style.reset}")
|
|
909
|
-
gzf.add(password_file)
|
|
910
|
-
|
|
911
|
-
bld_list=Path('BLD.txt')
|
|
912
|
-
if bld_list:
|
|
913
|
-
bld_list=Path(bld_list)
|
|
914
|
-
if bld_list.exists():
|
|
915
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{bld_list}{Style.reset}")
|
|
916
|
-
gzf.add(bld_list)
|
|
917
|
-
|
|
918
|
-
EntryTXT=Path('EntryTXT.txt')
|
|
919
|
-
if EntryTXT:
|
|
920
|
-
EntryTXT=Path(EntryTXT)
|
|
921
|
-
if EntryTXT.exists():
|
|
922
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{EntryTXT}{Style.reset}")
|
|
923
|
-
gzf.add(EntryTXT)
|
|
924
|
-
|
|
925
|
-
ExtraTXT=Path('ExtraTXT.txt')
|
|
926
|
-
if ExtraTXT:
|
|
927
|
-
ExtraTXT=Path(ExtraTXT)
|
|
928
|
-
if ExtraTXT.exists():
|
|
929
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{ExtraTXT}{Style.reset}")
|
|
930
|
-
gzf.add(ExtraTXT)
|
|
931
|
-
|
|
932
|
-
extra_drugs=detectGetOrSet("extra_drugs","extra_drugs.csv",setValue=False,literal=True)
|
|
933
|
-
if extra_drugs:
|
|
934
|
-
extra_drugs=Path(extra_drugs)
|
|
935
|
-
if extra_drugs.exists():
|
|
936
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{extra_drugs}{Style.reset}")
|
|
937
|
-
gzf.add(extra_drugs)
|
|
938
|
-
|
|
939
|
-
generated_string=Path('GeneratedString.txt')
|
|
940
|
-
if generated_string:
|
|
941
|
-
generated_string=Path(generated_string)
|
|
942
|
-
if generated_string.exists():
|
|
943
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{generated_string}{Style.reset}")
|
|
944
|
-
gzf.add(generated_string)
|
|
945
|
-
|
|
946
|
-
holidays_file=Path('Holidays.txt')
|
|
947
|
-
if holidays_file:
|
|
948
|
-
holidays_file=Path(holidays_file)
|
|
949
|
-
if holidays_file.exists():
|
|
950
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{holidays_file}{Style.reset}")
|
|
951
|
-
gzf.add(holidays_file)
|
|
952
|
-
|
|
953
|
-
cost_report_xlsx_file=Path(detectGetOrSet("xlsx_cr_export","cost_report.xlsx",setValue=False,literal=True))
|
|
954
|
-
if cost_report_xlsx_file:
|
|
955
|
-
cost_report_xlsx_file=Path(cost_report_xlsx_file)
|
|
956
|
-
if cost_report_xlsx_file.exists():
|
|
957
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{cost_report_xlsx_file}{Style.reset}")
|
|
958
|
-
gzf.add(cost_report_xlsx_file)
|
|
959
|
-
|
|
960
|
-
cost_report_txt_file=Path(detectGetOrSet("text_cr_export","cost_report.txt",setValue=False,literal=True))
|
|
961
|
-
if cost_report_txt_file:
|
|
962
|
-
cost_report_txt_file=Path(cost_report_txt_file)
|
|
963
|
-
if cost_report_txt_file.exists():
|
|
964
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{cost_report_txt_file}{Style.reset}")
|
|
965
|
-
gzf.add(cost_report_txt_file)
|
|
966
|
-
|
|
967
|
-
bootable_directory=Path("RadBoy_Boot_Directory")
|
|
968
|
-
if bootable_directory.exists():
|
|
969
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{bootable_directory}{Style.reset}")
|
|
970
|
-
gzf.add(bootable_directory)
|
|
971
|
-
|
|
972
|
-
try:
|
|
973
|
-
recieptidFile=Path(detectGetOrSet("NanoIdFile","nanoid.txt",setValue=False,literal=True))
|
|
974
|
-
if recieptidFile.exists():
|
|
975
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{recieptidFile}{Style.reset}")
|
|
976
|
-
gzf.add(recieptidFile)
|
|
977
|
-
except Exception as e:
|
|
978
|
-
print(e)
|
|
979
|
-
pass
|
|
980
|
-
try:
|
|
981
|
-
recieptidFile=Path(detectGetOrSet("RecieptIdFile","reciept_id.txt",setValue=False,literal=True))
|
|
982
|
-
if recieptidFile.exists():
|
|
983
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{recieptidFile}{Style.reset}")
|
|
984
|
-
gzf.add(recieptidFile)
|
|
985
|
-
except Exception as e:
|
|
986
|
-
print(e)
|
|
987
|
-
pass
|
|
988
|
-
|
|
989
|
-
receiptsDirectory=detectGetOrSet("ReceiptsDirectory","Receipts",setValue=False,literal=True)
|
|
990
|
-
if receiptsDirectory:
|
|
991
|
-
receiptsDirectory=Path(receiptsDirectory)
|
|
992
|
-
if not receiptsDirectory.exists():
|
|
993
|
-
receiptsDirectory.mkdir(parents=True)
|
|
994
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{receiptsDirectory}{Style.reset}")
|
|
995
|
-
gzf.add(receiptsDirectory)
|
|
996
|
-
|
|
997
|
-
with Session(ENGINE) as session:
|
|
998
|
-
files=session.query(SystemPreference).filter(SystemPreference.name.icontains('ClipBoordImport_')).all()
|
|
999
|
-
for num,i in enumerate(files):
|
|
1000
|
-
#print(num,json.loads(i.value_4_Json2DictString)[i.name],"Being Added from SystemPreference!")
|
|
1001
|
-
try:
|
|
1002
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{json.loads(i.value_4_Json2DictString)[i.name]}{Style.reset}")
|
|
1003
|
-
gzf.add(json.loads(i.value_4_Json2DictString)[i.name])
|
|
1004
|
-
except Exception as e:
|
|
1005
|
-
print(e,"couldn't not add!")
|
|
1006
|
-
|
|
1007
|
-
imd=Path("Images")
|
|
1008
|
-
if imd.exists():
|
|
1009
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{imd}{Style.reset}")
|
|
1010
|
-
gzf.add(imd)
|
|
1011
|
-
lclimg=Path("LCL_IMG")
|
|
1012
|
-
if lclimg.exists():
|
|
1013
|
-
print(f"{Fore.spring_green_3b}Adding {Fore.green_yellow}{lclimg}{Style.reset}")
|
|
1014
|
-
gzf.add(lclimg)
|
|
1015
|
-
|
|
1016
|
-
print(backup.absolute())
|
|
1017
|
-
|
|
1018
|
-
endTime=datetime.now()
|
|
1019
|
-
msg=f'''{Fore.light_red}{backup}{Fore.light_steel_blue} Took {Fore.green_yellow}{endTime-startTime}{Fore.light_steel_blue} to backup'''
|
|
1020
|
-
print(msg)
|
|
1021
|
-
msg2=f"{Fore.orange_red_1}{format_bytes(os.stat(backup.absolute()).st_size)}{Fore.light_steel_blue} of Data, on {Fore.spring_green_3b}{datetime.fromtimestamp(os.stat(backup.absolute()).st_ctime)}{Style.reset}"
|
|
1022
|
-
print(msg2)
|
|
1023
|
-
return True
|
|
697
|
+
BACKUP()
|
|
1024
698
|
elif args[0].lower() in ['restore',]:
|
|
1025
699
|
def lcl_bu(backup,self):
|
|
1026
700
|
backup=Path(backup)
|
|
Binary file
|
radboy/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
VERSION='0.0.
|
|
1
|
+
VERSION='0.0.827'
|
|
Binary file
|
|
@@ -5,7 +5,7 @@ radboy/Holidays.txt,sha256=y-JZPihh5iaWKxMIHNXD39yVuVmf1vMs4FdNDcg0f1Y,3114
|
|
|
5
5
|
radboy/InventoryGlossary.txt,sha256=018-Yqca6DFb10jPdkUY-5qhkRlQN1k3rxoTaERQ-LA,91008
|
|
6
6
|
radboy/RecordMyCodes.py,sha256=h30zoTqt-XLt_afDPlxMxBiKKwmKi3N-yAuldNCqXUo,41476
|
|
7
7
|
radboy/Run.py,sha256=JUoCTHnzQBv7n8PB2_i93ANdAC_iW__RkAge8esCnk4,76
|
|
8
|
-
radboy/__init__.py,sha256=
|
|
8
|
+
radboy/__init__.py,sha256=TjGkY7L9qBs4RjZZ1D9PQvGgPyhCsm17VbLpa3AlexU,17
|
|
9
9
|
radboy/api_key,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
radboy/case-export-2024-05-14-13-10-00.672971.xlsx,sha256=Wd592d_VLFmfUI9KKKSVjNwjV91euc1T7ATyvwvUhlg,5431
|
|
11
11
|
radboy/case-export-2024-05-14-13-13-22.540614.xlsx,sha256=OnGrhmScHfGp_mVaWW-LNMsqrQgyZDpiU3wV-2s3U5Q,5556
|
|
@@ -47,7 +47,7 @@ radboy/Collector2/__pycache__/__init__.cpython-313.pyc,sha256=IiHFLqDUbXyf_-1vyb
|
|
|
47
47
|
radboy/Comm/RxTx.py,sha256=rLu7qjs0GWFzzjknw0SbiGTbEKu1f4czqinZkSb3Exg,2203
|
|
48
48
|
radboy/Comm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
49
|
radboy/Comm/__pycache__/RxTx.cpython-312.pyc,sha256=S_1Kf5_EwO1X4blYwIMPlrBs_hD8kLWJIX284vjVRKg,34691
|
|
50
|
-
radboy/Comm/__pycache__/RxTx.cpython-313.pyc,sha256=
|
|
50
|
+
radboy/Comm/__pycache__/RxTx.cpython-313.pyc,sha256=eX1OSZHaYw2m9XGrgqKCKe4G1h1mn3jwtj7vZCjeMQI,3968
|
|
51
51
|
radboy/Comm/__pycache__/__init__.cpython-312.pyc,sha256=jxT5gYVdAKG2X7WED7LoHwmiHsC8BxOtz0YxIdtsBtw,267
|
|
52
52
|
radboy/Comm/__pycache__/__init__.cpython-313.pyc,sha256=-hKMf6R71_1VkbAEpQ4HJOJF0RUxDSpuUHS0kXShyIw,146
|
|
53
53
|
radboy/Comm2Common/Comm2Common.py,sha256=3MOe_RHcD1mhiLJIBBa_j1YbyKZr8pyOyqB-7hMoHoM,1141
|
|
@@ -357,7 +357,7 @@ radboy/SystemSettings/__pycache__/__init__.cpython-312.pyc,sha256=aIzp4Po0t8EhSA
|
|
|
357
357
|
radboy/SystemSettings/__pycache__/__init__.cpython-313.pyc,sha256=QFDuoidxMWsGVLsy5lN-rDs6TP8nKJ4yyCyiamNOhwo,156
|
|
358
358
|
radboy/TasksMode/ReFormula.py,sha256=REDRJYub-OEOE6g14oRQOLOQwv8pHqVJy4NQk3CCM90,2255
|
|
359
359
|
radboy/TasksMode/SetEntryNEU.py,sha256=d-Aya8yxdVmcMNDcp0UBMQQm4IAbJv6vhYKeh9r0Kmg,20694
|
|
360
|
-
radboy/TasksMode/Tasks.py,sha256=
|
|
360
|
+
radboy/TasksMode/Tasks.py,sha256=FOvA8qckGVvnRj-jsdGRu9Lih_hjo8J7t58SWGUPigc,381147
|
|
361
361
|
radboy/TasksMode/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
362
362
|
radboy/TasksMode/__pycache__/ReFormula.cpython-311.pyc,sha256=QEG3PwVw-8HTd_Mf9XbVcxU56F1fC9yBqWXYPLC39DU,4865
|
|
363
363
|
radboy/TasksMode/__pycache__/ReFormula.cpython-312.pyc,sha256=aX7BWm2PPjCTnxsbGUitR-2h9hq4AjaBiHMrUXvIl0Y,3967
|
|
@@ -366,7 +366,7 @@ radboy/TasksMode/__pycache__/SetEntryNEU.cpython-312.pyc,sha256=pCdFj61aPKkHL6Sv
|
|
|
366
366
|
radboy/TasksMode/__pycache__/SetEntryNEU.cpython-313.pyc,sha256=aXhwkDb2JQXRyJpxYBScWk6Wfsze9uM7vdx9lo-u57Q,24632
|
|
367
367
|
radboy/TasksMode/__pycache__/Tasks.cpython-311.pyc,sha256=6QOTJnLiXSKdF81hkhy3vyrz49PPhS20s5_0X52g3Hw,131120
|
|
368
368
|
radboy/TasksMode/__pycache__/Tasks.cpython-312.pyc,sha256=hyJwdaYaaRLdcrNxgg36diJ5iijX5_3I0UAORsj-6LU,310295
|
|
369
|
-
radboy/TasksMode/__pycache__/Tasks.cpython-313.pyc,sha256=
|
|
369
|
+
radboy/TasksMode/__pycache__/Tasks.cpython-313.pyc,sha256=lfrCcMdEPo72q397gI3zhaHwy0tZVx3O971xB4JfzKI,454790
|
|
370
370
|
radboy/TasksMode/__pycache__/__init__.cpython-311.pyc,sha256=PKV1JbihEacm639b53bZozRQvcllSkjGP3q8STVMxF4,234
|
|
371
371
|
radboy/TasksMode/__pycache__/__init__.cpython-312.pyc,sha256=ERgnEvRMiGSecWp1BpNzLdSq_SdKw7GvFWUvUM7bLVw,272
|
|
372
372
|
radboy/TasksMode/__pycache__/__init__.cpython-313.pyc,sha256=lvsTxukyvGKB3C0rdF9dQi_bvVh6ceDVINfwcuIsd0s,151
|
|
@@ -378,14 +378,15 @@ radboy/TouchStampC/__pycache__/TouchStampC.cpython-313.pyc,sha256=6A1Z56mlsBBZi4
|
|
|
378
378
|
radboy/TouchStampC/__pycache__/__init__.cpython-311.pyc,sha256=0Rn25Y_gKIKFC7fRVMToQ99ozp8rqnK3HkTajb4skdo,236
|
|
379
379
|
radboy/TouchStampC/__pycache__/__init__.cpython-312.pyc,sha256=Qa5Iy6Fp7_w5wPhQCbj6FFvfMttQoNd5j6DTqYXa_GQ,274
|
|
380
380
|
radboy/TouchStampC/__pycache__/__init__.cpython-313.pyc,sha256=kA-p_LdocXJQHfYfDE0DQZ3fgzbfoL90Kr0soLsff_w,153
|
|
381
|
-
radboy/Unified/
|
|
381
|
+
radboy/Unified/BACKUP.py,sha256=ElYwHFuIdIBM2eLOvN9MKNLlaFS72xKngqJnoIX1oDY,19674
|
|
382
|
+
radboy/Unified/Unified.py,sha256=l6SLbwnAg6XP_eIhgzj4a3rI54kTDv8kRt_z1A9D_vM,47147
|
|
382
383
|
radboy/Unified/Unified2.py,sha256=TnJQ5Ir28cLG449o8mDe8Ya1Zx4WaRhuoHfEIrCbJME,42257
|
|
383
384
|
radboy/Unified/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
384
385
|
radboy/Unified/bareCA.py,sha256=_WN3mQcuOuaZpd1Fm2aasisb9lCJWY2zbYqvCA0MNbI,7595
|
|
385
386
|
radboy/Unified/clearalll.py,sha256=KjXE7rWb4h6wwSmHxm32NMF9vW5-Om43vNqWOnZ9xsc,4042
|
|
386
387
|
radboy/Unified/__pycache__/Unified.cpython-311.pyc,sha256=ZtvZDV9cVMV_r_Cuj6LR4m27CGUnZy0l9zUTILSnMRg,65018
|
|
387
388
|
radboy/Unified/__pycache__/Unified.cpython-312.pyc,sha256=BT3bLl4LQUs7m3H44WVjg6BsHfU9xnWNwpytZSA2smI,78625
|
|
388
|
-
radboy/Unified/__pycache__/Unified.cpython-313.pyc,sha256
|
|
389
|
+
radboy/Unified/__pycache__/Unified.cpython-313.pyc,sha256=zsjNgW6Z1KRZmuhfBk_42fJxQobSFpiwg6ianEJ3qE0,63057
|
|
389
390
|
radboy/Unified/__pycache__/__init__.cpython-311.pyc,sha256=2OjdGThHMNZ2yMrbdlwiKHKtCDLQfJdNhtDVtLDUKCk,232
|
|
390
391
|
radboy/Unified/__pycache__/__init__.cpython-312.pyc,sha256=5aXXASuWsXCly7t_gqJ6cVbdAeTo4Wom8989FszH4Xw,270
|
|
391
392
|
radboy/Unified/__pycache__/__init__.cpython-313.pyc,sha256=h03zVuB4hfY_ko4nkuSS-SIkjHOGTlFM9bDpMdQPwg4,149
|
|
@@ -413,7 +414,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
|
|
|
413
414
|
radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
|
|
414
415
|
radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
|
|
415
416
|
radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
|
|
416
|
-
radboy/__pycache__/__init__.cpython-313.pyc,sha256=
|
|
417
|
+
radboy/__pycache__/__init__.cpython-313.pyc,sha256=mKXRTEjmWugIMelev60b_ihp_KxUJolKZmzHLQQ9U2M,165
|
|
417
418
|
radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
|
|
418
419
|
radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
|
|
419
420
|
radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
|
|
@@ -441,7 +442,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
|
|
|
441
442
|
radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
|
|
442
443
|
radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
|
|
443
444
|
radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
|
|
444
|
-
radboy-0.0.
|
|
445
|
-
radboy-0.0.
|
|
446
|
-
radboy-0.0.
|
|
447
|
-
radboy-0.0.
|
|
445
|
+
radboy-0.0.827.dist-info/METADATA,sha256=QmFRSRudYRGsoM38Q5g5IxP_dO0BfFch20W7ozNrf3g,1920
|
|
446
|
+
radboy-0.0.827.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
447
|
+
radboy-0.0.827.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
|
|
448
|
+
radboy-0.0.827.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|