radboy 0.0.826__py3-none-any.whl → 0.0.828__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/DB/__pycache__/db.cpython-313.pyc +0 -0
- radboy/DB/db.py +86 -26
- 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.828.dist-info}/METADATA +1 -1
- {radboy-0.0.826.dist-info → radboy-0.0.828.dist-info}/RECORD +14 -13
- {radboy-0.0.826.dist-info → radboy-0.0.828.dist-info}/WHEEL +0 -0
- {radboy-0.0.826.dist-info → radboy-0.0.828.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
radboy/DB/db.py
CHANGED
|
@@ -1187,9 +1187,9 @@ For hot food, one of the notable exceptions is "Hot Baked Goods," like pretzels
|
|
|
1187
1187
|
ShelfCount=Column(Integer,default=0)
|
|
1188
1188
|
#LoadCount=1,PalletCount=1,ShelfCount=1
|
|
1189
1189
|
|
|
1190
|
-
Expiry=Column(DateTime,default=
|
|
1191
|
-
BestBy=Column(DateTime,default=
|
|
1192
|
-
AquisitionDate=Column(DateTime,default=
|
|
1190
|
+
Expiry=Column(DateTime,default=datetime(1,1,1))
|
|
1191
|
+
BestBy=Column(DateTime,default=datetime(1,1,1))
|
|
1192
|
+
AquisitionDate=Column(DateTime,default=datetime(1,1,1))
|
|
1193
1193
|
'''
|
|
1194
1194
|
#__init__ def #AquisitionDate=None,BestBy=None,Expiry=None
|
|
1195
1195
|
|
|
@@ -1304,7 +1304,7 @@ For hot food, one of the notable exceptions is "Hot Baked Goods," like pretzels
|
|
|
1304
1304
|
if k in [s.name for s in self.__table__.columns]:
|
|
1305
1305
|
setattr(self,k,kwargs.get(k))
|
|
1306
1306
|
|
|
1307
|
-
def __init__(self,Barcode,Code,upce2upca='',Name='',InList=True,Price=0.0,Note='',Size='',CaseCount=1,Shelf=0,BackRoom=0,Display_1=0,Display_2=0,Display_3=0,Display_4=0,Display_5=0,Display_6=0,Stock_Total=0,Timestamp=datetime.now().timestamp(),EntryId=None,Location='///',ListQty=0.0,Image='',CHKSTND_SPLY=0,WD_DSPLY=0,FLRL_CHP_DSPLY=0,FLRL_WTR_DSPLY=0,SBX_WTR_KLR=0,SBX_CHP_DSPLY=0,SBX_WTR_DSPLY=0,Facings=0,Tags='',CaseID_6W='',CaseID_BR='',CaseID_LD='',ALT_Barcode='',DUP_Barcode='',CRV=0.0,Tax=0.0,TaxNote='',userUpdated=False,LoadCount=1,PalletCount=1,ShelfCount=1,Description='',Distress=0,UnitsDeep=1,UnitsHigh=1,AquisitionDate=
|
|
1307
|
+
def __init__(self,Barcode,Code,upce2upca='',Name='',InList=True,Price=0.0,Note='',Size='',CaseCount=1,Shelf=0,BackRoom=0,Display_1=0,Display_2=0,Display_3=0,Display_4=0,Display_5=0,Display_6=0,Stock_Total=0,Timestamp=datetime.now().timestamp(),EntryId=None,Location='///',ListQty=0.0,Image='',CHKSTND_SPLY=0,WD_DSPLY=0,FLRL_CHP_DSPLY=0,FLRL_WTR_DSPLY=0,SBX_WTR_KLR=0,SBX_CHP_DSPLY=0,SBX_WTR_DSPLY=0,Facings=0,Tags='',CaseID_6W='',CaseID_BR='',CaseID_LD='',ALT_Barcode='',DUP_Barcode='',CRV=0.0,Tax=0.0,TaxNote='',userUpdated=False,LoadCount=1,PalletCount=1,ShelfCount=1,Description='',Distress=0,UnitsDeep=1,UnitsHigh=1,AquisitionDate=datetime(1,1,1),BestBy=datetime(1,1,1),Expiry=datetime(1,1,1)):
|
|
1308
1308
|
if EntryId:
|
|
1309
1309
|
self.EntryId=EntryId
|
|
1310
1310
|
self.CRV=CRV
|
|
@@ -1386,6 +1386,18 @@ For hot food, one of the notable exceptions is "Hot Baked Goods," like pretzels
|
|
|
1386
1386
|
self.ShelfCount=ShelfCount
|
|
1387
1387
|
self.PalletCount=PalletCount
|
|
1388
1388
|
self.LoadCount=LoadCount
|
|
1389
|
+
if Expiry is None:
|
|
1390
|
+
self.Expiry=datetime(1,1,1)
|
|
1391
|
+
else:
|
|
1392
|
+
self.Expiry=Expiry
|
|
1393
|
+
if BestBy is None:
|
|
1394
|
+
self.BestBy=datetime(1,1,1)
|
|
1395
|
+
else:
|
|
1396
|
+
self.BestBy=BestBy
|
|
1397
|
+
if AquisitionDate is None:
|
|
1398
|
+
self.AquisitionDate=datetime(1,1,1)
|
|
1399
|
+
else:
|
|
1400
|
+
self.AquisitionDate=AquisitionDate
|
|
1389
1401
|
#CHKSTND_SPLY=0,WD_DSPLY=0,FLRL_CHP_DSPLY=0,FLRL_WTR_DSPLY=0,SBX_WTR_KLR=0,SBX_CHP_DSPLY=0,SBX_WTR_DSPLY=0,Facings=0,Tags='',CaseID_6W='',CaseID_BR='',CaseID_LD='',ALT_Barcode='',DUP_Barcode=''
|
|
1390
1402
|
|
|
1391
1403
|
'''
|
|
@@ -1604,6 +1616,12 @@ For hot food, one of the notable exceptions is "Hot Baked Goods," like pretzels
|
|
|
1604
1616
|
return result
|
|
1605
1617
|
|
|
1606
1618
|
def saveListExtended(self,num):
|
|
1619
|
+
if self.Expiry is None:
|
|
1620
|
+
self.Expiry=datetime(1,1,1)
|
|
1621
|
+
if self.BestBy is None:
|
|
1622
|
+
self.BestBy=datetime(1,1,1)
|
|
1623
|
+
if self.AquisitionDate is None:
|
|
1624
|
+
self.AquisitionDate=datetime(1,1,1)
|
|
1607
1625
|
if self.LCL_ANDROID.exists():
|
|
1608
1626
|
self.LCL=self.LCL_ANDROID
|
|
1609
1627
|
total=self.Display_1+self.Display_2+self.Display_3+self.Display_4+self.Display_5+self.Display_6+self.Shelf+self.BackRoom
|
|
@@ -1646,9 +1664,9 @@ CHKSTND_SPLY={self.CHKSTND_SPLY}
|
|
|
1646
1664
|
Distress={self.Distress} #not added to total
|
|
1647
1665
|
Total = {total}
|
|
1648
1666
|
Total(w/o BR+) - Backroom = {(total-self.BackRoom)-self.BackRoom}
|
|
1649
|
-
Expiry = {self.Expiry}
|
|
1650
|
-
BestBy = {self.BestBy}
|
|
1651
|
-
AquisitionDate = {self.AquisitionDate}
|
|
1667
|
+
Expiry = {self.Expiry}[{self.Expiry-datetime.now()} old]
|
|
1668
|
+
BestBy = {self.BestBy}[{self.BestBy-datetime.now()} old]
|
|
1669
|
+
AquisitionDate = {self.AquisitionDate}[{self.AquisitionDate-datetime.now()} old]
|
|
1652
1670
|
-------------{num}-------------
|
|
1653
1671
|
"""
|
|
1654
1672
|
|
|
@@ -1707,6 +1725,12 @@ Facings={self.Facings}
|
|
|
1707
1725
|
return total
|
|
1708
1726
|
|
|
1709
1727
|
def listdisplay_extended(self,num):
|
|
1728
|
+
if self.Expiry is None:
|
|
1729
|
+
self.Expiry=datetime(1,1,1)
|
|
1730
|
+
if self.BestBy is None:
|
|
1731
|
+
self.BestBy=datetime(1,1,1)
|
|
1732
|
+
if self.AquisitionDate is None:
|
|
1733
|
+
self.AquisitionDate=datetime(1,1,1)
|
|
1710
1734
|
#print(self.csv_headers())
|
|
1711
1735
|
#print(self.csv_values())
|
|
1712
1736
|
total=self.Display_1+self.Display_2+self.Display_3+self.Display_4+self.Display_5+self.Display_6+self.Shelf+self.BackRoom
|
|
@@ -1767,9 +1791,9 @@ deducted from Total as remainder is to be filled from LOAD{Style.reset}
|
|
|
1767
1791
|
{Fore.medium_violet_red}Total Product Handled/To Be Handled Value*CaseCount: {Fore.spring_green_3a}{total_value_case}{Style.reset}
|
|
1768
1792
|
{Fore.orange_3}Distressed Product:{Fore.light_red}{self.Distress}{Style.reset}
|
|
1769
1793
|
------------- Dates ----------------------
|
|
1770
|
-
{Fore.light_cyan}Expiry = {Fore.light_green}{self.Expiry}{Style.reset}
|
|
1771
|
-
{Fore.light_cyan}BestBy = {Fore.light_green}{self.BestBy}{Style.reset}
|
|
1772
|
-
{Fore.light_cyan}AquisitionDate = {Fore.light_green}{self.AquisitionDate}{Style.reset}
|
|
1794
|
+
{Fore.light_cyan}Expiry = {Fore.light_green}{self.Expiry}[{self.Expiry-datetime.now()} old]{Style.reset}
|
|
1795
|
+
{Fore.light_cyan}BestBy = {Fore.light_green}{self.BestBy}[{self.BestBy-datetime.now()} old]{Style.reset}
|
|
1796
|
+
{Fore.light_cyan}AquisitionDate = {Fore.light_green}{self.AquisitionDate}[{self.AquisitionDate-datetime.now()} old]{Style.reset}
|
|
1773
1797
|
-------------{Style.bold+Style.underline+Fore.orange_red_1}{num}{Style.reset}-------------
|
|
1774
1798
|
"""
|
|
1775
1799
|
print(msg)
|
|
@@ -1856,6 +1880,12 @@ deducted from Total as remainder is to be filled from LOAD{Style.reset}
|
|
|
1856
1880
|
|
|
1857
1881
|
pinfo=f"{Back.green_3a}{Fore.red}**{Fore.white}{Style.bold}Product/Entry Info{Fore.red}- #REPLACE#**{Style.reset} "
|
|
1858
1882
|
def __repr__(self):
|
|
1883
|
+
if self.Expiry is None:
|
|
1884
|
+
self.Expiry=datetime(1,1,1)
|
|
1885
|
+
if self.BestBy is None:
|
|
1886
|
+
self.BestBy=datetime(1,1,1)
|
|
1887
|
+
if self.AquisitionDate is None:
|
|
1888
|
+
self.AquisitionDate=datetime(1,1,1)
|
|
1859
1889
|
pinfo=self.pinfo
|
|
1860
1890
|
total_value=self.total_value(CaseMode=False)
|
|
1861
1891
|
total_value_case=self.total_value()
|
|
@@ -1919,9 +1949,9 @@ deducted from Total as remainder is to be filled from LOAD{Style.reset}
|
|
|
1919
1949
|
|
|
1920
1950
|
{Fore.orange_3}Distressed Product:{Fore.light_red}{self.Distress}{Style.reset}
|
|
1921
1951
|
------------- Dates -----------------
|
|
1922
|
-
{Fore.light_cyan}Expiry{Fore.grey_70}[{types['Expiry']}{Fore.light_cyan}]={Fore.light_green}{self.Expiry}{Style.reset}
|
|
1923
|
-
{Fore.light_cyan}BestBy{Fore.grey_70}[{types['BestBy']}{Fore.light_cyan}]={Fore.light_green}{self.BestBy}{Style.reset}
|
|
1924
|
-
{Fore.light_cyan}AquisitionDate{Fore.grey_70}[{types['AquisitionDate']}{Fore.light_cyan}]={Fore.light_green}{self.AquisitionDate}{Style.reset}
|
|
1952
|
+
{Fore.light_cyan}Expiry{Fore.grey_70}[{types['Expiry']}{Fore.light_cyan}]={Fore.light_green}{self.Expiry}[{self.Expiry-datetime.now()} old]{Style.reset}
|
|
1953
|
+
{Fore.light_cyan}BestBy{Fore.grey_70}[{types['BestBy']}{Fore.light_cyan}]={Fore.light_green}{self.BestBy}[{self.BestBy-datetime.now()} old]{Style.reset}
|
|
1954
|
+
{Fore.light_cyan}AquisitionDate{Fore.grey_70}[{types['AquisitionDate']}{Fore.light_cyan}]={Fore.light_green}{self.AquisitionDate}[{self.AquisitionDate-datetime.now()} old]{Style.reset}
|
|
1925
1955
|
|
|
1926
1956
|
{Fore.sky_blue_2}Size{Style.reset}:{Fore.grey_70}{types['Size']}{Style.reset}={self.Size}
|
|
1927
1957
|
{Fore.tan}Image[{Fore.dark_goldenrod}Exists:{Fore.deep_pink_3b}{self.imageExists()}{Style.reset}{Fore.tan}]{Style.reset}:{Fore.grey_70}{types['Image']}{Style.reset}={self.Image}
|
|
@@ -2091,9 +2121,9 @@ class DayLog(BASE,EntryExtras):
|
|
|
2091
2121
|
WD_DSPLY=WD_DSPLY=Column(Integer)
|
|
2092
2122
|
CHKSTND_SPLY=CHKSTND_SPLY=Column(Integer)
|
|
2093
2123
|
|
|
2094
|
-
Expiry=Column(DateTime,default=
|
|
2095
|
-
BestBy=Column(DateTime,default=
|
|
2096
|
-
AquisitionDate=Column(DateTime,default=
|
|
2124
|
+
Expiry=Column(DateTime,default=datetime(1,1,1))
|
|
2125
|
+
BestBy=Column(DateTime,default=datetime(1,1,1))
|
|
2126
|
+
AquisitionDate=Column(DateTime,default=datetime(1,1,1))
|
|
2097
2127
|
'''
|
|
2098
2128
|
#__init__ def #AquisitionDate=None,BestBy=None,Expiry=None
|
|
2099
2129
|
|
|
@@ -2195,7 +2225,7 @@ class DayLog(BASE,EntryExtras):
|
|
|
2195
2225
|
{Fore.light_yellow}Name({Fore.pale_green_1b}{self.Name}{Fore.light_yellow}) {Fore.light_magenta}Price Per Unit({Fore.slate_blue_1}prc={self.Price}{Fore.light_magenta},crv={self.CRV},tax={self.Tax},ttl={formula}){Style.reset} {Fore.misty_rose_3}EID({Fore.pale_green_1b}{self.EntryId}{Fore.light_yellow}) {Fore.spring_green_3a}[BCD/UPC[A/E]/EAN[8/13]/GTIN](cd={Fore.light_magenta}{rebar},{Fore.chartreuse_1}no_sep={self.rebar(skip_sep=True)}{Fore.spring_green_3a}){Style.reset}{Fore.slate_blue_1} -{Fore.cyan}> {Fore.orange_red_1}[SHELF/TAG/CIC/STR_CD]({Fore.light_red}cd={self.cfmt(self.Code)}{Fore.orange_red_1},{Fore.light_steel_blue}DayLogId={self.DayLogId},{Fore.pale_green_1b}EntryId={self.EntryId}){Style.reset}'''
|
|
2196
2226
|
return msg
|
|
2197
2227
|
|
|
2198
|
-
def __init__(self,Barcode,Code,upce2upca='',Name='',InList=False,Price=0.0,Note='',Size='',CaseCount=0,Shelf=0,BackRoom=0,Display_1=0,Display_2=0,Display_3=0,Display_4=0,Display_5=0,Display_6=0,Stock_Total=0,Timestamp=datetime.now().timestamp(),EntryId=None,Location='///',ListQty=0.0,Image='',CHKSTND_SPLY=0,WD_DSPLY=0,FLRL_CHP_DSPLY=0,FLRL_WTR_DSPLY=0,SBX_WTR_KLR=0,SBX_CHP_DSPLY=0,SBX_WTR_DSPLY=0,Facings=0,Tags='',CaseID_6W='',CaseID_BR='',CaseID_LD='',ALT_Barcode='',DUP_Barcode='',DayLogDate=datetime.now(),DayLogId=None,CRV=0.0,Tax=0.0,TaxNote='',userUpdated=False,LoadCount=1,PalletCount=1,ShelfCount=1,Description='',Distress=0,UnitsDeep=1,UnitsHigh=1,AquisitionDate=
|
|
2228
|
+
def __init__(self,Barcode,Code,upce2upca='',Name='',InList=False,Price=0.0,Note='',Size='',CaseCount=0,Shelf=0,BackRoom=0,Display_1=0,Display_2=0,Display_3=0,Display_4=0,Display_5=0,Display_6=0,Stock_Total=0,Timestamp=datetime.now().timestamp(),EntryId=None,Location='///',ListQty=0.0,Image='',CHKSTND_SPLY=0,WD_DSPLY=0,FLRL_CHP_DSPLY=0,FLRL_WTR_DSPLY=0,SBX_WTR_KLR=0,SBX_CHP_DSPLY=0,SBX_WTR_DSPLY=0,Facings=0,Tags='',CaseID_6W='',CaseID_BR='',CaseID_LD='',ALT_Barcode='',DUP_Barcode='',DayLogDate=datetime.now(),DayLogId=None,CRV=0.0,Tax=0.0,TaxNote='',userUpdated=False,LoadCount=1,PalletCount=1,ShelfCount=1,Description='',Distress=0,UnitsDeep=1,UnitsHigh=1,AquisitionDate=datetime(1,1,1),BestBy=datetime(1,1,1),Expiry=datetime(1,1,1)):
|
|
2199
2229
|
if EntryId:
|
|
2200
2230
|
self.EntryId=EntryId
|
|
2201
2231
|
self.AquisitionDate=AquisitionDate
|
|
@@ -2239,6 +2269,18 @@ class DayLog(BASE,EntryExtras):
|
|
|
2239
2269
|
self.Image=Image
|
|
2240
2270
|
self.Tags=Tags
|
|
2241
2271
|
self.Facings=Facings
|
|
2272
|
+
if Expiry is None:
|
|
2273
|
+
self.Expiry=datetime(1,1,1)
|
|
2274
|
+
else:
|
|
2275
|
+
self.Expiry=Expiry
|
|
2276
|
+
if BestBy is None:
|
|
2277
|
+
self.BestBy=datetime(1,1,1)
|
|
2278
|
+
else:
|
|
2279
|
+
self.BestBy=BestBy
|
|
2280
|
+
if AquisitionDate is None:
|
|
2281
|
+
self.AquisitionDate=datetime(1,1,1)
|
|
2282
|
+
else:
|
|
2283
|
+
self.AquisitionDate=AquisitionDate
|
|
2242
2284
|
|
|
2243
2285
|
|
|
2244
2286
|
self.ALT_Barcode=ALT_Barcode
|
|
@@ -2457,6 +2499,12 @@ class DayLog(BASE,EntryExtras):
|
|
|
2457
2499
|
return result
|
|
2458
2500
|
|
|
2459
2501
|
def saveListExtended(self,num):
|
|
2502
|
+
if self.Expiry is None:
|
|
2503
|
+
self.Expiry=datetime(1,1,1)
|
|
2504
|
+
if self.BestBy is None:
|
|
2505
|
+
self.BestBy=datetime(1,1,1)
|
|
2506
|
+
if self.AquisitionDate is None:
|
|
2507
|
+
self.AquisitionDate=datetime(1,1,1)
|
|
2460
2508
|
if self.LCL_ANDROID.exists():
|
|
2461
2509
|
self.LCL=self.LCL_ANDROID
|
|
2462
2510
|
total=self.Display_1+self.Display_2+self.Display_3+self.Display_4+self.Display_5+self.Display_6+self.Shelf+self.BackRoom
|
|
@@ -2501,9 +2549,9 @@ CHKSTND_SPLY={self.CHKSTND_SPLY}
|
|
|
2501
2549
|
Total = {total}
|
|
2502
2550
|
Distressed={self.Distress} #not included in total
|
|
2503
2551
|
Total(w/o BR+) - Backroom = {(total-self.BackRoom)-self.BackRoom}
|
|
2504
|
-
Expiry = {self.Expiry}
|
|
2505
|
-
BestBy = {self.BestBy}
|
|
2506
|
-
AquisitionDate = {self.AquisitionDate}
|
|
2552
|
+
Expiry = {self.Expiry}[{self.Expiry-datetime.now()} old]
|
|
2553
|
+
BestBy = {self.BestBy}[{self.BestBy-datetime.now()} old]
|
|
2554
|
+
AquisitionDate = {self.AquisitionDate}[{self.AquisitionDate-datetime.now()} old]
|
|
2507
2555
|
-------------{num}-------------
|
|
2508
2556
|
"""
|
|
2509
2557
|
|
|
@@ -2523,6 +2571,12 @@ Facings={self.Facings}
|
|
|
2523
2571
|
'''
|
|
2524
2572
|
|
|
2525
2573
|
def listdisplay_extended(self,num):
|
|
2574
|
+
if self.Expiry is None:
|
|
2575
|
+
self.Expiry=datetime(1,1,1)
|
|
2576
|
+
if self.BestBy is None:
|
|
2577
|
+
self.BestBy=datetime(1,1,1)
|
|
2578
|
+
if self.AquisitionDate is None:
|
|
2579
|
+
self.AquisitionDate=datetime(1,1,1)
|
|
2526
2580
|
#print(self.csv_headers())
|
|
2527
2581
|
#print(self.csv_values())
|
|
2528
2582
|
total=self.Display_1+self.Display_2+self.Display_3+self.Display_4+self.Display_5+self.Display_6+self.Shelf+self.BackRoom
|
|
@@ -2580,9 +2634,9 @@ Facings={self.Facings}
|
|
|
2580
2634
|
deducted from Total as remainder is to be filled from LOAD{Style.reset}
|
|
2581
2635
|
{Fore.cyan}{Style.bold}2->{Style.reset}{Fore.hot_pink_2}Total(w/o BR+) - Backroom{Style.reset} = {Fore.light_yellow}{(total-self.BackRoom)-self.BackRoom}{Style.reset}
|
|
2582
2636
|
------------- Dates ------------------
|
|
2583
|
-
{Fore.light_cyan}Expiry = {Fore.light_green}{self.Expiry}{Style.reset}
|
|
2584
|
-
{Fore.light_cyan}BestBy = {Fore.light_green}{self.BestBy}{Style.reset}
|
|
2585
|
-
{Fore.light_cyan}AquisitionDate = {Fore.light_green}{self.AquisitionDate}{Style.reset}
|
|
2637
|
+
{Fore.light_cyan}Expiry = {Fore.light_green}{self.Expiry}[{self.Expiry-datetime.now()} old]{Style.reset}
|
|
2638
|
+
{Fore.light_cyan}BestBy = {Fore.light_green}{self.BestBy}[{self.BestBy-datetime.now()} old]{Style.reset}
|
|
2639
|
+
{Fore.light_cyan}AquisitionDate = {Fore.light_green}{self.AquisitionDate}[{self.AquisitionDate-datetime.now()} old]{Style.reset}
|
|
2586
2640
|
-------------{Style.bold+Style.underline+Fore.orange_red_1}{num}{Style.reset}-------------
|
|
2587
2641
|
"""
|
|
2588
2642
|
print(msg)
|
|
@@ -2608,6 +2662,12 @@ deducted from Total as remainder is to be filled from LOAD{Style.reset}
|
|
|
2608
2662
|
return ''
|
|
2609
2663
|
|
|
2610
2664
|
def __repr__(self):
|
|
2665
|
+
if self.Expiry is None:
|
|
2666
|
+
self.Expiry=datetime(1,1,1)
|
|
2667
|
+
if self.BestBy is None:
|
|
2668
|
+
self.BestBy=datetime(1,1,1)
|
|
2669
|
+
if self.AquisitionDate is None:
|
|
2670
|
+
self.AquisitionDate=datetime(1,1,1)
|
|
2611
2671
|
types={i.name:str(i.type) for i in self.__table__.columns}
|
|
2612
2672
|
m= f"""
|
|
2613
2673
|
{Style.bold}{Style.underline}{Fore.pale_green_1b}Daylog{Style.reset}(
|
|
@@ -2667,9 +2727,9 @@ deducted from Total as remainder is to be filled from LOAD{Style.reset}
|
|
|
2667
2727
|
{Fore.light_steel_blue}PalletCount{Style.reset}:{Fore.grey_70}{types['PalletCount']}{Style.reset}={self.PalletCount},
|
|
2668
2728
|
{Fore.light_steel_blue}LoadCount{Style.reset}:{Fore.grey_70}{types['LoadCount']}{Style.reset}={self.LoadCount},
|
|
2669
2729
|
------------- Dates ---------------
|
|
2670
|
-
{Fore.light_cyan}Expiry{Fore.grey_70}[{types['Expiry']}] = {Fore.light_green}{self.Expiry}{Style.reset}
|
|
2671
|
-
{Fore.light_cyan}BestBy{Fore.grey_70}[{types['BestBy']}] = {Fore.light_green}{self.BestBy}{Style.reset}
|
|
2672
|
-
{Fore.light_cyan}AquisitionDate{Fore.grey_70}[{types['AquisitionDate']}] = {Fore.light_green}{self.AquisitionDate}{Style.reset}
|
|
2730
|
+
{Fore.light_cyan}Expiry{Fore.grey_70}[{types['Expiry']}] = {Fore.light_green}{self.Expiry}[{self.Expiry-datetime.now()} old]{Style.reset}
|
|
2731
|
+
{Fore.light_cyan}BestBy{Fore.grey_70}[{types['BestBy']}] = {Fore.light_green}{self.BestBy}[{self.BestBy-datetime.now()} old]{Style.reset}
|
|
2732
|
+
{Fore.light_cyan}AquisitionDate{Fore.grey_70}[{types['AquisitionDate']}] = {Fore.light_green}{self.AquisitionDate}[{self.AquisitionDate-datetime.now()} old]{Style.reset}
|
|
2673
2733
|
|
|
2674
2734
|
{Fore.sky_blue_2}Size{Style.reset}:{Fore.grey_70}{types['Size']}{Style.reset}={self.Size}
|
|
2675
2735
|
{Fore.tan}Image[{Fore.dark_goldenrod}Exists:{Fore.deep_pink_3b}{self.imageExists()}{Style.reset}{Fore.tan}]{Style.reset}:{Fore.grey_70}{types['Image']}{Style.reset}={self.Image}
|
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.828'
|
|
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=Eo6TVBbNS7P-c7OBd5fl0nh8H_yKuj2DyptmuySNSo8,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
|
|
@@ -96,7 +96,7 @@ radboy/DB/SMLabelImporter.py,sha256=eUoBDxVUUEKGL2g_PwkASM67ZB7FmXtSnn4bCagskhY,
|
|
|
96
96
|
radboy/DB/__init__.py,sha256=JiigA9B7GalP7YuRdcwyGDu5PDSBahoi0lLjtScxlN8,49
|
|
97
97
|
radboy/DB/blankDataFile.py,sha256=YX_05Usi71UpDkZN9UTMYwUipbTndTAtEgqzBEga0kE,9285
|
|
98
98
|
radboy/DB/config.py,sha256=bvu43dUl1_yO3Zq3gsLuenGUgJSiS3S9Cs6ppFEvZbg,239
|
|
99
|
-
radboy/DB/db.py,sha256=
|
|
99
|
+
radboy/DB/db.py,sha256=OQJFci5t5twbr-91oUSrbQ7zHxswl4hNqfqE9bQw234,271226
|
|
100
100
|
radboy/DB/glossary_db.py,sha256=1_qxeEpjjEtpWB_eDjsgJisimLv7OBm75MuqM-Lt6zg,28218
|
|
101
101
|
radboy/DB/jobnotes.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
102
102
|
radboy/DB/lsToday.py,sha256=Pevus6GBHLM2xudBEx8u36Q-jYvatOI-y5o72BmFnzA,9435
|
|
@@ -138,7 +138,7 @@ radboy/DB/__pycache__/config.cpython-312.pyc,sha256=Qo7E6MHrF6yqvKgepNFyCoekZXiv
|
|
|
138
138
|
radboy/DB/__pycache__/config.cpython-313.pyc,sha256=_8wCIg_3jhyJjxnExD2Sm6aY-uZTw036p7Ki5znL7dc,376
|
|
139
139
|
radboy/DB/__pycache__/db.cpython-311.pyc,sha256=rNgigyBd0D-cg1JxKAS8t0B_k0IEJivgVlRaZE10Xis,210105
|
|
140
140
|
radboy/DB/__pycache__/db.cpython-312.pyc,sha256=ANDJPC0RoavbmSKFxG15vC7B4rEGyVt7xRJt7XGY3OA,334609
|
|
141
|
-
radboy/DB/__pycache__/db.cpython-313.pyc,sha256=
|
|
141
|
+
radboy/DB/__pycache__/db.cpython-313.pyc,sha256=08CKbOAOZ6wWjky3lLl8LlOyejpTsVarRzipt1pZsfs,425617
|
|
142
142
|
radboy/DB/__pycache__/glossary_db.cpython-312.pyc,sha256=8UL-29cKqtKovx0BANm6kzKKteef1BW_2qF3wumzst4,36023
|
|
143
143
|
radboy/DB/__pycache__/glossary_db.cpython-313.pyc,sha256=Ke9bkvllGv5CK0JdT9DRvQ3MOdrXxoYv7TVLNkqLux0,36582
|
|
144
144
|
radboy/DB/__pycache__/masterLookup.cpython-312.pyc,sha256=bQiOkmMwwHgcO18tYSWGQ-YUff4GQlKVhBMp1GoWAqY,6324
|
|
@@ -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=uoxlxAmApN7lxaH9mI67quNLohgCqTBVgopWijybbaw,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.828.dist-info/METADATA,sha256=N3NUlKnmWwnY-aB9uEPf-Kf2SBXxU4dV_kZp4Fr9qZw,1920
|
|
446
|
+
radboy-0.0.828.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
447
|
+
radboy-0.0.828.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
|
|
448
|
+
radboy-0.0.828.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|