radboy 0.0.771__py3-none-any.whl → 0.0.854__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/RxTx.py +4 -493
- radboy/Comm/__pycache__/RxTx.cpython-313.pyc +0 -0
- radboy/CookBook/CookBook.py +4 -0
- radboy/DB/ExerciseTracker.py +64 -27
- radboy/DB/GEMINI.py +146 -0
- radboy/DB/Prompt.py +150 -7
- radboy/DB/__pycache__/ExerciseTracker.cpython-313.pyc +0 -0
- radboy/DB/__pycache__/Prompt.cpython-313.pyc +0 -0
- radboy/DB/__pycache__/db.cpython-313.pyc +0 -0
- radboy/DB/db.py +141 -10
- radboy/DayLog/DayLogger.py +1 -1
- radboy/DayLog/__pycache__/DayLogger.cpython-313.pyc +0 -0
- radboy/FB/FBMTXT.py +48 -1
- radboy/FB/__pycache__/FBMTXT.cpython-313.pyc +0 -0
- radboy/HowDoYouDefineMe/CoreEmotions.py +268 -9
- radboy/Lookup2/Lookup2.py +31 -1
- radboy/Lookup2/__pycache__/Lookup2.cpython-313.pyc +0 -0
- radboy/RNE/RNE.py +7 -0
- radboy/RNE/__pycache__/RNE.cpython-313.pyc +0 -0
- radboy/TasksMode/SetEntryNEU.py +16 -2
- radboy/TasksMode/Tasks.py +546 -101
- radboy/TasksMode/__pycache__/SetEntryNEU.cpython-313.pyc +0 -0
- radboy/TasksMode/__pycache__/Tasks.cpython-313.pyc +0 -0
- radboy/Unified/BACKUP.py +443 -0
- radboy/Unified/Unified.py +2 -321
- radboy/Unified/__pycache__/Unified.cpython-313.pyc +0 -0
- radboy/Unified/__pycache__/bareCA.cpython-313.pyc +0 -0
- radboy/Unified/__pycache__/clearalll.cpython-313.pyc +0 -0
- radboy/Unified/bareCA.py +26 -2
- radboy/Unified/clearalll.py +6 -0
- radboy/__init__.py +1 -1
- radboy/__pycache__/__init__.cpython-313.pyc +0 -0
- radboy/code.png +0 -0
- radboy/preloader/preloader.py +70 -0
- radboy/preloader/preloader_func.py +688 -2
- {radboy-0.0.771.dist-info → radboy-0.0.854.dist-info}/METADATA +1 -1
- {radboy-0.0.771.dist-info → radboy-0.0.854.dist-info}/RECORD +39 -37
- {radboy-0.0.771.dist-info → radboy-0.0.854.dist-info}/WHEEL +0 -0
- {radboy-0.0.771.dist-info → radboy-0.0.854.dist-info}/top_level.txt +0 -0
|
@@ -27,7 +27,8 @@ import itertools
|
|
|
27
27
|
import decimal
|
|
28
28
|
from decimal import localcontext,Decimal
|
|
29
29
|
unit_registry=pint.UnitRegistry()
|
|
30
|
-
import math
|
|
30
|
+
import math,scipy
|
|
31
|
+
from radboy.HowDoYouDefineMe.CoreEmotions import *
|
|
31
32
|
|
|
32
33
|
def volume():
|
|
33
34
|
with localcontext() as ctx:
|
|
@@ -1424,4 +1425,689 @@ class candidates:
|
|
|
1424
1425
|
pzl=mkpuzl()
|
|
1425
1426
|
continue
|
|
1426
1427
|
else:
|
|
1427
|
-
continue
|
|
1428
|
+
continue
|
|
1429
|
+
|
|
1430
|
+
|
|
1431
|
+
def costToRun():
|
|
1432
|
+
fields={
|
|
1433
|
+
'wattage of device plugged in, turned on/off?':{
|
|
1434
|
+
'default':60,
|
|
1435
|
+
'type':'float'
|
|
1436
|
+
},
|
|
1437
|
+
'hours of use?':{
|
|
1438
|
+
'default':1,
|
|
1439
|
+
'type':'float'
|
|
1440
|
+
},
|
|
1441
|
+
'electrical providers cost per kWh':{
|
|
1442
|
+
'default':0.70 ,
|
|
1443
|
+
'type':'float'
|
|
1444
|
+
},
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
fd=FormBuilder(data=fields)
|
|
1448
|
+
if fd is None:
|
|
1449
|
+
return
|
|
1450
|
+
|
|
1451
|
+
cost=((fd['wattage of device plugged in, turned on/off?']/1000)*fd['electrical providers cost per kWh'])
|
|
1452
|
+
total_cost_to=cost*fd['hours of use?']
|
|
1453
|
+
return total_cost_to
|
|
1454
|
+
|
|
1455
|
+
|
|
1456
|
+
def generic_service_or_item():
|
|
1457
|
+
fields={
|
|
1458
|
+
'PerBaseUnit':{
|
|
1459
|
+
'default':'squirt',
|
|
1460
|
+
'type':'string',
|
|
1461
|
+
},
|
|
1462
|
+
'PerBaseUnit_is_EquivalentTo[Conversion]':{
|
|
1463
|
+
'default':'1 squirt == 2 grams',
|
|
1464
|
+
'type':'string',
|
|
1465
|
+
},
|
|
1466
|
+
'PricePer_1_EquivalentTo[Conversion]':{
|
|
1467
|
+
'default':0,
|
|
1468
|
+
'type':'float',
|
|
1469
|
+
},
|
|
1470
|
+
'Name or Description':{
|
|
1471
|
+
'default':'dawn power wash',
|
|
1472
|
+
'type':'string'
|
|
1473
|
+
},
|
|
1474
|
+
'Cost/Price/Expense Taxed @ %':{
|
|
1475
|
+
'default':'Item was purchased for 3.99 Taxed @ 6.3% (PRICE+(PRICE+TAX))',
|
|
1476
|
+
'type':'string'
|
|
1477
|
+
},
|
|
1478
|
+
'Where was the item purchased/sold[Location/Street Address, City, State ZIP]?':{
|
|
1479
|
+
'default':'walmart in gloucester va, 23061',
|
|
1480
|
+
'type':'string'
|
|
1481
|
+
},
|
|
1482
|
+
}
|
|
1483
|
+
fd=FormBuilder(data=fields)
|
|
1484
|
+
if fd is not None:
|
|
1485
|
+
textty=[]
|
|
1486
|
+
cta=len(fd)
|
|
1487
|
+
for num,k in enumerate(fd):
|
|
1488
|
+
msg=f"{k} = '{fd[k]}'"
|
|
1489
|
+
textty.append(strip_colors(std_colorize(msg,num,cta)))
|
|
1490
|
+
master=f'''
|
|
1491
|
+
Non-Std Item/Non-Std Service
|
|
1492
|
+
----------------------------
|
|
1493
|
+
{' '+'\n '.join(textty)}
|
|
1494
|
+
----------------------------
|
|
1495
|
+
'''
|
|
1496
|
+
return master
|
|
1497
|
+
|
|
1498
|
+
def reciept_book_entry():
|
|
1499
|
+
fields={
|
|
1500
|
+
'reciept number':{
|
|
1501
|
+
'default':'',
|
|
1502
|
+
'type':'string'
|
|
1503
|
+
},
|
|
1504
|
+
'reciept dtoe':{
|
|
1505
|
+
'default':datetime.now(),
|
|
1506
|
+
'type':'datetime'
|
|
1507
|
+
},
|
|
1508
|
+
'recieved from':{
|
|
1509
|
+
'default':'',
|
|
1510
|
+
'type':'string'
|
|
1511
|
+
},
|
|
1512
|
+
'address':{
|
|
1513
|
+
'default':'',
|
|
1514
|
+
'type':'string'
|
|
1515
|
+
},
|
|
1516
|
+
'Amount ($)':{
|
|
1517
|
+
'default':0,
|
|
1518
|
+
'type':'dec.dec',
|
|
1519
|
+
},
|
|
1520
|
+
'For':{
|
|
1521
|
+
'default':'',
|
|
1522
|
+
'type':'string'
|
|
1523
|
+
},
|
|
1524
|
+
'By':{
|
|
1525
|
+
'default':'',
|
|
1526
|
+
'type':'string'
|
|
1527
|
+
},
|
|
1528
|
+
'Amount of Account':{
|
|
1529
|
+
'default':0,
|
|
1530
|
+
'type':'dec.dec',
|
|
1531
|
+
},
|
|
1532
|
+
'Amount Paid':{
|
|
1533
|
+
'default':0,
|
|
1534
|
+
'type':'dec.dec',
|
|
1535
|
+
},
|
|
1536
|
+
'Balance Due':{
|
|
1537
|
+
'default':0,
|
|
1538
|
+
'type':'dec.dec',
|
|
1539
|
+
},
|
|
1540
|
+
'Cash':{
|
|
1541
|
+
'default':0,
|
|
1542
|
+
'type':'dec.dec',
|
|
1543
|
+
},
|
|
1544
|
+
'Check':{
|
|
1545
|
+
'default':0,
|
|
1546
|
+
'type':'dec.dec',
|
|
1547
|
+
},
|
|
1548
|
+
'Money Order':{
|
|
1549
|
+
'default':0,
|
|
1550
|
+
'type':'dec.dec',
|
|
1551
|
+
},
|
|
1552
|
+
'Line 1':{
|
|
1553
|
+
'default':'',
|
|
1554
|
+
'type':'string'
|
|
1555
|
+
},
|
|
1556
|
+
'Line 2':{
|
|
1557
|
+
'default':'',
|
|
1558
|
+
'type':'string'
|
|
1559
|
+
},
|
|
1560
|
+
'Notes':{
|
|
1561
|
+
'default':'',
|
|
1562
|
+
'type':'string'
|
|
1563
|
+
},
|
|
1564
|
+
'Filing Location Id':{
|
|
1565
|
+
'default':'',
|
|
1566
|
+
'type':'string'
|
|
1567
|
+
},
|
|
1568
|
+
}
|
|
1569
|
+
fd=FormBuilder(data=fields)
|
|
1570
|
+
if fd is not None:
|
|
1571
|
+
textty=[]
|
|
1572
|
+
cta=len(fd)
|
|
1573
|
+
for num,k in enumerate(fd):
|
|
1574
|
+
msg=f"{k} = '{fd[k]}'"
|
|
1575
|
+
textty.append(strip_colors(std_colorize(msg,num,cta)))
|
|
1576
|
+
master=f'''
|
|
1577
|
+
Reciept {fd['reciept number']}
|
|
1578
|
+
----------------------------
|
|
1579
|
+
{' '+'\n '.join(textty)}
|
|
1580
|
+
----------------------------
|
|
1581
|
+
'''
|
|
1582
|
+
return master
|
|
1583
|
+
|
|
1584
|
+
def nowToPercentTime(now=None):
|
|
1585
|
+
if not isinstance(now,datetime):
|
|
1586
|
+
now=datetime.now()
|
|
1587
|
+
today=datetime(now.year,now.month,now.day)
|
|
1588
|
+
diff=now-today
|
|
1589
|
+
a=round(diff.total_seconds()/60/60/24,6)
|
|
1590
|
+
a100=round(a*100,2)
|
|
1591
|
+
m=str(now.strftime(f'{now} | %mM/%dD/%YY @ %H(24H)/%I %p(12H):%M:%S | {a100} Percent of 24H has passed since {today} as {diff.total_seconds()} seconds passed/{(24*60*60)} total seconds in day={a}*100={a100} | Percent of Day Passed = {a100}%'))
|
|
1592
|
+
return m
|
|
1593
|
+
|
|
1594
|
+
|
|
1595
|
+
def ndtp():
|
|
1596
|
+
msg=''
|
|
1597
|
+
while True:
|
|
1598
|
+
try:
|
|
1599
|
+
fields={
|
|
1600
|
+
'distance':{
|
|
1601
|
+
'type':'float',
|
|
1602
|
+
'default':25,
|
|
1603
|
+
},
|
|
1604
|
+
'speed':{
|
|
1605
|
+
'type':'float',
|
|
1606
|
+
'default':70
|
|
1607
|
+
},
|
|
1608
|
+
'total break time':{
|
|
1609
|
+
'type':'string',
|
|
1610
|
+
'default':'10 minutes'
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
fd=FormBuilder(data=fields,passThruText=msg)
|
|
1614
|
+
if fd is None:
|
|
1615
|
+
return
|
|
1616
|
+
|
|
1617
|
+
mph=fd['speed']
|
|
1618
|
+
distance=fd['distance']
|
|
1619
|
+
try:
|
|
1620
|
+
breaks=pint.Quantity(fd['total break time']).to('seconds').magnitude
|
|
1621
|
+
except Exception as e:
|
|
1622
|
+
breaks=pint.Quantity(fd['total break time']+' minutes').to('seconds').magnitude
|
|
1623
|
+
duration=pint.Quantity(distance/mph,'hour').to('sec').magnitude
|
|
1624
|
+
#12 minutes
|
|
1625
|
+
buffer=timedelta(minutes=15)
|
|
1626
|
+
original=timedelta(seconds=duration)+timedelta(seconds=breaks)
|
|
1627
|
+
duration=timedelta(seconds=original.total_seconds()+buffer.total_seconds())
|
|
1628
|
+
now=datetime.now()
|
|
1629
|
+
then=now+duration
|
|
1630
|
+
msg=[]
|
|
1631
|
+
msg.append(f'Rate of Travel: {str(mph)}')
|
|
1632
|
+
msg.append(f'Distance To Travel: {distance}')
|
|
1633
|
+
msg.append(f"Now: {now}")
|
|
1634
|
+
msg.append(f'Non-Buffered Duration {original}')
|
|
1635
|
+
msg.append(f'Buffered: {duration} (+{buffer})')
|
|
1636
|
+
msg.append(f"Then: {then}")
|
|
1637
|
+
msg.append(f'Total Break Time: {timedelta(seconds=breaks)}')
|
|
1638
|
+
msg.append(f"From: {nowToPercentTime(now)}")
|
|
1639
|
+
msg.append(f"To: {nowToPercentTime(then)}")
|
|
1640
|
+
msg='\n\n'.join(msg)
|
|
1641
|
+
return msg
|
|
1642
|
+
except Exception as e:
|
|
1643
|
+
print(e)
|
|
1644
|
+
|
|
1645
|
+
def drug_text():
|
|
1646
|
+
while True:
|
|
1647
|
+
try:
|
|
1648
|
+
drug_names=[
|
|
1649
|
+
'thc flower',
|
|
1650
|
+
'thc vape',
|
|
1651
|
+
|
|
1652
|
+
'thca flower',
|
|
1653
|
+
'thca vape',
|
|
1654
|
+
|
|
1655
|
+
'caffiene',
|
|
1656
|
+
'caffiene+taurine',
|
|
1657
|
+
'caffiene+beta_alanine',
|
|
1658
|
+
|
|
1659
|
+
'alcohol',
|
|
1660
|
+
'alcohol+thc flower',
|
|
1661
|
+
'alcohol+thca flower',
|
|
1662
|
+
|
|
1663
|
+
'caffiene+thca flower+menthol',
|
|
1664
|
+
'caffiene+thc flower+menthol',
|
|
1665
|
+
]
|
|
1666
|
+
extra_drugs=detectGetOrSet("extra_drugs","extra_drugs.csv",setValue=False,literal=True)
|
|
1667
|
+
if extra_drugs:
|
|
1668
|
+
extra_drugs=Path(extra_drugs)
|
|
1669
|
+
|
|
1670
|
+
|
|
1671
|
+
if extra_drugs.exists():
|
|
1672
|
+
with extra_drugs.open("r") as fileio:
|
|
1673
|
+
reader=csv.reader(fileio,delimiter=',')
|
|
1674
|
+
for line in reader:
|
|
1675
|
+
for sub in line:
|
|
1676
|
+
if sub not in ['',]:
|
|
1677
|
+
sub=f"{sub} {Fore.light_green}[{Fore.cyan}{extra_drugs}{Fore.light_green}]{Fore.dark_goldenrod}"
|
|
1678
|
+
drug_names.append(sub)
|
|
1679
|
+
|
|
1680
|
+
excludes_drn=['',' ',None,'\n','\r\n','\t',]
|
|
1681
|
+
rdr_state=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
|
|
1682
|
+
if rdr_state:
|
|
1683
|
+
drug_names=list(sorted(set([i for i in drug_names if i not in excludes_drn]),key=str))
|
|
1684
|
+
else:
|
|
1685
|
+
drug_names=list(reversed(sorted(set([i for i in drug_names if i not in excludes_drn]),key=str)))
|
|
1686
|
+
htext=[]
|
|
1687
|
+
cta=len(drug_names)
|
|
1688
|
+
for num,i in enumerate(drug_names):
|
|
1689
|
+
htext.append(std_colorize(i,num,cta))
|
|
1690
|
+
htext='\n'.join(htext)
|
|
1691
|
+
|
|
1692
|
+
which=Control(func=FormBuilderMkText,ptext=f"{htext}\n{Fore.yellow}which index?",helpText=htext,data="integer")
|
|
1693
|
+
if which in [None,'NaN']:
|
|
1694
|
+
return
|
|
1695
|
+
|
|
1696
|
+
return strip_colors(drug_names[which])
|
|
1697
|
+
except Exception as e:
|
|
1698
|
+
print(e)
|
|
1699
|
+
continue
|
|
1700
|
+
|
|
1701
|
+
def TotalCurrencyFromMass():
|
|
1702
|
+
msg=''
|
|
1703
|
+
while True:
|
|
1704
|
+
try:
|
|
1705
|
+
fields={
|
|
1706
|
+
'1 Unit Mass(Grams)':{
|
|
1707
|
+
'type':'dec.dec',
|
|
1708
|
+
'default':2.50,
|
|
1709
|
+
},
|
|
1710
|
+
'1 Unit Value($)':{
|
|
1711
|
+
'type':'dec.dec',
|
|
1712
|
+
'default':0.01
|
|
1713
|
+
},
|
|
1714
|
+
'Total Unit Mass (Total Coin/Bill Mass)':{
|
|
1715
|
+
'type':'dec.dec',
|
|
1716
|
+
'default':0.0
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
fd=FormBuilder(data=fields,passThruText=msg)
|
|
1720
|
+
if fd is None:
|
|
1721
|
+
return
|
|
1722
|
+
value=(decc(1/fd['1 Unit Mass(Grams)'])*decc(fd['1 Unit Value($)']))*decc(fd['Total Unit Mass (Total Coin/Bill Mass)'])
|
|
1723
|
+
return value
|
|
1724
|
+
except Exception as e:
|
|
1725
|
+
print(e)
|
|
1726
|
+
|
|
1727
|
+
def BaseCurrencyValueFromMass():
|
|
1728
|
+
msg=''
|
|
1729
|
+
while True:
|
|
1730
|
+
try:
|
|
1731
|
+
fields={
|
|
1732
|
+
'1 Unit Mass(Grams)':{
|
|
1733
|
+
'type':'dec.dec',
|
|
1734
|
+
'default':2.50,
|
|
1735
|
+
},
|
|
1736
|
+
'1 Unit Value($)':{
|
|
1737
|
+
'type':'dec.dec',
|
|
1738
|
+
'default':0.01
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
fd=FormBuilder(data=fields,passThruText=msg)
|
|
1742
|
+
if fd is None:
|
|
1743
|
+
return
|
|
1744
|
+
value=(decc(1/fd['1 Unit Mass(Grams)'])*decc(fd['1 Unit Value($)']))
|
|
1745
|
+
return value
|
|
1746
|
+
except Exception as e:
|
|
1747
|
+
print(e)
|
|
1748
|
+
|
|
1749
|
+
|
|
1750
|
+
def USCurrencyMassValues():
|
|
1751
|
+
while True:
|
|
1752
|
+
try:
|
|
1753
|
+
drug_names={
|
|
1754
|
+
'Mass(Grams) - 1 Dollar Coin/1.0':decc(8.1),
|
|
1755
|
+
'Mass(Grams) - Half Dollar/0.50':decc(11.340),
|
|
1756
|
+
'Mass(Grams) - Quarter/0.25':decc(5.670),
|
|
1757
|
+
'Mass(Grams) - Nickel/0.05':decc(5.0),
|
|
1758
|
+
'Mass(Grams) - Dime/0.10':decc(2.268),
|
|
1759
|
+
'Mass(Grams) - Penny/0.01':decc(2.5),
|
|
1760
|
+
'Mass(Grams) - Bill($1/$2/$5/$10/$20/$50/$100':decc(1),
|
|
1761
|
+
|
|
1762
|
+
'Value for Mass(Grams) - 1 Dollar Coin/8.1 Grams':1.00,
|
|
1763
|
+
'Value for Mass(Grams) - Half Dollar/11.340 Grams':0.50,
|
|
1764
|
+
'Value for Mass(Grams) - Quarter/5.670 Grams':0.25,
|
|
1765
|
+
'Value for Mass(Grams) - Nickel/5 Grams':0.05,
|
|
1766
|
+
'Value for Mass(Grams) - Dime/2.268 Grams':0.10,
|
|
1767
|
+
'Value for Mass(Grams) - Penny/2.5 Grams':0.01,
|
|
1768
|
+
'Value for Mass(Grams) - 1$ Bill/1 Grams':1,
|
|
1769
|
+
'Value for Mass(Grams) - 2$ Bill/1 Grams':2,
|
|
1770
|
+
'Value for Mass(Grams) - 5$ Bill/1 Grams':5,
|
|
1771
|
+
'Value for Mass(Grams) - 10$ Bill/1 Grams':10,
|
|
1772
|
+
'Value for Mass(Grams) - 20$ Bill/1 Grams':20,
|
|
1773
|
+
'Value for Mass(Grams) - 50$ Bill/1 Grams':50,
|
|
1774
|
+
'Value for Mass(Grams) - 100$ Bill/1 Grams':100,
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
|
|
1778
|
+
keys=[]
|
|
1779
|
+
htext=[]
|
|
1780
|
+
cta=len(drug_names)
|
|
1781
|
+
for num,i in enumerate(drug_names):
|
|
1782
|
+
msg=f'{i} -> {drug_names[i]}'
|
|
1783
|
+
htext.append(std_colorize(msg,num,cta))
|
|
1784
|
+
keys.append(i)
|
|
1785
|
+
htext='\n'.join(htext)
|
|
1786
|
+
print(htext)
|
|
1787
|
+
which=Control(func=FormBuilderMkText,ptext="which index?",helpText=htext,data="integer")
|
|
1788
|
+
if which in [None,'NaN']:
|
|
1789
|
+
return
|
|
1790
|
+
return drug_names[keys[which]]
|
|
1791
|
+
|
|
1792
|
+
except Exception as e:
|
|
1793
|
+
print(e)
|
|
1794
|
+
continue
|
|
1795
|
+
|
|
1796
|
+
|
|
1797
|
+
def golden_ratio():
|
|
1798
|
+
msg=''
|
|
1799
|
+
while True:
|
|
1800
|
+
try:
|
|
1801
|
+
fields={
|
|
1802
|
+
'measurement':{
|
|
1803
|
+
'type':'dec.dec',
|
|
1804
|
+
'default':48,
|
|
1805
|
+
},
|
|
1806
|
+
}
|
|
1807
|
+
fd=FormBuilder(data=fields,passThruText=msg)
|
|
1808
|
+
if fd is None:
|
|
1809
|
+
return
|
|
1810
|
+
side1_value=(decc(fd['measurement'])/decc(scipy.constants.golden_ratio))
|
|
1811
|
+
side2_value=fd['measurement']-decc(side1_value)
|
|
1812
|
+
which=Control(func=FormBuilderMkText,ptext=f"Which side do you wish to return [for a side of {fd['measurement']}: side1_value={side1_value},side2_value={side2_value}]?",helpText="yes/1/true=side 1,side 2 is false/no/0",data="boolean")
|
|
1813
|
+
if which in [None,"NaN"]:
|
|
1814
|
+
return
|
|
1815
|
+
elif which:
|
|
1816
|
+
return side1_value
|
|
1817
|
+
else:
|
|
1818
|
+
return side2_value
|
|
1819
|
+
except Exception as e:
|
|
1820
|
+
print(e)
|
|
1821
|
+
|
|
1822
|
+
|
|
1823
|
+
def currency_conversion():
|
|
1824
|
+
cvt_registry=pint.UnitRegistry()
|
|
1825
|
+
|
|
1826
|
+
definition=f'''
|
|
1827
|
+
USD = [currency]
|
|
1828
|
+
Argentine_Peso = nan usd
|
|
1829
|
+
Australian_Dollar = nan usd
|
|
1830
|
+
Bahraini_Dinar = nan usd
|
|
1831
|
+
Botswana_Pula = nan usd
|
|
1832
|
+
Brazilian_Real = nan usd
|
|
1833
|
+
British_Pound = nan usd
|
|
1834
|
+
Bruneian_Dollar = nan usd
|
|
1835
|
+
Bulgarian_Lev = nan usd
|
|
1836
|
+
Canadian_Dollar = nan usd
|
|
1837
|
+
Chilean_Peso = nan usd
|
|
1838
|
+
Chinese_Yuan_Renminbi = nan usd
|
|
1839
|
+
Colombian_Peso = nan usd
|
|
1840
|
+
Czech_Koruna = nan usd
|
|
1841
|
+
Danish_Krone = nan usd
|
|
1842
|
+
Emirati_Dirham = nan usd
|
|
1843
|
+
Euro = nan usd
|
|
1844
|
+
Hong_Kong_Dollar = nan usd
|
|
1845
|
+
Hungarian_Forint = nan usd
|
|
1846
|
+
Icelandic_Krona = nan usd
|
|
1847
|
+
Indian_Rupee = nan usd
|
|
1848
|
+
Indonesian_Rupiah = nan usd
|
|
1849
|
+
Iranian_Rial = nan usd
|
|
1850
|
+
Israeli_Shekel = nan usd
|
|
1851
|
+
Japanese_Yen = nan usd
|
|
1852
|
+
Kazakhstani_Tenge = nan usd
|
|
1853
|
+
Kuwaiti_Dinar = nan usd
|
|
1854
|
+
Libyan_Dinar = nan usd
|
|
1855
|
+
Malaysian_Ringgit = nan usd
|
|
1856
|
+
Mauritian_Rupee = nan usd
|
|
1857
|
+
Mexican_Peso = nan usd
|
|
1858
|
+
Nepalese_Rupee = nan usd
|
|
1859
|
+
New_Zealand_Dollar = nan usd
|
|
1860
|
+
Norwegian_Krone = nan usd
|
|
1861
|
+
Omani_Rial = nan usd
|
|
1862
|
+
Pakistani_Rupee = nan usd
|
|
1863
|
+
Philippine_Peso = nan usd
|
|
1864
|
+
Polish_Zloty = nan usd
|
|
1865
|
+
Qatari_Riyal = nan usd
|
|
1866
|
+
Romanian_New_Leu = nan usd
|
|
1867
|
+
Russian_Ruble = nan usd
|
|
1868
|
+
Saudi_Arabian_Riyal = nan usd
|
|
1869
|
+
Singapore_Dollar = nan usd
|
|
1870
|
+
South_African_Rand = nan usd
|
|
1871
|
+
South_Korean_Won = nan usd
|
|
1872
|
+
Sri_Lankan_Rupee = nan usd
|
|
1873
|
+
Swedish_Krona = nan usd
|
|
1874
|
+
Swiss_Franc = nan usd
|
|
1875
|
+
Taiwan_New_Dollar = nan usd
|
|
1876
|
+
Thai_Baht = nan usd
|
|
1877
|
+
Trinidadian_Dollar = nan usd
|
|
1878
|
+
Turkish_Lira = nan usd
|
|
1879
|
+
|
|
1880
|
+
@context FX
|
|
1881
|
+
Argentine_Peso = 0.000671 usd
|
|
1882
|
+
Australian_Dollar = 0.651104 usd
|
|
1883
|
+
Bahraini_Dinar = 2.659574 usd
|
|
1884
|
+
Botswana_Pula = 0.070042 usd
|
|
1885
|
+
Brazilian_Real = 0.185537 usd
|
|
1886
|
+
British_Pound = 1.330948 usd
|
|
1887
|
+
Bruneian_Dollar = 0.769854 usd
|
|
1888
|
+
Bulgarian_Lev = 0.594475 usd
|
|
1889
|
+
Canadian_Dollar = 0.714527 usd
|
|
1890
|
+
Chilean_Peso = 0.001062 usd
|
|
1891
|
+
Chinese_Yuan_Renminbi = 0.140424 usd
|
|
1892
|
+
Colombian_Peso = 0.000259 usd
|
|
1893
|
+
Czech_Koruna = 0.047793 usd
|
|
1894
|
+
Danish_Krone = 0.155642 usd
|
|
1895
|
+
Emirati_Dirham = 0.272294 usd
|
|
1896
|
+
Euro = 1.162692 usd
|
|
1897
|
+
Hong_Kong_Dollar = 0.128701 usd
|
|
1898
|
+
Hungarian_Forint = 0.002981 usd
|
|
1899
|
+
Icelandic_Krona = 0.008119 usd
|
|
1900
|
+
Indian_Rupee = 0.011384 usd
|
|
1901
|
+
Indonesian_Rupiah = 0.00006 usd
|
|
1902
|
+
Iranian_Rial = 0.000024 usd
|
|
1903
|
+
Israeli_Shekel = 0.304734 usd
|
|
1904
|
+
Japanese_Yen = 0.006545 usd
|
|
1905
|
+
Kazakhstani_Tenge = 0.00186 usd
|
|
1906
|
+
Kuwaiti_Dinar = 3.261214 usd
|
|
1907
|
+
Libyan_Dinar = 0.183824 usd
|
|
1908
|
+
Malaysian_Ringgit = 0.236753 usd
|
|
1909
|
+
Mauritian_Rupee = 0.02197 usd
|
|
1910
|
+
Mexican_Peso = 0.054181 usd
|
|
1911
|
+
Nepalese_Rupee = 0.007112 usd
|
|
1912
|
+
New_Zealand_Dollar = 0.575051 usd
|
|
1913
|
+
Norwegian_Krone = 0.099905 usd
|
|
1914
|
+
Omani_Rial = 2.603489 usd
|
|
1915
|
+
Pakistani_Rupee = 0.003531 usd
|
|
1916
|
+
Philippine_Peso = 0.017016 usd
|
|
1917
|
+
Polish_Zloty = 0.274017 usd
|
|
1918
|
+
Qatari_Riyal = 0.274725 usd
|
|
1919
|
+
Romanian_New_Leu = 0.228593 usd
|
|
1920
|
+
Russian_Ruble = 0.012559 usd
|
|
1921
|
+
Saudi_Arabian_Riyal = 0.266667 usd
|
|
1922
|
+
Singapore_Dollar = 0.769854 usd
|
|
1923
|
+
South_African_Rand = 0.057932 usd
|
|
1924
|
+
South_Korean_Won = 0.000695 usd
|
|
1925
|
+
Sri_Lankan_Rupee = 0.003293 usd
|
|
1926
|
+
Swedish_Krona = 0.106347 usd
|
|
1927
|
+
Swiss_Franc = 1.256685 usd
|
|
1928
|
+
Taiwan_New_Dollar = 0.032417 usd
|
|
1929
|
+
Thai_Baht = 0.030604 usd
|
|
1930
|
+
Trinidadian_Dollar = 0.147095 usd
|
|
1931
|
+
Turkish_Lira = 0.023829 usd
|
|
1932
|
+
@end'''.lower()
|
|
1933
|
+
defFile=db.detectGetOrSet("currency_definitions_file","currency_definitions.txt",setValue=False,literal=True)
|
|
1934
|
+
if defFile is None:
|
|
1935
|
+
return
|
|
1936
|
+
defFile=Path(defFile)
|
|
1937
|
+
with open(defFile,"w") as out:
|
|
1938
|
+
out.write(definition)
|
|
1939
|
+
cvt_registry.load_definitions(defFile)
|
|
1940
|
+
with cvt_registry.context("fx") as cvtr:
|
|
1941
|
+
while True:
|
|
1942
|
+
try:
|
|
1943
|
+
htext=[]
|
|
1944
|
+
definition=definition.split("@context FX")[-1].replace('\n@end','')
|
|
1945
|
+
cta=len(definition.split("\n"))
|
|
1946
|
+
formats='\n'.join([std_colorize(i,num,cta) for num,i in enumerate(definition.split("\n"))])
|
|
1947
|
+
|
|
1948
|
+
formats=f'''Conversion Formats are:\n{formats}\n'''
|
|
1949
|
+
fields={
|
|
1950
|
+
'value':{
|
|
1951
|
+
'default':1,
|
|
1952
|
+
'type':'float',
|
|
1953
|
+
},
|
|
1954
|
+
'FromString':{
|
|
1955
|
+
'default':'USD',
|
|
1956
|
+
'type':'string',
|
|
1957
|
+
},
|
|
1958
|
+
'ToString':{
|
|
1959
|
+
'default':'Euro',
|
|
1960
|
+
'type':'string'
|
|
1961
|
+
},
|
|
1962
|
+
}
|
|
1963
|
+
fb=FormBuilder(data=fields,passThruText=formats)
|
|
1964
|
+
if fb is None:
|
|
1965
|
+
return
|
|
1966
|
+
|
|
1967
|
+
return_string=fb['ToString'].lower()
|
|
1968
|
+
value_string=f"{fb['value']} {fb['FromString']}".lower()
|
|
1969
|
+
resultant=cvtr.Quantity(value_string).to(return_string)
|
|
1970
|
+
|
|
1971
|
+
#if it gets here return None
|
|
1972
|
+
return resultant
|
|
1973
|
+
except Exception as e:
|
|
1974
|
+
print(e)
|
|
1975
|
+
|
|
1976
|
+
def bible_try():
|
|
1977
|
+
try:
|
|
1978
|
+
os.system("sonofman")
|
|
1979
|
+
return None
|
|
1980
|
+
except Exception as e:
|
|
1981
|
+
print(e)
|
|
1982
|
+
|
|
1983
|
+
DELCHAR=db.detectGetOrSet("DELCHAR preloader func","|",setValue=False,literal=True)
|
|
1984
|
+
if not DELCHAR:
|
|
1985
|
+
DELCHAR='|'
|
|
1986
|
+
|
|
1987
|
+
def SalesFloorLocationString():
|
|
1988
|
+
fields=OrderedDict({
|
|
1989
|
+
|
|
1990
|
+
'Aisle[s]':{
|
|
1991
|
+
'default':'',
|
|
1992
|
+
'type':'string',
|
|
1993
|
+
},
|
|
1994
|
+
'Bay[s]/AisleDepth':{
|
|
1995
|
+
'default':'',
|
|
1996
|
+
'type':'string',
|
|
1997
|
+
},
|
|
1998
|
+
'Shel[f,ves]':{
|
|
1999
|
+
'default':'',
|
|
2000
|
+
'type':'string',
|
|
2001
|
+
}
|
|
2002
|
+
})
|
|
2003
|
+
passThruText=f"""
|
|
2004
|
+
{Fore.orange_red_1}Valid Aisle[s]:{Fore.grey_85}
|
|
2005
|
+
this is the aisle on which the product resides
|
|
2006
|
+
if the product belongs on an end cap use the endcap here as
|
|
2007
|
+
well. endcaps are numbered 0+=1 from left to right of the store
|
|
2008
|
+
front. the same is true for aisle. if the product resides on an
|
|
2009
|
+
end cap, append FEC (0FEC) to signify front end cap 0, or 0REC for
|
|
2010
|
+
rear end cap 0.
|
|
2011
|
+
0 -> on aisle 0
|
|
2012
|
+
0,1 -> on aisle 0 and 1
|
|
2013
|
+
0-2 -> from aisle 0 to aisle 2
|
|
2014
|
+
|
|
2015
|
+
encaps on the front side of the aisle will have an FEC Appended to its number
|
|
2016
|
+
The same is true for rear of the aisle(REC). if a encap range is used, the character
|
|
2017
|
+
will identify its side of the store. if two encaps on opposite sides of the store
|
|
2018
|
+
are specified, then use 2 separate ranges; one for front and one for the rear.
|
|
2019
|
+
0FEC -> on front endcap 0
|
|
2020
|
+
0FEC,1REC -> on front endcap 0 and on rear endcap 1.
|
|
2021
|
+
0-2FEC -> from front endcap 0 to front endcap 2
|
|
2022
|
+
0-2REC -> from rear endcap 0 to rear endcap 2
|
|
2023
|
+
0-2FEC,0-2REC -> from front endcap 0 to front endcap 2 && from rear endcap 0 to rear endcap 2
|
|
2024
|
+
|
|
2025
|
+
if No number is provided, but a common NAME is used, use that here for this section of the location.
|
|
2026
|
+
{Fore.orange_red_1}Valid 'Bay[s]/AisleDepth':{Fore.grey_85}
|
|
2027
|
+
This is How many shelf bays deep from the front of the store
|
|
2028
|
+
to the back, where 0 is the first bay from the endcap at the
|
|
2029
|
+
front of the store and increments upwards to the rear end cap.
|
|
2030
|
+
Bays on the right side of the aisle will have an R Appended to its number
|
|
2031
|
+
The same is true for left of the aisle. if a bay range is used, the character
|
|
2032
|
+
will identify its side of the aisle. if two bays on opposite sides of the aisle
|
|
2033
|
+
are specified, then use 2 separate ranges; one for left and one for right.
|
|
2034
|
+
0 -> on bay 0
|
|
2035
|
+
0,1 -> on bay 0 and 1
|
|
2036
|
+
0-2R -> from bay 0 to bay 2 on the right side of the aisle
|
|
2037
|
+
0-2L -> from bay 0 to bay 2 on the left side of the aisle
|
|
2038
|
+
0-2R,0-2L -> from bay 0 to bay 2 on the right side of the aisle && from bay 0 to bay 2 on the left side of the aisle.
|
|
2039
|
+
|
|
2040
|
+
if No number is provided, but a common NAME is used, use that here for this section of the location.
|
|
2041
|
+
{Fore.orange_red_1}Valid Shel[f,ves]:{Fore.grey_85}
|
|
2042
|
+
this is the height where the product is on the shelf
|
|
2043
|
+
shelves are number 0 to their highest from bottom to top
|
|
2044
|
+
where the very bottom shelf is 0, and the next following shelf upwards is
|
|
2045
|
+
1, and so on.
|
|
2046
|
+
0 -> on shelf 0
|
|
2047
|
+
0,1 -> on shelf 0 and 1
|
|
2048
|
+
0-2 -> from shelf 0 to shelf 2
|
|
2049
|
+
|
|
2050
|
+
if No number is provided, but a common NAME is used, use that here for this section of the location.
|
|
2051
|
+
{Fore.light_green}Aisle or EndCap{Fore.light_red}/{Fore.light_yellow}Depth or Bay in Aisle{Fore.light_red}/{Fore.light_steel_blue}Shelf or Location Number(s) Where Item Resides [optional]{Style.reset}
|
|
2052
|
+
{Fore.light_green}A completely Valid Example is Aisle 0|Household Chemicals|Kitchen Care, which is where Dawn Dish Detergent is normally located.
|
|
2053
|
+
{Fore.light_red}{os.get_terminal_size().columns*'/'}
|
|
2054
|
+
"""
|
|
2055
|
+
fb=FormBuilder(data=fields,passThruText=passThruText)
|
|
2056
|
+
if fb is None:
|
|
2057
|
+
return
|
|
2058
|
+
if fb['Shel[f,ves]'] not in ['',]:
|
|
2059
|
+
fb['Shel[f,ves]']=f"{DELCHAR}{fb['Shel[f,ves]']}"
|
|
2060
|
+
locationString=f"{fb['Aisle[s]']}{DELCHAR}{fb['Bay[s]/AisleDepth']}{fb['Shel[f,ves]']}"
|
|
2061
|
+
return locationString
|
|
2062
|
+
|
|
2063
|
+
def BackroomLocation():
|
|
2064
|
+
fields=OrderedDict({
|
|
2065
|
+
'moduleType':{
|
|
2066
|
+
'default':'',
|
|
2067
|
+
'type':'string',
|
|
2068
|
+
},
|
|
2069
|
+
'moduleNumberRange':{
|
|
2070
|
+
'default':'',
|
|
2071
|
+
'type':'string',
|
|
2072
|
+
},
|
|
2073
|
+
'caseID':{
|
|
2074
|
+
'default':'',
|
|
2075
|
+
'type':'string',
|
|
2076
|
+
},
|
|
2077
|
+
|
|
2078
|
+
})
|
|
2079
|
+
passThruText=f'''
|
|
2080
|
+
{Fore.orange_red_1}Valid ModuleTypes:{Fore.grey_85}
|
|
2081
|
+
this what to look on for where the product is stored
|
|
2082
|
+
s or S -> For Pallet/Platform [General]/Skid
|
|
2083
|
+
u or U -> For U-Boat/Size Wheeler
|
|
2084
|
+
rc or rC or Rc or RC -> for RotaCart
|
|
2085
|
+
sc or sC or Sc or SC -> Shopping Cart
|
|
2086
|
+
if a name is used, or common identifier is used, use that here in this segment of the location.
|
|
2087
|
+
|
|
2088
|
+
{Fore.orange_red_1}Valid ModuleNumberRange:{Fore.grey_85}
|
|
2089
|
+
This which of the what's contains said item.
|
|
2090
|
+
0 -> on which 0
|
|
2091
|
+
0,1 -> on which 0 and which 1
|
|
2092
|
+
0-2 -> from which 0 to which 2 on the left side of the aisle
|
|
2093
|
+
if a name is used, or common identifier is used, use that here in this segment of the location.
|
|
2094
|
+
{Fore.orange_red_1}Valid caseID:{Fore.grey_85}
|
|
2095
|
+
This is the case where the item is stored in which is the which found on the what.
|
|
2096
|
+
anything that you want as long as it is unique to the module in which it is stored.
|
|
2097
|
+
try using the following cmds for something on the fly.
|
|
2098
|
+
nanoid - nanoid
|
|
2099
|
+
crbc - checked random barcode
|
|
2100
|
+
dsur - generate a datestring
|
|
2101
|
+
urid - generate reciept id with a log
|
|
2102
|
+
cruid - checked uuid
|
|
2103
|
+
if a name is used, or common identifier is used, use that here in this segment of the location.
|
|
2104
|
+
{Fore.light_red}{os.get_terminal_size().columns*'/'}
|
|
2105
|
+
|
|
2106
|
+
'''
|
|
2107
|
+
fb=FormBuilder(data=fields,passThruText=passThruText)
|
|
2108
|
+
if fb is None:
|
|
2109
|
+
return
|
|
2110
|
+
if fb['caseID'] not in ['',]:
|
|
2111
|
+
fb['caseID']=f"{DELCHAR}{fb['caseID']}"
|
|
2112
|
+
locationString=f"{fb['moduleType']}{DELCHAR}{fb['moduleNumberRange']}{' '.join(db.stre(fb['caseID'])/3)}"
|
|
2113
|
+
return locationString
|