radboy 0.0.543__py3-none-any.whl → 0.0.545__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/DB/Prompt.py CHANGED
@@ -56,7 +56,9 @@ def std_colorize(m,n,c,start=f"[Prompt]{Back.black}{Fore.pale_turquoise_1} Start
56
56
  else:
57
57
  msg=f'{start}{Fore.light_cyan}{n}/{Fore.green_yellow}{n+1}{Fore.orange_red_1} of {c} {Fore.light_salmon_1}{m}{Style.reset}{end}'
58
58
  return msg
59
-
59
+ '''Formula/Price menu options'''
60
+ PRICE=['quick price','qprc','price','prc']
61
+ FMLA=['fmlau','formulae-u','pre-formula','formulas']
60
62
  def timedout(ptext,htext='',timeout_returnable="timeout"):
61
63
  try:
62
64
  while True:
@@ -2261,7 +2263,8 @@ CMD's are not final until ended with {Fore.magenta}{hw_delim}{Style.reset}""")
2261
2263
  {Fore.grey_70}**{Fore.light_green}'codify','format code','fcode'{Fore.light_steel_blue} Format input text to look '{db.Entry.cfmt(None,"TESTTEXT")}{Style.reset}'
2262
2264
  {Fore.grey_70}**{Fore.light_green}'upcify str','upcify.str','upcify-str','format upc str','fupcs'{Fore.light_steel_blue} Format input text to look and use formatted text as input-text'{db.Entry.rebar(None,"TESTTEXTUPCA")}{Style.reset}'
2263
2265
  {Fore.grey_70}**{Fore.light_green}'codify str','codify.str','codify-str','format code str','fcodes'{Fore.light_steel_blue} Format input text to look and use formatted text as input-text'{db.Entry.cfmt(None,"TESTTEXT")}{Style.reset}'
2264
- {Fore.grey_70}**{Fore.light_green}'quick price','qprc','price'{Fore.light_steel_blue} Calculate price information using user provided data for an arbitrary product who Data is not in the Entry table{Style.reset}
2266
+ {Fore.grey_70}**{Fore.light_green}{PRICE}{Fore.light_steel_blue} Calculate price information using user provided data for an arbitrary product who Data is not in the Entry table{Style.reset}
2267
+ {Fore.grey_70}**{Fore.light_green}{FMLA}{Fore.light_steel_blue} use some pre-built formulas for returning values to the prompt{Style.reset}
2265
2268
  {Fore.grey_70}**{Fore.light_green}'mksl','make shopping list','p-slq','prompt slq','set list qty','slqp','slq-p'{Fore.light_steel_blue} make a list using {Fore.green_3a}slq{Fore.light_steel_blue} from {Fore.orange_red_1}Tasks.{Fore.light_red}TasksMode{Style.reset}
2266
2269
  {Fore.grey_70}**{Fore.light_green}'ic2oc','input code to output code'{Fore.light_steel_blue} Convert an input code to its neighboring format for view or input use{Style.reset}
2267
2270
  {Fore.grey_70}**{Fore.light_green}'uniq-rcpt-id','uniq rcpt id','unique_reciept_id','urid','unique reciept id','unique-reciept-id'{Fore.light_steel_blue} Generate Relavent Receipt Id to be searchable in DayLogger{Style.reset}
@@ -2608,15 +2611,22 @@ degress fahrenheite - degF
2608
2611
  return func(result,data)
2609
2612
  elif cmd.lower() in ["bldls","build","buildls","build list","bld ls",'lsbld','list build','ls bld','bld']:
2610
2613
  bldls()
2611
- elif cmd.lower() in ['quick price','qprc','price']:
2612
- t=TM.Tasks.pricing(None)
2614
+ elif cmd.lower() in PRICE:
2615
+ t=TM.Tasks.TasksMode(parent=self,engine=db.ENGINE,init_only=True).pricing()
2616
+ if t is not None:
2617
+ print("returned")
2618
+ try:
2619
+ return func(str(t),data)
2620
+ except:
2621
+ return func(t,data)
2622
+ elif cmd.lower() in FMLA:
2623
+ t=TM.Tasks.TasksMode(parent=self,engine=db.ENGINE,init_only=True).formulaeu()
2613
2624
  if t is not None:
2614
2625
  print("returned")
2615
2626
  try:
2616
2627
  return func(str(t),data)
2617
2628
  except:
2618
2629
  return func(t,data)
2619
-
2620
2630
  elif cmd.lower() in ["bldlse","builde","buildlse","build list export ","bld ls exp",'elsbld','export list build','exp ls bld','ebld']:
2621
2631
  bldls(bldlse=True)
2622
2632
  elif cmd.lower() in ['sbld','search build','search_build','scan build','scan_bld']:
Binary file
radboy/DB/db.py CHANGED
@@ -32,10 +32,18 @@ import platform
32
32
  from uuid import uuid1
33
33
  import sys
34
34
  from inputimeout import inputimeout, TimeoutOccurred
35
- class iList(list):
36
- pass
37
35
 
38
- instance_list=iList()
36
+ def textInFile(text):
37
+ '''textInFile(str) -> Boolean
38
+
39
+ return True if text in file
40
+ return False if text not in file.
41
+ '''
42
+ with open(BooleanAnswers.IllegalCharsManifest,"r") as o:
43
+ for line in o.readlines():
44
+ if text in line:
45
+ return True
46
+ return False
39
47
 
40
48
  def remove_illegals(text):
41
49
  try:
@@ -44,15 +52,16 @@ def remove_illegals(text):
44
52
  iis=['*','/','\\','?','[',']',':',"\""]
45
53
  for i in iis:
46
54
  text=text.replace(i,f' BCO_UC_{ord(i)} ')
47
- if i not in instance_list:
48
- instance_list.append(i)
49
- output.write(f"BCO_UC_{ord(i)} = {i}\n")
55
+ msg=f"BCO_UC_{ord(i)} = {i}"
56
+ if not textInFile(msg):
57
+ output.write(msg+"\n")
50
58
  return text
51
59
  else:
52
60
  return text
53
61
 
54
62
  except Exception as e:
55
63
  print(e)
64
+ exit()
56
65
 
57
66
 
58
67
  def strip_colors(colored_text):
@@ -815,7 +815,7 @@ class HealthLogUi:
815
815
  'exec':lambda self=self:self.export_log_field(fields=['BloodSugar','BloodSugarUnitName','LongActingInsulinName','LongActingInsulinTaken','LongActingInsulinUnitName','ShortActingInsulinName','ShortActingInsulinTaken','ShortActingInsulinUnitName','HeartRate','HeartRateUnitName','DrugConsumed','DrugQtyConsumed','DrugQtyConsumedUnitName','CarboHydrateIntake','CarboHydrateIntakeUnitName','Comments',],not_none=['Comments',])
816
816
  },
817
817
  'xpt consumed':{
818
- 'cmds':['xptfd','xpt fd','xpt food','lfd','xpt fuel','xpt fl','xlfl'],
818
+ 'cmds':['xptfd','xpt fd','xpt food','xpt-fd','xpt fuel','xpt fl','xlfl'],
819
819
  'desc':'export food',
820
820
  'exec':lambda self=self:self.export_log_field(
821
821
  fields=["EntryBarcode",
radboy/TasksMode/Tasks.py CHANGED
@@ -288,445 +288,537 @@ def td(time_string):
288
288
  def save(value):
289
289
  detectGetOrSet("InLineResult",value,setValue=True,literal=True)
290
290
 
291
- def pricing(self):
292
- #needs to be refactored
293
-
294
- while True:
295
- try:
296
- default_taxrate=Decimal(detectGetOrSet("Tax Rate",0.0925,setValue=False,literal=True))
297
- default_price=Decimal(detectGetOrSet("pricing default price",1,setValue=False,literal=True))
298
- default_bottle_qty=Decimal(detectGetOrSet("pricing default bottle_qty",1,setValue=False,literal=True))
299
- default_bottle_size=Decimal(detectGetOrSet("pricing default bottle_size",16.9,setValue=False,literal=True))
300
- default_purchased_qty=Decimal(detectGetOrSet("pricing default purchased_qty",1,setValue=False,literal=True))
301
- defaults_msg=f"""
302
- {Fore.orange_red_1}Default Settings [changeable under sysset]{Style.reset}
303
- {Fore.light_sea_green}default_taxrate=={Fore.turquoise_4}{default_taxrate},
304
- {Fore.grey_70}default_price=={Fore.light_yellow}{default_price},
305
- {Fore.light_sea_green}default_bottle_qty=={Fore.turquoise_4}{default_bottle_qty},
306
- {Fore.grey_70}default_bottle_size=={Fore.light_yellow}{default_bottle_size},
307
- {Fore.light_sea_green}default_purchased_qty=={Fore.turquoise_4}{default_purchased_qty}
308
- {Style.reset}"""
309
- def timedecimal_to_ampm():
310
- dayHours=Prompt.__init2__(None,func=FormBuilderMkText,ptext="How many hours in a day?: ",helpText="how many hours make a day? default is 24 ",data="dec.dec")
311
- if dayHours is None:
312
- return
313
- elif dayHours in ['d',]:
314
- dayHours=Decimal('24')
315
- halfday=dayHours/2
291
+ class Formulae:
292
+ def __init__(self):
293
+ pass
294
+ def formulaeu(self):
295
+ while True:
296
+ try:
297
+ def timedecimal_to_ampm():
298
+ dayHours=Prompt.__init2__(None,func=FormBuilderMkText,ptext="How many hours in a day?: ",helpText="how many hours make a day? default is 24 ",data="dec.dec")
299
+ if dayHours is None:
300
+ return
301
+ elif dayHours in ['d',]:
302
+ dayHours=Decimal('24')
303
+ halfday=dayHours/2
316
304
 
317
- result=None
318
- time_Dec=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Time Decimal: ",helpText="time of day as a decimal to convert to 12H ",data="dec.dec")
319
- if time_Dec is None:
320
- return
321
- elif time_Dec in ['d',]:
322
- time_Dec=0.0
323
- ampm='am'
324
- if time_Dec >= 0 and time_Dec <= dayHours:
325
- if time_Dec <= halfday:
326
- hours=int(time_Dec)
327
- else:
328
- hours=int(time_Dec-halfday)
329
- ampm='pm'
330
- minutes=time_Dec-int(time_Dec)
331
-
305
+ result=None
306
+ time_Dec=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Time Decimal: ",helpText="time of day as a decimal to convert to 12H ",data="dec.dec")
307
+ if time_Dec is None:
308
+ return
309
+ elif time_Dec in ['d',]:
310
+ time_Dec=0.0
311
+ ampm='am'
312
+ if time_Dec >= 0 and time_Dec <= dayHours:
313
+ if time_Dec <= halfday:
314
+ hours=int(time_Dec)
315
+ else:
316
+ hours=int(time_Dec-halfday)
317
+ ampm='pm'
318
+ minutes=time_Dec-int(time_Dec)
319
+
320
+ try:
321
+ minutes=int(minutes*60)
322
+ except Exception as e:
323
+ print(e)
324
+ minutes=0
325
+ result=f"{hours}[12H]/{int(time_Dec)}[24]:{minutes} {ampm}"
326
+
327
+ return result
328
+ return result
329
+
330
+ def invert_value():
331
+ result=None
332
+ value=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Value to Invert: ",helpText="make user provided value, or formula negative (value*-1='-value')",data="dec.dec")
333
+ if value is None:
334
+ return
335
+ elif value in ['d',]:
336
+ value=0
337
+ result=value*-1
338
+ return result
339
+
340
+ options={
341
+ f'{uuid1()}':{
342
+ 'cmds':['invert','-value','iv-val'],
343
+ 'desc':f'{Fore.light_yellow}value{Fore.medium_violet_red}is multiplied by -1 to make inverse{Style.reset}',
344
+ 'exec':invert_value
345
+ },
346
+ f'{uuid1()}':{
347
+ 'cmds':['time dec to clock','t2c','time to clock'],
348
+ 'desc':f'{Fore.light_yellow}value{Fore.medium_violet_red}convert decimal time to clock time{Style.reset}',
349
+ 'exec':timedecimal_to_ampm
350
+ },
351
+ }
352
+ defaults_msg=f'''
353
+ '''
354
+ for num,i in enumerate(options):
355
+ options[i]['cmds'].append(str(num))
356
+
357
+ while True:
358
+ helpText=[]
359
+ for i in options:
360
+ msg=f"{Fore.light_green}{options[i]['cmds']}{Fore.light_red} -> {options[i]['desc']}{Style.reset}"
361
+ helpText.append(msg)
362
+ helpText='\n'.join(helpText)
363
+ print(helpText)
364
+ print(defaults_msg)
365
+ cmd=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Quick Formulas|Do What?:",helpText=helpText,data="string")
366
+ if cmd is None:
367
+ return None
368
+ result=None
369
+ for i in options:
370
+ els=[ii.lower() for ii in options[i]['cmds']]
371
+ if cmd.lower() in els:
372
+ result=options[i]['exec']()
373
+ break
374
+ print(f"{result}")
375
+ returnResult=Prompt.__init2__(None,func=FormBuilderMkText,ptext="[Formula] Return Result?[y/n]",helpText=f"result to return is '{result}'",data="boolean")
376
+ if returnResult in [True,]:
377
+ if result is None:
378
+ return None
379
+ else:
380
+ returnTypes=["float","Decimal","string","string"]
381
+ returnActor=[lambda x:round(float(x),4),lambda x:Decimal(x).quantize(Decimal("0.0000")),lambda x: f"{x:.4f}",lambda x:str(x)]
382
+ ct=len(returnTypes)
383
+ returnType=None
384
+ htext=[]
385
+ strOnly=False
386
+ for num,i in enumerate(returnTypes):
387
+ try:
388
+ htext.append(std_colorize(f"{i} - {returnActor[num](result)} ",num,ct))
389
+ except Exception as e:
390
+ strOnly=True
391
+ print(e)
392
+ htext='\n'.join(htext)
393
+ while returnType not in range(0,ct+1):
394
+ print(htext)
395
+ returnType=Prompt.__init2__(self,func=FormBuilderMkText,ptext="Return the value as?",helpText=f"{htext}\nwhich index?",data="integer")
396
+ if returnType is None:
397
+ return None
398
+ elif returnType in ['d',]:
399
+ if not strOnly:
400
+ returnType=1
401
+ else:
402
+ returnType=-1
403
+ break
404
+ #return str(result)
405
+ try:
406
+ if returnTypes[returnType] == 'float':
407
+ try:
408
+ return returnActor[returnType](result)
409
+ except Exception as e:
410
+ print(e)
411
+ continue
412
+ elif returnTypes[returnType] == 'Decimal':
413
+ try:
414
+ return returnActor[returnType](result)
415
+ except Exception as e:
416
+ print(e)
417
+ continue
418
+ elif returnTypes[returnType] == 'string':
419
+ try:
420
+ return returnActor[returnType](result)
421
+ except Exception as e:
422
+ print(e)
423
+ continue
424
+ else:
425
+ return result
426
+ except Exception as e:
427
+ print(e)
428
+ print("returning as a string")
429
+ return result
430
+ return result
431
+ except Exception as e:
432
+ print(e,str(e),repr(e))
433
+ return None
434
+
435
+
436
+ def pricing(self):
437
+ """Price and Formulas whose values can be returned to the Prompt."""
438
+ while True:
439
+ try:
440
+ default_taxrate=Decimal(detectGetOrSet("Tax Rate",0.0925,setValue=False,literal=True))
441
+ default_price=Decimal(detectGetOrSet("pricing default price",1,setValue=False,literal=True))
442
+ default_bottle_qty=Decimal(detectGetOrSet("pricing default bottle_qty",1,setValue=False,literal=True))
443
+ default_bottle_size=Decimal(detectGetOrSet("pricing default bottle_size",16.9,setValue=False,literal=True))
444
+ default_purchased_qty=Decimal(detectGetOrSet("pricing default purchased_qty",1,setValue=False,literal=True))
445
+ defaults_msg=f"""
446
+ {Fore.orange_red_1}Default Settings [changeable under sysset]{Style.reset}
447
+ {Fore.light_sea_green}default_taxrate=={Fore.turquoise_4}{default_taxrate},
448
+ {Fore.grey_70}default_price=={Fore.light_yellow}{default_price},
449
+ {Fore.light_sea_green}default_bottle_qty=={Fore.turquoise_4}{default_bottle_qty},
450
+ {Fore.grey_70}default_bottle_size=={Fore.light_yellow}{default_bottle_size},
451
+ {Fore.light_sea_green}default_purchased_qty=={Fore.turquoise_4}{default_purchased_qty}
452
+ {Style.reset}"""
453
+
454
+ def tax_rate_decimal():
455
+ result=None
456
+ tax_percent=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Tax Rate Percent: ",helpText="percent to convert to decimal (Percent/100=Rate)",data="dec.dec")
457
+ if tax_percent is None:
458
+ return
459
+ elif tax_percent in ['d',]:
460
+ tax_percent=default_taxrate/100
461
+ result=tax_percent/100
462
+ return result
463
+
464
+ def beverage_PTCRV_base():
465
+ result=None
466
+ print('Beverage Total Price+Tax+CRV of Size')
467
+ price=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Price ($)(default={default_price}):",helpText="A float or integer",data="float")
468
+ if price is None:
469
+ return None
470
+ elif price in ['','d']:
471
+ price=default_price
472
+
473
+
474
+ bottle_size=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Size in FlOz(or eqivalent,oz assumed if not specified({default_bottle_size})):",helpText="a value plus its unit",data="string")
475
+ if bottle_size is None:
476
+ return None
477
+ elif bottle_size in ['d',]:
478
+ bottle_size=default_bottle_size
332
479
  try:
333
- minutes=int(minutes*60)
480
+ bts=float(bottle_size)
481
+ bottle_size=f"{bts} floz"
334
482
  except Exception as e:
335
483
  print(e)
336
- minutes=0
337
- result=f"{hours}[12H]/{int(time_Dec)}[24]:{minutes} {ampm}"
338
-
484
+ x=pint.UnitRegistry()
485
+ xx=x(bottle_size)
486
+ xxx=xx.to("floz")
487
+ bottle_qty=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Qty Of Containers({default_bottle_qty}):",helpText="A float or integer",data="float")
488
+ if bottle_qty is None:
489
+ return None
490
+ elif bottle_qty in ['d',]:
491
+ bottle_qty=default_bottle_qty
492
+
493
+ if xxx.magnitude < 24:
494
+ crv=float(Decimal(0.05)*Decimal(bottle_qty))
495
+ else:
496
+ crv=float(Decimal(0.10)*Decimal(bottle_qty))
497
+
498
+ tax_rate=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Tax Rate (0.01==1%(Default={default_taxrate})):",helpText="A float or integer",data="float")
499
+ if tax_rate is None:
500
+ return None
501
+ elif tax_rate == 'd':
502
+ tax_rate=default_taxrate
503
+
504
+ purchased_qty=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Qty purchased({default_purchased_qty})?",helpText=f"how much is being purchased for {price}",data="float")
505
+ if purchased_qty is None:
506
+ return None
507
+ elif purchased_qty in ['d',]:
508
+ purchased_qty=default_purchased_qty
509
+
510
+ price=(Decimal(price)*Decimal(purchased_qty))+Decimal(crv)
511
+ tax=price*Decimal(tax_rate)
512
+
513
+
514
+ result=round(float(Decimal(price)+tax),prec)
339
515
  return result
340
- return result
341
516
 
342
- def tax_rate_decimal():
343
- result=None
344
- tax_percent=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Tax Rate Percent: ",helpText="percent to convert to decimal (Percent/100=Rate)",data="dec.dec")
345
- if tax_percent is None:
346
- return
347
- elif tax_percent in ['d',]:
348
- tax_percent=default_taxrate/100
349
- result=tax_percent/100
350
- return result
517
+ def tax_with_crv():
518
+ result=None
519
+ print('Tax+CRV of Size')
520
+ price=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Price ($({default_price})):",helpText="A float or integer",data="float")
521
+ if price is None:
522
+ return None
523
+ elif price in ['','d']:
524
+ price=default_price
351
525
 
352
- def invert_value():
353
- result=None
354
- value=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Value to Invert: ",helpText="make user provided value, or formula negative (value*-1='-value')",data="dec.dec")
355
- if value is None:
356
- return
357
- elif value in ['d',]:
358
- value=0
359
- result=value*-1
360
- return result
361
526
 
362
- def beverage_PTCRV_base():
363
- result=None
364
- print('Beverage Total Price+Tax+CRV of Size')
365
- price=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Price ($)(default={default_price}):",helpText="A float or integer",data="float")
366
- if price is None:
367
- return None
368
- elif price in ['','d']:
369
- price=default_price
370
-
371
-
372
- bottle_size=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Size in FlOz(or eqivalent,oz assumed if not specified({default_bottle_size})):",helpText="a value plus its unit",data="string")
373
- if bottle_size is None:
374
- return None
375
- elif bottle_size in ['d',]:
376
- bottle_size=default_bottle_size
377
- try:
378
- bts=float(bottle_size)
379
- bottle_size=f"{bts} floz"
380
- except Exception as e:
381
- print(e)
382
- x=pint.UnitRegistry()
383
- xx=x(bottle_size)
384
- xxx=xx.to("floz")
385
- bottle_qty=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Qty Of Containers({default_bottle_qty}):",helpText="A float or integer",data="float")
386
- if bottle_qty is None:
387
- return None
388
- elif bottle_qty in ['d',]:
389
- bottle_qty=default_bottle_qty
390
-
391
- if xxx.magnitude < 24:
392
- crv=float(Decimal(0.05)*Decimal(bottle_qty))
393
- else:
394
- crv=float(Decimal(0.10)*Decimal(bottle_qty))
527
+ bottle_size=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Size in FlOz(or eqivalent,oz assumed if not specified({default_bottle_size})):",helpText="a value plus its unit",data="string")
528
+ if bottle_size is None:
529
+ return None
530
+ elif bottle_size in ['d',]:
531
+ bottle_size=default_bottle_size
532
+ try:
533
+ bts=float(bottle_size)
534
+ bottle_size=f"{bts} floz"
535
+ except Exception as e:
536
+ print(e)
537
+ x=pint.UnitRegistry()
538
+ xx=x(bottle_size)
539
+ xxx=xx.to("floz")
540
+ bottle_qty=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Qty Of Containers({default_bottle_qty}):",helpText="A float or integer",data="float")
541
+ if bottle_qty is None:
542
+ return None
543
+ elif bottle_qty in ['d',]:
544
+ bottle_qty=default_bottle_qty
395
545
 
396
- tax_rate=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Tax Rate (0.01==1%(Default={default_taxrate})):",helpText="A float or integer",data="float")
397
- if tax_rate is None:
398
- return None
399
- elif tax_rate == 'd':
400
- tax_rate=default_taxrate
546
+ if xxx.magnitude < 24:
547
+ crv=Decimal(0.05)*Decimal(bottle_qty)
548
+ else:
549
+ crv=Decimal(0.10)*Decimal(bottle_qty)
401
550
 
402
- purchased_qty=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Qty purchased({default_purchased_qty})?",helpText=f"how much is being purchased for {price}",data="float")
403
- if purchased_qty is None:
404
- return None
405
- elif purchased_qty in ['d',]:
406
- purchased_qty=default_purchased_qty
551
+ tax_rate=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Tax Rate (0.01==1%(Default={default_taxrate})):",helpText="A float or integer",data="float")
552
+ if tax_rate is None:
553
+ return None
554
+ elif tax_rate == 'd':
555
+ tax_rate=default_taxrate
407
556
 
408
- price=(Decimal(price)*Decimal(purchased_qty))+Decimal(crv)
409
- tax=price*Decimal(tax_rate)
557
+ purchased_qty=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Qty purchased({default_purchased_qty})?",helpText=f"how much is being purchased for {price}",data="float")
558
+ if purchased_qty is None:
559
+ return None
560
+ elif purchased_qty in ['d',]:
561
+ purchased_qty=default_purchased_qty
410
562
 
563
+ price=(Decimal(price)*Decimal(purchased_qty))+crv
564
+ tax=price*Decimal(tax_rate)
411
565
 
412
- result=round(float(Decimal(price)+tax),prec)
413
- return result
566
+ result=tax
567
+ return result
414
568
 
415
- def tax_with_crv():
416
- result=None
417
- print('Tax+CRV of Size')
418
- price=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Price ($({default_price})):",helpText="A float or integer",data="float")
419
- if price is None:
420
- return None
421
- elif price in ['','d']:
422
- price=default_price
423
-
424
-
425
- bottle_size=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Size in FlOz(or eqivalent,oz assumed if not specified({default_bottle_size})):",helpText="a value plus its unit",data="string")
426
- if bottle_size is None:
427
- return None
428
- elif bottle_size in ['d',]:
429
- bottle_size=default_bottle_size
430
- try:
431
- bts=float(bottle_size)
432
- bottle_size=f"{bts} floz"
433
- except Exception as e:
434
- print(e)
435
- x=pint.UnitRegistry()
436
- xx=x(bottle_size)
437
- xxx=xx.to("floz")
438
- bottle_qty=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Qty Of Containers({default_bottle_qty}):",helpText="A float or integer",data="float")
439
- if bottle_qty is None:
440
- return None
441
- elif bottle_qty in ['d',]:
442
- bottle_qty=default_bottle_qty
443
-
444
- if xxx.magnitude < 24:
445
- crv=Decimal(0.05)*Decimal(bottle_qty)
446
- else:
447
- crv=Decimal(0.10)*Decimal(bottle_qty)
569
+ def crv_total():
570
+ result=None
571
+ print('Total CRV for Qty of Size')
572
+ bottle_size=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Size in FlOz(or eqivalent,oz assumed if not specified({default_bottle_size})):",helpText="a value plus its unit",data="string")
573
+ if bottle_size is None:
574
+ return None
575
+ elif bottle_size in ['d',]:
576
+ bottle_size=default_bottle_size
577
+ try:
578
+ bts=float(bottle_size)
579
+ bottle_size=f"{bts} floz"
580
+ except Exception as e:
581
+ print(e)
582
+ x=pint.UnitRegistry()
583
+ xx=x(bottle_size)
584
+ xxx=xx.to("floz")
585
+ bottle_qty=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Qty Of Containers({default_bottle_qty}):",helpText="A float or integer",data="float")
586
+ if bottle_qty is None:
587
+ return None
588
+ elif bottle_qty in ['d',]:
589
+ bottle_qty=default_bottle_qty
448
590
 
449
- tax_rate=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Tax Rate (0.01==1%(Default={default_taxrate})):",helpText="A float or integer",data="float")
450
- if tax_rate is None:
451
- return None
452
- elif tax_rate == 'd':
453
- tax_rate=default_taxrate
591
+ if xxx.magnitude < 24:
592
+ crv=Decimal(0.05)*Decimal(bottle_qty)
593
+ else:
594
+ crv=Decimal(0.10)*Decimal(bottle_qty)
454
595
 
455
- purchased_qty=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Qty purchased({default_purchased_qty})?",helpText=f"how much is being purchased for {price}",data="float")
456
- if purchased_qty is None:
457
- return None
458
- elif purchased_qty in ['d',]:
459
- purchased_qty=default_purchased_qty
596
+
597
+ result=crv
598
+ return result
460
599
 
461
- price=(Decimal(price)*Decimal(purchased_qty))+crv
462
- tax=price*Decimal(tax_rate)
600
+ def price_tax():
601
+ result=None
602
+ print('Price+Tax')
603
+ price=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Price ($({default_price})):",helpText="A float or integer",data="float")
604
+ if price is None:
605
+ return None
606
+ elif price in ['','d']:
607
+ price=default_price
463
608
 
464
- result=tax
465
- return result
466
609
 
467
- def crv_total():
468
- result=None
469
- print('Total CRV for Qty of Size')
470
- bottle_size=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Size in FlOz(or eqivalent,oz assumed if not specified({default_bottle_size})):",helpText="a value plus its unit",data="string")
471
- if bottle_size is None:
472
- return None
473
- elif bottle_size in ['d',]:
474
- bottle_size=default_bottle_size
475
- try:
476
- bts=float(bottle_size)
477
- bottle_size=f"{bts} floz"
478
- except Exception as e:
479
- print(e)
480
- x=pint.UnitRegistry()
481
- xx=x(bottle_size)
482
- xxx=xx.to("floz")
483
- bottle_qty=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Qty Of Containers({default_bottle_qty}):",helpText="A float or integer",data="float")
484
- if bottle_qty is None:
485
- return None
486
- elif bottle_qty in ['d',]:
487
- bottle_qty=default_bottle_qty
488
-
489
- if xxx.magnitude < 24:
490
- crv=Decimal(0.05)*Decimal(bottle_qty)
491
- else:
492
- crv=Decimal(0.10)*Decimal(bottle_qty)
610
+ bottle_qty=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Qty Of Containers/Product({default_bottle_qty}):",helpText="A float or integer",data="float")
611
+ if bottle_qty is None:
612
+ return None
613
+ elif bottle_qty in ['d',]:
614
+ bottle_qty=default_bottle_qty
493
615
 
494
-
495
- result=crv
496
- return result
616
+ tax_rate=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Tax Rate (0.01==1%(Default={default_taxrate})):",helpText="A float or integer",data="float")
617
+ if tax_rate is None:
618
+ return None
619
+ elif tax_rate == 'd':
620
+ tax_rate=default_taxrate
497
621
 
498
- def price_tax():
499
- result=None
500
- print('Price+Tax')
501
- price=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Price ($({default_price})):",helpText="A float or integer",data="float")
502
- if price is None:
503
- return None
504
- elif price in ['','d']:
505
- price=default_price
622
+ price=Decimal(price)*Decimal(bottle_qty)
623
+ tax=price*Decimal(tax_rate)
506
624
 
625
+ result=(price+tax)
626
+ return result
507
627
 
508
- bottle_qty=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Qty Of Containers/Product({default_bottle_qty}):",helpText="A float or integer",data="float")
509
- if bottle_qty is None:
510
- return None
511
- elif bottle_qty in ['d',]:
512
- bottle_qty=default_bottle_qty
628
+ def tax_no_crv():
629
+ result=None
630
+ print('Tax without CRV')
631
+ price=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Price ($({default_price})):",helpText="A float or integer",data="float")
632
+ if price is None:
633
+ return None
634
+ elif price in ['','d']:
635
+ price=default_price
513
636
 
514
- tax_rate=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Tax Rate (0.01==1%(Default={default_taxrate})):",helpText="A float or integer",data="float")
515
- if tax_rate is None:
516
- return None
517
- elif tax_rate == 'd':
518
- tax_rate=default_taxrate
519
637
 
520
- price=Decimal(price)*Decimal(bottle_qty)
521
- tax=price*Decimal(tax_rate)
638
+ bottle_qty=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Qty Of Containers/Product({default_bottle_qty}):",helpText="A float or integer",data="float")
639
+ if bottle_qty is None:
640
+ return None
641
+ elif bottle_qty in ['d',]:
642
+ bottle_qty=default_bottle_qty
522
643
 
523
- result=(price+tax)
524
- return result
644
+ tax_rate=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Tax Rate (0.01==1%(Default={default_taxrate})):",helpText="A float or integer",data="float")
645
+ if tax_rate is None:
646
+ return None
647
+ elif tax_rate == 'd':
648
+ tax_rate=default_taxrate
525
649
 
526
- def tax_no_crv():
527
- result=None
528
- print('Tax without CRV')
529
- price=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Price ($({default_price})):",helpText="A float or integer",data="float")
530
- if price is None:
531
- return None
532
- elif price in ['','d']:
533
- price=default_price
650
+ price=Decimal(price)*Decimal(bottle_qty)
651
+ tax=price*Decimal(tax_rate)
534
652
 
653
+ result=tax
654
+ return result
535
655
 
536
- bottle_qty=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Qty Of Containers/Product({default_bottle_qty}):",helpText="A float or integer",data="float")
537
- if bottle_qty is None:
538
- return None
539
- elif bottle_qty in ['d',]:
540
- bottle_qty=default_bottle_qty
656
+ def tax_rate_from_priceAndTax():
657
+ result=None
658
+ print('tax_rate_from_priceAndTax()')
659
+ price=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Price ($({default_price})):",helpText="A float or integer",data="float")
660
+ if price is None:
661
+ return None
662
+ elif price in ['','d']:
663
+ price=default_price
541
664
 
542
- tax_rate=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Tax Rate (0.01==1%(Default={default_taxrate})):",helpText="A float or integer",data="float")
543
- if tax_rate is None:
544
- return None
545
- elif tax_rate == 'd':
546
- tax_rate=default_taxrate
547
665
 
548
- price=Decimal(price)*Decimal(bottle_qty)
549
- tax=price*Decimal(tax_rate)
666
+ taxed=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Tax ($) (0.01==1%(Default={0})):",helpText="A float or integer",data="float")
667
+ if taxed is None:
668
+ return None
669
+ elif taxed == 'd':
670
+ taxed=0
550
671
 
551
- result=tax
552
- return result
553
672
 
554
- def tax_rate_from_priceAndTax():
555
- result=None
556
- print('tax_rate_from_priceAndTax()')
557
- price=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Price ($({default_price})):",helpText="A float or integer",data="float")
558
- if price is None:
559
- return None
560
- elif price in ['','d']:
561
- price=default_price
673
+ tax_rate=Decimal(taxed)/Decimal(price)
562
674
 
675
+ result=tax_rate
676
+ return result
563
677
 
564
- taxed=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Tax ($) (0.01==1%(Default={0})):",helpText="A float or integer",data="float")
565
- if taxed is None:
566
- return None
567
- elif taxed == 'd':
568
- taxed=0
678
+ def tax_rate_from_oldPriceAndNewPrice():
679
+ result=None
680
+ print('tax_rate_from_oldPriceAndNewPrice()')
681
+ old_price=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Old Price ($({default_price})):",helpText="A float or integer",data="float")
682
+ if old_price is None:
683
+ return None
684
+ elif old_price in ['','d']:
685
+ old_price=default_price
569
686
 
687
+ new_price=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"New Price ($({default_price})):",helpText="A float or integer",data="float")
688
+ if new_price is None:
689
+ return None
690
+ elif new_price in ['','d']:
691
+ new_price=default_price
570
692
 
571
- tax_rate=Decimal(taxed)/Decimal(price)
693
+ taxed=Decimal(new_price)-Decimal(old_price)
694
+ tax_rate=taxed/Decimal(old_price)
695
+ tax_rate=tax_rate
572
696
 
573
- result=tax_rate
574
- return result
697
+ result=tax_rate
698
+ return result
575
699
 
576
- def tax_rate_from_oldPriceAndNewPrice():
577
- result=None
578
- print('tax_rate_from_oldPriceAndNewPrice()')
579
- old_price=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Old Price ($({default_price})):",helpText="A float or integer",data="float")
580
- if old_price is None:
581
- return None
582
- elif old_price in ['','d']:
583
- old_price=default_price
584
-
585
- new_price=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"New Price ($({default_price})):",helpText="A float or integer",data="float")
586
- if new_price is None:
587
- return None
588
- elif new_price in ['','d']:
589
- new_price=default_price
590
-
591
- taxed=Decimal(new_price)-Decimal(old_price)
592
- tax_rate=taxed/Decimal(old_price)
593
- tax_rate=tax_rate
594
-
595
- result=tax_rate
596
- return result
700
+
701
+ options={
702
+ f'{uuid1()}':{
703
+ 'cmds':['beverage price+tax+CRV','b-ptcrv',],
704
+ 'desc':f'{Fore.light_yellow}beverage Price+Tax+CRV{Fore.medium_violet_red} asking for base questions like bottle size and qty to get total cost with tax{Style.reset}',
705
+ 'exec':beverage_PTCRV_base
706
+ },
707
+ f'{uuid1()}':{
708
+ 'cmds':['price+tax','p+t',],
709
+ 'desc':f'{Fore.light_yellow}Price+Tax{Fore.medium_violet_red} asking questions like price and qty to get total cost with tax{Style.reset}',
710
+ 'exec':price_tax
711
+ },
712
+ f'{uuid1()}':{
713
+ 'cmds':['crvttl','crv total','crvtotal','crv_total',],
714
+ 'desc':f'{Fore.light_yellow}total crv{Fore.medium_violet_red} asking questions like price and qty to get total crv{Style.reset}',
715
+ 'exec':crv_total
716
+ },
717
+ f'{uuid1()}':{
718
+ 'cmds':['tax+crv','t+c','tax crv',],
719
+ 'desc':f'{Fore.light_yellow}tax+crv{Fore.medium_violet_red} asking questions like price and qty to get total crv{Style.reset}',
720
+ 'exec':tax_with_crv
721
+ },
722
+ f'{uuid1()}':{
723
+ 'cmds':['tax','tax no crv','tax 0 crv',],
724
+ 'desc':f'{Fore.light_yellow}tax w/o crv{Fore.medium_violet_red} asking questions like price and qty to get total tax without crv{Style.reset}',
725
+ 'exec':tax_no_crv
726
+ },
727
+ f'{uuid1()}':{
728
+ 'cmds':['trfpt','tax_rate_from_price_and_tax','tax rate from price and tax','taxRateFromPriceAndTax',],
729
+ 'desc':f'{Fore.light_yellow}tax rate{Fore.medium_violet_red} from price and tax as a decimal{Style.reset}',
730
+ 'exec':tax_rate_from_priceAndTax
731
+ },
732
+ f'{uuid1()}':{
733
+ 'cmds':['tax_rate_from_old_price_and_new_price','tax rate from old price and new price','taxRateFromOldPriceAndNewPrice','trfopnp',],
734
+ 'desc':f'{Fore.light_yellow}tax rate{Fore.medium_violet_red} from old price and new price{Style.reset}',
735
+ 'exec':tax_rate_from_oldPriceAndNewPrice
736
+ },
737
+ f'{uuid1()}':{
738
+ 'cmds':['tax decimal','taxdecimal'],
739
+ 'desc':f'{Fore.light_yellow}tax rate decimal{Fore.medium_violet_red} from percent{Style.reset}',
740
+ 'exec':tax_rate_decimal
741
+ },
742
+ }
743
+ for num,i in enumerate(options):
744
+ options[i]['cmds'].append(str(num))
597
745
 
598
-
599
- options={
600
- f'{uuid1()}':{
601
- 'cmds':['beverage price+tax+CRV','b-ptcrv',],
602
- 'desc':f'{Fore.light_yellow}beverage Price+Tax+CRV{Fore.medium_violet_red} asking for base questions like bottle size and qty to get total cost with tax{Style.reset}',
603
- 'exec':beverage_PTCRV_base
604
- },
605
- f'{uuid1()}':{
606
- 'cmds':['price+tax','p+t',],
607
- 'desc':f'{Fore.light_yellow}Price+Tax{Fore.medium_violet_red} asking questions like price and qty to get total cost with tax{Style.reset}',
608
- 'exec':price_tax
609
- },
610
- f'{uuid1()}':{
611
- 'cmds':['crvttl','crv total','crvtotal','crv_total',],
612
- 'desc':f'{Fore.light_yellow}total crv{Fore.medium_violet_red} asking questions like price and qty to get total crv{Style.reset}',
613
- 'exec':crv_total
614
- },
615
- f'{uuid1()}':{
616
- 'cmds':['tax+crv','t+c','tax crv',],
617
- 'desc':f'{Fore.light_yellow}tax+crv{Fore.medium_violet_red} asking questions like price and qty to get total crv{Style.reset}',
618
- 'exec':tax_with_crv
619
- },
620
- f'{uuid1()}':{
621
- 'cmds':['tax','tax no crv','tax 0 crv',],
622
- 'desc':f'{Fore.light_yellow}tax w/o crv{Fore.medium_violet_red} asking questions like price and qty to get total tax without crv{Style.reset}',
623
- 'exec':tax_no_crv
624
- },
625
- f'{uuid1()}':{
626
- 'cmds':['trfpt','tax_rate_from_price_and_tax','tax rate from price and tax','taxRateFromPriceAndTax',],
627
- 'desc':f'{Fore.light_yellow}tax rate{Fore.medium_violet_red} from price and tax as a decimal{Style.reset}',
628
- 'exec':tax_rate_from_priceAndTax
629
- },
630
- f'{uuid1()}':{
631
- 'cmds':['tax_rate_from_old_price_and_new_price','tax rate from old price and new price','taxRateFromOldPriceAndNewPrice','trfopnp',],
632
- 'desc':f'{Fore.light_yellow}tax rate{Fore.medium_violet_red} from old price and new price{Style.reset}',
633
- 'exec':tax_rate_from_oldPriceAndNewPrice
634
- },
635
- f'{uuid1()}':{
636
- 'cmds':['tax decimal','taxdecimal'],
637
- 'desc':f'{Fore.light_yellow}tax rate decimal{Fore.medium_violet_red} from percent{Style.reset}',
638
- 'exec':tax_rate_decimal
639
- },
640
- f'{uuid1()}':{
641
- 'cmds':['invert','-value','iv-val'],
642
- 'desc':f'{Fore.light_yellow}value{Fore.medium_violet_red}is multiplied by -1 to make inverse{Style.reset}',
643
- 'exec':invert_value
644
- },
645
- f'{uuid1()}':{
646
- 'cmds':['time dec to clock','t2c','time to clock'],
647
- 'desc':f'{Fore.light_yellow}value{Fore.medium_violet_red}convert decimal time to clock time{Style.reset}',
648
- 'exec':timedecimal_to_ampm
649
- },
650
- }
651
- for num,i in enumerate(options):
652
- options[i]['cmds'].append(str(num))
653
-
654
- while True:
655
- helpText=[]
656
- for i in options:
657
- msg=f"{Fore.light_green}{options[i]['cmds']}{Fore.light_red} -> {options[i]['desc']}{Style.reset}"
658
- helpText.append(msg)
659
- helpText='\n'.join(helpText)
660
- print(helpText)
661
- print(defaults_msg)
662
- cmd=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Pricing Analisys Tool|Do What?:",helpText=helpText,data="string")
663
- if cmd is None:
664
- return None
665
- result=None
666
- for i in options:
667
- els=[ii.lower() for ii in options[i]['cmds']]
668
- if cmd.lower() in els:
669
- result=options[i]['exec']()
670
- break
671
- print(f"{result}")
672
- returnResult=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Return Result?[y/n]",helpText=f"result to return is '{result}'",data="boolean")
673
- if returnResult in [True,]:
674
- if result is None:
746
+ while True:
747
+ helpText=[]
748
+ for i in options:
749
+ msg=f"{Fore.light_green}{options[i]['cmds']}{Fore.light_red} -> {options[i]['desc']}{Style.reset}"
750
+ helpText.append(msg)
751
+ helpText='\n'.join(helpText)
752
+ print(helpText)
753
+ print(defaults_msg)
754
+ cmd=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Pricing Analisys Tool|Do What?:",helpText=helpText,data="string")
755
+ if cmd is None:
675
756
  return None
676
- else:
677
- returnTypes=["float","Decimal","string","string"]
678
- returnActor=[lambda x:round(float(x),4),lambda x:Decimal(x).quantize(Decimal("0.0000")),lambda x: f"{x:.4f}",lambda x:str(x)]
679
- ct=len(returnTypes)
680
- returnType=None
681
- htext=[]
682
- strOnly=False
683
- for num,i in enumerate(returnTypes):
684
- try:
685
- htext.append(std_colorize(f"{i} - {returnActor[num](result)} ",num,ct))
686
- except Exception as e:
687
- strOnly=True
688
- print(e)
689
- htext='\n'.join(htext)
690
- while returnType not in range(0,ct+1):
691
- print(htext)
692
- returnType=Prompt.__init2__(self,func=FormBuilderMkText,ptext="Return the value as?",helpText=f"{htext}\nwhich index?",data="integer")
693
- if returnType is None:
694
- return None
695
- elif returnType in ['d',]:
696
- if not strOnly:
697
- returnType=1
698
- else:
699
- returnType=-1
700
- break
701
- #return str(result)
702
- try:
703
- if returnTypes[returnType] == 'float':
704
- try:
705
- return returnActor[returnType](result)
706
- except Exception as e:
707
- print(e)
708
- continue
709
- elif returnTypes[returnType] == 'Decimal':
710
- try:
711
- return returnActor[returnType](result)
712
- except Exception as e:
713
- print(e)
714
- continue
715
- elif returnTypes[returnType] == 'string':
757
+ result=None
758
+ for i in options:
759
+ els=[ii.lower() for ii in options[i]['cmds']]
760
+ if cmd.lower() in els:
761
+ result=options[i]['exec']()
762
+ break
763
+ print(f"{result}")
764
+ returnResult=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Return Result?[y/n]",helpText=f"result to return is '{result}'",data="boolean")
765
+ if returnResult in [True,]:
766
+ if result is None:
767
+ return None
768
+ else:
769
+ returnTypes=["float","Decimal","string","string"]
770
+ returnActor=[lambda x:round(float(x),4),lambda x:Decimal(x).quantize(Decimal("0.0000")),lambda x: f"{x:.4f}",lambda x:str(x)]
771
+ ct=len(returnTypes)
772
+ returnType=None
773
+ htext=[]
774
+ strOnly=False
775
+ for num,i in enumerate(returnTypes):
716
776
  try:
717
- return returnActor[returnType](result)
777
+ htext.append(std_colorize(f"{i} - {returnActor[num](result)} ",num,ct))
718
778
  except Exception as e:
779
+ strOnly=True
719
780
  print(e)
720
- continue
721
- else:
781
+ htext='\n'.join(htext)
782
+ while returnType not in range(0,ct+1):
783
+ print(htext)
784
+ returnType=Prompt.__init2__(self,func=FormBuilderMkText,ptext="Return the value as?",helpText=f"{htext}\nwhich index?",data="integer")
785
+ if returnType is None:
786
+ return None
787
+ elif returnType in ['d',]:
788
+ if not strOnly:
789
+ returnType=1
790
+ else:
791
+ returnType=-1
792
+ break
793
+ #return str(result)
794
+ try:
795
+ if returnTypes[returnType] == 'float':
796
+ try:
797
+ return returnActor[returnType](result)
798
+ except Exception as e:
799
+ print(e)
800
+ continue
801
+ elif returnTypes[returnType] == 'Decimal':
802
+ try:
803
+ return returnActor[returnType](result)
804
+ except Exception as e:
805
+ print(e)
806
+ continue
807
+ elif returnTypes[returnType] == 'string':
808
+ try:
809
+ return returnActor[returnType](result)
810
+ except Exception as e:
811
+ print(e)
812
+ continue
813
+ else:
814
+ return result
815
+ except Exception as e:
816
+ print(e)
817
+ print("returning as a string")
722
818
  return result
723
- except Exception as e:
724
- print(e)
725
- print("returning as a string")
726
- return result
727
- return result
728
- except Exception as e:
729
- print(e,str(e),repr(e))
819
+ return result
820
+ except Exception as e:
821
+ print(e,str(e),repr(e))
730
822
 
731
823
  class TasksMode:
732
824
  def set_inList(self):
@@ -937,8 +1029,6 @@ class TasksMode:
937
1029
  else:
938
1030
  return text
939
1031
 
940
- pricing=lambda x:pricing(None)
941
-
942
1032
  Lookup=Lookup2
943
1033
  #extra is for future expansion
944
1034
  def exportList2Excel(self,fields=False,extra=[]):
@@ -4831,6 +4921,9 @@ where:
4831
4921
  msg=f"{tmp}{color1_field}{k}{Style.reset} - {'|'.join([f'{cmd_alter}{i}{Style.reset}' for i in location_fields[k]])}"
4832
4922
  print(msg)
4833
4923
 
4924
+ self.formulae=Formulae()
4925
+ self.formulaeu=self.formulae.formulaeu
4926
+ self.pricing=self.formulae.pricing
4834
4927
  for entry in self.valid_fields:
4835
4928
  self.options[entry]={
4836
4929
  'cmds':["#"+str(count),f"ls {entry}"],
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.543'
1
+ VERSION='0.0.545'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.543
3
+ Version: 0.0.545
4
4
  Summary: A Retail Calculator for Android/Linux
5
5
  Author: Carl Joseph Hirner III
6
6
  Author-email: Carl Hirner III <k.j.hirner.wisdom@gmail.com>
@@ -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=Lt2reA6xchq3U7Y08DvkrHboZ25i1ts7X2E9gSIwcVg,41101
7
7
  radboy/Run.py,sha256=JUoCTHnzQBv7n8PB2_i93ANdAC_iW__RkAge8esCnk4,76
8
- radboy/__init__.py,sha256=pgFcTxr0q_BetEzegmaExXEKS7BrhZhqgQd7PZLy_DU,17
8
+ radboy/__init__.py,sha256=YVm70jtfF9R4IuBFQVwDL-bIJPtkgTDSVJsMZlbMxuE,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
@@ -84,14 +84,14 @@ radboy/DB/ExerciseTracker.py,sha256=OS9i8jGIZPj-6m1bB0-eKNHQ6vf2iv_AYPEc0s4bkBM,
84
84
  radboy/DB/PayDay.py,sha256=H2kPGvBCDkMOz7lbxQhYtUt_oAInpxi37Q6MFrah98I,8710
85
85
  radboy/DB/PayModels.py,sha256=hjwWxP7PL33hmfzQl5YTf0HqzaMxXJxFknPdxFJXJc8,3499
86
86
  radboy/DB/PrintLogging.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
87
- radboy/DB/Prompt.py,sha256=5fwbxVNXwYDuX9s8slOdcnX_ixMOVbmmaVMN41Myv9Y,154476
87
+ radboy/DB/Prompt.py,sha256=WCWuui0xKnIUkflX7XekWlm6PE8U6G1DpKX8BDXhy-s,155135
88
88
  radboy/DB/RandomStringUtil.py,sha256=eZCpR907WStgfbk4Evcghjv9hOkUDXH-iMXIq0-kXq8,24386
89
89
  radboy/DB/ResetTools.py,sha256=RbI-Ua7UlsN0S9qLqtEkTWvzyTZ6R-hHR3CW4NHlUPE,6660
90
90
  radboy/DB/SMLabelImporter.py,sha256=eUoBDxVUUEKGL2g_PwkASM67ZB7FmXtSnn4bCagskhY,4013
91
91
  radboy/DB/__init__.py,sha256=JiigA9B7GalP7YuRdcwyGDu5PDSBahoi0lLjtScxlN8,49
92
92
  radboy/DB/blankDataFile.py,sha256=YX_05Usi71UpDkZN9UTMYwUipbTndTAtEgqzBEga0kE,9285
93
93
  radboy/DB/config.py,sha256=bvu43dUl1_yO3Zq3gsLuenGUgJSiS3S9Cs6ppFEvZbg,239
94
- radboy/DB/db.py,sha256=L18vTws2m2sKsnVf_vgkIxSl1l1MLndVLgq3-tziyWo,250622
94
+ radboy/DB/db.py,sha256=Wci5q6TR9JITNggn8LHAH6ZKYourdAp3Y6KVohUDR6E,250876
95
95
  radboy/DB/glossary_db.py,sha256=1_qxeEpjjEtpWB_eDjsgJisimLv7OBm75MuqM-Lt6zg,28218
96
96
  radboy/DB/masterLookup.py,sha256=DBaM2uscG3_X5dek49wjdnOzhrjWhKgvOEz_umdz0mY,4566
97
97
  radboy/DB/msg.txt,sha256=YxWed6A6tuP1djJ5QPS2Rz3ING4TKKf8kUiCCPtzHXE,7937
@@ -108,7 +108,7 @@ radboy/DB/__pycache__/FormBuilder.cpython-312.pyc,sha256=p1o-5SMRL8OXP_XQ5liUpf-
108
108
  radboy/DB/__pycache__/PrintLogging.cpython-312.pyc,sha256=pIAFqTi6OiQQORSc-oMH1zAbsdH7sY1TifxrN_QOvnU,148
109
109
  radboy/DB/__pycache__/Prompt.cpython-311.pyc,sha256=P2uPRpeqfLFtxieZ0JHBG3X_HZzWUCsFSLb_fpRqky0,6407
110
110
  radboy/DB/__pycache__/Prompt.cpython-312.pyc,sha256=6CcQ1gE2hcz3cKPjo4f6d7xNM2PTDnl8NzQG0Pme5BE,142886
111
- radboy/DB/__pycache__/Prompt.cpython-313.pyc,sha256=UqbcDnIcJtC848VBcX4-Ik3JzzEj_vKlc23dvp_S6HA,235023
111
+ radboy/DB/__pycache__/Prompt.cpython-313.pyc,sha256=6-hov-d3xNlsB35U_aL1cfneJ4-z9FsJltT5ixfFmcg,236020
112
112
  radboy/DB/__pycache__/RandomStringUtil.cpython-312.pyc,sha256=TrbEY89MuLmNlvoo5d8vOE6Dyshh5_EMlTZvk8MDVN4,48597
113
113
  radboy/DB/__pycache__/RandomStringUtil.cpython-313.pyc,sha256=MCcgVwV2Y-9rAY2FVaJZCKcou3HDX70EZudoiCigT0o,49217
114
114
  radboy/DB/__pycache__/ResetTools.cpython-311.pyc,sha256=4Vyc57iAAF0yRPjjglnVKovnTn8OoFIi6Zok3Wpj_YM,9292
@@ -126,7 +126,7 @@ radboy/DB/__pycache__/config.cpython-312.pyc,sha256=Qo7E6MHrF6yqvKgepNFyCoekZXiv
126
126
  radboy/DB/__pycache__/config.cpython-313.pyc,sha256=_8wCIg_3jhyJjxnExD2Sm6aY-uZTw036p7Ki5znL7dc,376
127
127
  radboy/DB/__pycache__/db.cpython-311.pyc,sha256=rNgigyBd0D-cg1JxKAS8t0B_k0IEJivgVlRaZE10Xis,210105
128
128
  radboy/DB/__pycache__/db.cpython-312.pyc,sha256=ANDJPC0RoavbmSKFxG15vC7B4rEGyVt7xRJt7XGY3OA,334609
129
- radboy/DB/__pycache__/db.cpython-313.pyc,sha256=fJCVqPPls2hzUKNsQz0lFdD4ozs7OaihU2n3jE8WYoM,395541
129
+ radboy/DB/__pycache__/db.cpython-313.pyc,sha256=hSUbDU68JPGgQ2IpcYnod4O_It1zx7HrrIG13SqzWV8,395854
130
130
  radboy/DB/__pycache__/glossary_db.cpython-312.pyc,sha256=8UL-29cKqtKovx0BANm6kzKKteef1BW_2qF3wumzst4,36023
131
131
  radboy/DB/__pycache__/glossary_db.cpython-313.pyc,sha256=Ke9bkvllGv5CK0JdT9DRvQ3MOdrXxoYv7TVLNkqLux0,36582
132
132
  radboy/DB/__pycache__/masterLookup.cpython-312.pyc,sha256=bQiOkmMwwHgcO18tYSWGQ-YUff4GQlKVhBMp1GoWAqY,6324
@@ -171,7 +171,7 @@ radboy/ExportList/__pycache__/__init__.cpython-313.pyc,sha256=xitjWDqLahSMr4qux3
171
171
  radboy/ExportUtility/ExportTableClass.py,sha256=QdHeu0j9IzgH6qDUjdZrPAki2s1nMax_PVs405MjzOc,16739
172
172
  radboy/ExportUtility/__init__.py,sha256=cybpF7RcHJkB2V6Fc37B5X2LLUfCtlveVpz8P4nRmo4,902
173
173
  radboy/ExportUtility/__pycache__/ExportTableClass.cpython-312.pyc,sha256=R3crrAJq1SZHaIEskRkNfm1kQ4akcfw8cXK0A8SQcZ8,30267
174
- radboy/ExportUtility/__pycache__/ExportTableClass.cpython-313.pyc,sha256=_fA4OY_mLEpBtMcG8ZpuF4SbHzzeSEEHsVaCfB3jsgY,31740
174
+ radboy/ExportUtility/__pycache__/ExportTableClass.cpython-313.pyc,sha256=Rf1gsH_b5b6wClMjbNuY2kDkmo4j8ndC-vaRpLpwAgk,31740
175
175
  radboy/ExportUtility/__pycache__/__init__.cpython-312.pyc,sha256=acMdux6Y869oA-gpjY0Fem97iQwq9BAGNrW7AEzUnTI,1308
176
176
  radboy/ExportUtility/__pycache__/__init__.cpython-313.pyc,sha256=DrB-8MZCIcENUju5eBxf1tT9Gu5h71rwfayzgm7wx3M,1308
177
177
  radboy/ExtraTools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -209,10 +209,10 @@ radboy/GeoTools/__pycache__/GeoClass.cpython-313.pyc,sha256=eZ6hpLKoic1XCb7BKKg-
209
209
  radboy/GeoTools/__pycache__/OSMClass.cpython-312.pyc,sha256=5RoT8_wiI8R7yb_B9FWIC7mALdGNoqyWtkzsjM2pbh0,40387
210
210
  radboy/GeoTools/__pycache__/__init__.cpython-312.pyc,sha256=Y7Xtrzwm44-xuY_4NK8aDjYfVmXIzUFWOyexJu9le8A,1238
211
211
  radboy/GeoTools/__pycache__/__init__.cpython-313.pyc,sha256=-bk9eEIxWZgHYZHtNJbrpubDRWkbdYNkGr5J7sVhyIE,1238
212
- radboy/HealthLog/HealthLog.py,sha256=KjvGW2RMQta9ycAvDNjbG0iaVHbprXK7O28DPIhyJhk,34169
212
+ radboy/HealthLog/HealthLog.py,sha256=OK4NPcQbIUJHeyJ1H6kWjspkcL_V5n79rUNEWYkGxfQ,34172
213
213
  radboy/HealthLog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
214
214
  radboy/HealthLog/__pycache__/HealthLog.cpython-312.pyc,sha256=hTo4o7jo9L2yqPZgzuKUw_kon_PVcCuTRguELTuLrIo,27946
215
- radboy/HealthLog/__pycache__/HealthLog.cpython-313.pyc,sha256=sM18oZuo7n8VMFm6XOsk88E5NCt_YhGaF9rdYQeKUY8,53283
215
+ radboy/HealthLog/__pycache__/HealthLog.cpython-313.pyc,sha256=KxkqwBgsOZ5rRRIWtwkq8Y0yd-fJcPOa4A2F8AV4diI,53286
216
216
  radboy/HealthLog/__pycache__/__init__.cpython-312.pyc,sha256=yZrYKBk31pGSjCRqmqzpX409iw-muC1zsNO2ObqkGlY,272
217
217
  radboy/HealthLog/__pycache__/__init__.cpython-313.pyc,sha256=cqdZbEJKq9XVoVqDAwsW0pwwBBGSerJNWGlST3YVR3g,151
218
218
  radboy/InListRestore/ILR.py,sha256=s8fbbHLKQSVJX1VaeyGE-vdIUGBEbOPX29kRIG2j2WY,16847
@@ -341,7 +341,7 @@ radboy/SystemSettings/__pycache__/__init__.cpython-312.pyc,sha256=aIzp4Po0t8EhSA
341
341
  radboy/SystemSettings/__pycache__/__init__.cpython-313.pyc,sha256=QFDuoidxMWsGVLsy5lN-rDs6TP8nKJ4yyCyiamNOhwo,156
342
342
  radboy/TasksMode/ReFormula.py,sha256=REDRJYub-OEOE6g14oRQOLOQwv8pHqVJy4NQk3CCM90,2255
343
343
  radboy/TasksMode/SetEntryNEU.py,sha256=Gu0Z677tjpc7-9AQtLbIr7yzPx6ZJXGK33lOIgU0IRM,17432
344
- radboy/TasksMode/Tasks.py,sha256=dHF9SiYdiG5kdV6pxsMuJ9xVXUN-o2ldn55EU76bjTw,330911
344
+ radboy/TasksMode/Tasks.py,sha256=AH7WFtlJaCZBiqPLZEQZcbRMFaO0TXLCqulWJrHBzso,337296
345
345
  radboy/TasksMode/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
346
346
  radboy/TasksMode/__pycache__/ReFormula.cpython-311.pyc,sha256=QEG3PwVw-8HTd_Mf9XbVcxU56F1fC9yBqWXYPLC39DU,4865
347
347
  radboy/TasksMode/__pycache__/ReFormula.cpython-312.pyc,sha256=aX7BWm2PPjCTnxsbGUitR-2h9hq4AjaBiHMrUXvIl0Y,3967
@@ -350,7 +350,7 @@ radboy/TasksMode/__pycache__/SetEntryNEU.cpython-312.pyc,sha256=pCdFj61aPKkHL6Sv
350
350
  radboy/TasksMode/__pycache__/SetEntryNEU.cpython-313.pyc,sha256=UExwr8dN2STFEDE5t_YnQFMUX-wGv7JH10I1OyBDRtM,20212
351
351
  radboy/TasksMode/__pycache__/Tasks.cpython-311.pyc,sha256=6QOTJnLiXSKdF81hkhy3vyrz49PPhS20s5_0X52g3Hw,131120
352
352
  radboy/TasksMode/__pycache__/Tasks.cpython-312.pyc,sha256=hyJwdaYaaRLdcrNxgg36diJ5iijX5_3I0UAORsj-6LU,310295
353
- radboy/TasksMode/__pycache__/Tasks.cpython-313.pyc,sha256=QpGdmGuU2Zm-iuk7MtejxCmwoAqpWIUZtY7f74V8ZIg,403448
353
+ radboy/TasksMode/__pycache__/Tasks.cpython-313.pyc,sha256=r0hXaZvh83Q0fCeXgSeV0rAJUqzez8duRgAi1gMT6EI,408349
354
354
  radboy/TasksMode/__pycache__/__init__.cpython-311.pyc,sha256=PKV1JbihEacm639b53bZozRQvcllSkjGP3q8STVMxF4,234
355
355
  radboy/TasksMode/__pycache__/__init__.cpython-312.pyc,sha256=ERgnEvRMiGSecWp1BpNzLdSq_SdKw7GvFWUvUM7bLVw,272
356
356
  radboy/TasksMode/__pycache__/__init__.cpython-313.pyc,sha256=lvsTxukyvGKB3C0rdF9dQi_bvVh6ceDVINfwcuIsd0s,151
@@ -397,7 +397,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
397
397
  radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
398
398
  radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
399
399
  radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
400
- radboy/__pycache__/__init__.cpython-313.pyc,sha256=nxWxujm2GOL8paYNN9m2dxheaPwPa72Cs60ihWpCmFw,165
400
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=VwirwNIJ06yhZkw9J8W3s86Vb3MwRJ-zNWY-wiIwjdg,165
401
401
  radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
402
402
  radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
403
403
  radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
@@ -422,7 +422,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
422
422
  radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
423
423
  radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
424
424
  radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
425
- radboy-0.0.543.dist-info/METADATA,sha256=zrHUqurgaGNNCQMs4XQbGkXiBF7Xy2YShtprBpmOZIE,1615
426
- radboy-0.0.543.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
427
- radboy-0.0.543.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
428
- radboy-0.0.543.dist-info/RECORD,,
425
+ radboy-0.0.545.dist-info/METADATA,sha256=_E-6rt75FQbxIyutWPlQQvTUGAGM22w-hDg5U2p671k,1615
426
+ radboy-0.0.545.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
427
+ radboy-0.0.545.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
428
+ radboy-0.0.545.dist-info/RECORD,,