radboy 0.0.714__py3-none-any.whl → 0.0.716__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
@@ -1464,11 +1464,11 @@ class Prompt(object):
1464
1464
  ptext=ptext
1465
1465
  holidate=f'{Fore.light_cyan}CWD:{cwd}\n{msg_holidate}\n{Fore.light_magenta}Holiday: {Fore.dark_goldenrod}{isit} | {Fore.light_sea_green}{holiname}{Style.reset}'
1466
1466
  m=f"{holidate}|{Fore.light_blue}DUR="+str(datetime.now()-datetime.fromtimestamp(lastTime)).split(".")[0]
1467
- CHEAT=f'''{Fore.light_sea_green+((os.get_terminal_size().columns)-len(m))*'*'}
1468
- {Fore.light_steel_blue+os.get_terminal_size().columns*'*'}
1469
- {m}{Fore.black}{Back.grey_70} P_CMDS SncLstCmd:{str(duration).split(".")[0]} {Style.reset}|{Fore.black}{Back.grey_50} TmInShl:{str(InShellElapsed).split(".")[0]}|DT:{now.ctime()}| {Fore.dark_blue}{Style.bold}{Style.underline}Week {datetime.now().strftime("%W")} {Style.reset}|{Fore.light_magenta}#RPLC#={Fore.tan}rplc {Fore.light_magenta}#RPLC#{Fore.tan} frm {Fore.light_red}CB{Fore.orange_3}.{Fore.light_green}default={Fore.light_yellow}True{Fore.light_steel_blue} or by {Fore.light_red}CB{Fore.orange_3}.{Fore.light_green}doe={Fore.light_yellow}Newest{Style.reset}|{Fore.light_salmon_1}c2c=calc2cmd={Fore.sky_blue_2}clctr rslt to inpt{Style.reset}|b={color2}back|{Fore.light_red}h={color3}help{color4}|{Fore.light_red}h+={color3}help+{color4}|{Fore.light_magenta}i={color3}info|{Fore.light_green}{Fore.light_steel_blue}CMD#c2cb[{Fore.light_red}e{Fore.light_steel_blue}]{Fore.light_green}{Fore.light_red}|{Fore.orange_3}c2cb[{Fore.light_red}e{Fore.orange_3}]#CMD{Fore.light_green} - copy CMD to cb and set default | Note: optional [{Fore.light_red}e{Fore.light_green}] executes after copy{Style.reset} {Fore.light_steel_blue}NTE: cmd ends/start-swith [{Fore.light_red}#clr|clr#{Fore.light_green}{Fore.light_steel_blue}] clrs crnt ln 4 a rtry{Style.reset} {Fore.orange_red_1}|c{Fore.light_steel_blue}=calc|{Fore.spring_green_3a}cb={Fore.light_blue}clipboard{Style.reset}|{Fore.light_salmon_1}cdp={Fore.green_yellow}paste cb dflt {Fore.green}|q={Fore.green_yellow}Quit Menu (qm)
1470
- {Fore.light_red+os.get_terminal_size().columns*'.'}
1471
- {Fore.rgb(55,191,78)}HFL:{Fore.rgb(55,130,191)}{lineTotal()}{Fore.light_red}{Fore.light_green}{Back.grey_15}'''
1467
+ CHEAT=f'''{Fore.light_green}Stored Precision={Fore.light_red}{PROMPT_CONTEXT.prec}\n{Fore.light_sea_green+((os.get_terminal_size().columns)-len(m))*'*'}
1468
+ {Fore.light_steel_blue+os.get_terminal_size().columns*'*'}
1469
+ {m}{Fore.black}{Back.grey_70} P_CMDS SncLstCmd:{str(duration).split(".")[0]} {Style.reset}|{Fore.black}{Back.grey_50} TmInShl:{str(InShellElapsed).split(".")[0]}|DT:{now.ctime()}| {Fore.dark_blue}{Style.bold}{Style.underline}Week {datetime.now().strftime("%W")} {Style.reset}|{Fore.light_magenta}#RPLC#={Fore.tan}rplc {Fore.light_magenta}#RPLC#{Fore.tan} frm {Fore.light_red}CB{Fore.orange_3}.{Fore.light_green}default={Fore.light_yellow}True{Fore.light_steel_blue} or by {Fore.light_red}CB{Fore.orange_3}.{Fore.light_green}doe={Fore.light_yellow}Newest{Style.reset}|{Fore.light_salmon_1}c2c=calc2cmd={Fore.sky_blue_2}clctr rslt to inpt{Style.reset}|b={color2}back|{Fore.light_red}h={color3}help{color4}|{Fore.light_red}h+={color3}help+{color4}|{Fore.light_magenta}i={color3}info|{Fore.light_green}{Fore.light_steel_blue}CMD#c2cb[{Fore.light_red}e{Fore.light_steel_blue}]{Fore.light_green}{Fore.light_red}|{Fore.orange_3}c2cb[{Fore.light_red}e{Fore.orange_3}]#CMD{Fore.light_green} - copy CMD to cb and set default | Note: optional [{Fore.light_red}e{Fore.light_green}] executes after copy{Style.reset} {Fore.light_steel_blue}NTE: cmd ends/start-swith [{Fore.light_red}#clr|clr#{Fore.light_green}{Fore.light_steel_blue}] clrs crnt ln 4 a rtry{Style.reset} {Fore.orange_red_1}|c{Fore.light_steel_blue}=calc|{Fore.spring_green_3a}cb={Fore.light_blue}clipboard{Style.reset}|{Fore.light_salmon_1}cdp={Fore.green_yellow}paste cb dflt {Fore.green}|q={Fore.green_yellow}Quit Menu (qm)
1470
+ {Fore.light_red+os.get_terminal_size().columns*'.'}
1471
+ {Fore.rgb(55,191,78)}HFL:{Fore.rgb(55,130,191)}{lineTotal()}{Fore.light_red}{Fore.light_green}{Back.grey_15}'''
1472
1472
  if alt_input is not None and callable(alt_input):
1473
1473
  cmd=alt_input(f"{db.ROBS}{Fore.light_yellow}{db.ROBE}{'.'*os.get_terminal_size().columns}\n{db.ROBS}{Back.grey_15}{Fore.light_yellow}{db.ROBE}{ptext}{db.ROBS}{Fore.light_steel_blue}{db.ROBE}\n[{db.ROBS}{Fore.light_green}{db.ROBE}cheat/cht=brief cmd helpt{db.ROBS}{Fore.light_steel_blue}{db.ROBE}] ({db.ROBS}{Fore.orange_red_1}{db.ROBE}Exec{db.ROBS}{Fore.light_steel_blue}{db.ROBE})\n ->{db.ROBS}{Style.reset}{db.ROBE}")
1474
1474
  else:
Binary file
radboy/DB/db.py CHANGED
@@ -211,7 +211,7 @@ class BOOLEAN_ANSWERS:
211
211
  self.help='\n'.join(self.help)
212
212
  self.timeout=5
213
213
  self.long_boot_time=90
214
- self.timeout_msg=f"{Fore.light_yellow}SessionOnly({Fore.light_red}lb|longboot = timeout of 90s;{Fore.light_cyan}fb|fastboot = timeout of 0s;to|timeout=set custom timeout in sec.|fba|fastboot-auto=fast boot and return 'autoboot'){Style.reset}\n"
214
+ self.timeout_msg=f"{Fore.light_yellow}SessionOnly({Fore.light_red}lb|longboot = timeout of 90s;{Fore.light_cyan}fb|fastboot = timeout of 0s;to|timeout=set custom timeout in sec.a||fba|fastboot-auto=fast boot and return 'autoboot'){Style.reset}\n"
215
215
  self.math_operators={
216
216
  '+':None,
217
217
  '-':None,
@@ -346,7 +346,7 @@ str(uuid1()):{
346
346
  user_input = timedout(f"Boot CMDS(timeout=autoboot from)",htext=htxt)
347
347
  #user_input = inputimeout(prompt=f"{BooleanAnswers.timeout_msg}Boot CMDS({t} Seconds Passed=autoboot from {past.strftime("%I:%M:%S %p(12H)/%H:%M:%S(24H)")}):", timeout=t)
348
348
  print(f"You entered: {user_input}")
349
- if user_input in ['fb','fastboot','fba','fastboot-auto','timeout']:
349
+ if user_input in ['a','fb','fastboot','fba','fastboot-auto','timeout']:
350
350
  BooleanAnswers.timeout=0
351
351
  user_input="autoboot"
352
352
  if user_input in ['longboot','lb']:
radboy/TasksMode/Tasks.py CHANGED
@@ -365,178 +365,181 @@ class Formulae:
365
365
  def __init__(self):
366
366
  pass
367
367
  def formulaeu(self):
368
- while True:
369
- try:
370
- def timedecimal_to_ampm():
371
- 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")
372
- if dayHours is None:
373
- return
374
- elif dayHours in ['d',]:
375
- dayHours=Decimal('24')
376
- halfday=dayHours/2
368
+ with localcontext() as ctx:
369
+ ctx.prec=int(db.detectGetOrSet("lsbld ROUNDTO default",4,setValue=False,literal=True))
370
+ while True:
371
+ try:
372
+ def timedecimal_to_ampm():
373
+ 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")
374
+ if dayHours is None:
375
+ return
376
+ elif dayHours in ['d',]:
377
+ dayHours=Decimal('24')
378
+ halfday=dayHours/2
377
379
 
378
- result=None
379
- time_Dec=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Time Decimal: ",helpText="time of day as a decimal to convert to 12H ",data="dec.dec")
380
- if time_Dec is None:
381
- return
382
- elif time_Dec in ['d',]:
383
- time_Dec=0.0
384
- ampm='am'
385
- if time_Dec >= 0 and time_Dec <= dayHours:
386
- if time_Dec <= halfday:
387
- hours=int(time_Dec)
388
- else:
389
- hours=int(time_Dec-halfday)
390
- ampm='pm'
391
- minutes=time_Dec-int(time_Dec)
392
-
393
- try:
394
- minutes=int(minutes*60)
395
- except Exception as e:
396
- print(e)
397
- minutes=0
398
- result=f"{hours}[12H]/{int(time_Dec)}[24]:{minutes} {ampm}"
399
-
380
+ result=None
381
+ time_Dec=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Time Decimal: ",helpText="time of day as a decimal to convert to 12H ",data="dec.dec")
382
+ if time_Dec is None:
383
+ return
384
+ elif time_Dec in ['d',]:
385
+ time_Dec=0.0
386
+ ampm='am'
387
+ if time_Dec >= 0 and time_Dec <= dayHours:
388
+ if time_Dec <= halfday:
389
+ hours=int(time_Dec)
390
+ else:
391
+ hours=int(time_Dec-halfday)
392
+ ampm='pm'
393
+ minutes=time_Dec-int(time_Dec)
394
+
395
+ try:
396
+ minutes=int(minutes*60)
397
+ except Exception as e:
398
+ print(e)
399
+ minutes=0
400
+ result=f"{hours}[12H]/{int(time_Dec)}[24]:{minutes} {ampm}"
401
+
402
+ return result
400
403
  return result
401
- return result
402
404
 
403
- def invert_value():
404
- result=None
405
- value=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Value to Invert: ",helpText="make user provided value, or formula negative (value*-1='-value')",data="dec.dec")
406
- if value is None:
407
- return
408
- elif value in ['d',]:
409
- value=0
410
- result=value*-1
411
- return result
405
+ def invert_value():
406
+ result=None
407
+ value=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Value to Invert: ",helpText="make user provided value, or formula negative (value*-1='-value')",data="dec.dec")
408
+ if value is None:
409
+ return
410
+ elif value in ['d',]:
411
+ value=0
412
+ result=value*-1
413
+ return result
412
414
 
413
- def tax_rate_decimal():
414
- result=None
415
- tax_percent=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Tax Rate Percent: ",helpText="percent to convert to decimal (Percent/100=Rate)",data="dec.dec")
416
- if tax_percent is None:
417
- return
418
- elif tax_percent in ['d',]:
419
- tax_percent=default_taxrate/100
420
- result=tax_percent/100
421
- return result
415
+ def tax_rate_decimal():
416
+ result=None
417
+ tax_percent=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Tax Rate Percent: ",helpText="percent to convert to decimal (Percent/100=Rate)",data="dec.dec")
418
+ if tax_percent is None:
419
+ return
420
+ elif tax_percent in ['d',]:
421
+ tax_percent=default_taxrate/100
422
+ result=tax_percent/100
423
+ return result
422
424
 
423
-
425
+
424
426
 
425
- self.options={
426
- f'{uuid1()}':{
427
- 'cmds':['invert','-value','iv-val'],
428
- 'desc':f'{Fore.light_yellow}value{Fore.medium_violet_red} is multiplied by -1 to make inverse{Style.reset}',
429
- 'exec':invert_value
430
- },
431
- f'{uuid1()}':{
432
- 'cmds':['time dec to clock','t2c','time to clock'],
433
- 'desc':f'{Fore.light_yellow}value{Fore.medium_violet_red} convert decimal time to clock time{Style.reset}',
434
- 'exec':timedecimal_to_ampm
435
- },
436
- f'{uuid1()}':{
437
- 'cmds':['percent to decimal','p2d','prcnt2decimal','prcnt 2 dec'],
438
- 'desc':f'{Fore.light_yellow}decimal (0.02) {Fore.medium_violet_red} from percent (2%->2){Style.reset}',
439
- 'exec':tax_rate_decimal
440
- },
441
- f'{uuid1()}':{
442
- 'cmds':['basic counter','bcounter','countto','count to'],
443
- 'desc':f'{Fore.light_yellow}decimal (0.02) {Fore.medium_violet_red} from percent (2%->2){Style.reset}',
444
- 'exec':OAR.CountTo
445
- },
446
- }
447
-
448
- for i in preloader:
449
- self.options[i]=preloader[i]
450
- defaults_msg=f'''
451
- '''
452
- '''must be last for user to always see'''
453
- self.options[f'{uuid1()}']={
454
- 'cmds':['fcmd','findcmd','find cmd'],
455
- 'desc':f'Find {Fore.light_yellow}cmd{Fore.medium_violet_red} and excute for return{Style.reset}',
456
- 'exec':self.findAndUse2
427
+ self.options={
428
+ f'{uuid1()}':{
429
+ 'cmds':['invert','-value','iv-val'],
430
+ 'desc':f'{Fore.light_yellow}value{Fore.medium_violet_red} is multiplied by -1 to make inverse{Style.reset}',
431
+ 'exec':invert_value
432
+ },
433
+ f'{uuid1()}':{
434
+ 'cmds':['time dec to clock','t2c','time to clock'],
435
+ 'desc':f'{Fore.light_yellow}value{Fore.medium_violet_red} convert decimal time to clock time{Style.reset}',
436
+ 'exec':timedecimal_to_ampm
437
+ },
438
+ f'{uuid1()}':{
439
+ 'cmds':['percent to decimal','p2d','prcnt2decimal','prcnt 2 dec'],
440
+ 'desc':f'{Fore.light_yellow}decimal (0.02) {Fore.medium_violet_red} from percent (2%->2){Style.reset}',
441
+ 'exec':tax_rate_decimal
442
+ },
443
+ f'{uuid1()}':{
444
+ 'cmds':['basic counter','bcounter','countto','count to'],
445
+ 'desc':f'{Fore.light_yellow}decimal (0.02) {Fore.medium_violet_red} from percent (2%->2){Style.reset}',
446
+ 'exec':OAR.CountTo
447
+ },
457
448
  }
458
- for num,i in enumerate(self.options):
459
- if str(num) not in self.options[i]['cmds']:
460
- self.options[i]['cmds'].append(str(num))
461
- options=copy(self.options)
449
+
450
+ for i in preloader:
451
+ self.options[i]=preloader[i]
452
+ defaults_msg=f'''
453
+ '''
454
+ '''must be last for user to always see'''
455
+ self.options[f'{uuid1()}']={
456
+ 'cmds':['fcmd','findcmd','find cmd'],
457
+ 'desc':f'Find {Fore.light_yellow}cmd{Fore.medium_violet_red} and excute for return{Style.reset}',
458
+ 'exec':self.findAndUse2
459
+ }
460
+ for num,i in enumerate(self.options):
461
+ if str(num) not in self.options[i]['cmds']:
462
+ self.options[i]['cmds'].append(str(num))
463
+ options=copy(self.options)
462
464
 
463
- while True:
464
- helpText=[]
465
- for i in options:
466
- msg=f"{Fore.light_green}{options[i]['cmds']}{Fore.light_red} -> {options[i]['desc']}{Style.reset}"
467
- helpText.append(msg)
468
- helpText='\n'.join(helpText)
469
- print(helpText)
470
- print(defaults_msg)
471
- cmd=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Quick Formulas|Do What?:",helpText=helpText,data="string")
472
- if cmd is None:
473
- return None
474
- result=None
475
- for i in options:
476
- els=[ii.lower() for ii in options[i]['cmds']]
477
- if cmd.lower() in els:
478
- result=options[i]['exec']()
479
- break
480
- print(f"{result}")
481
- returnResult=Prompt.__init2__(None,func=FormBuilderMkText,ptext="[Formula] Return Result?[y/n]",helpText=f"result to return is '{result}'",data="boolean")
482
- if returnResult in [True,]:
483
- if result is None:
465
+ while True:
466
+ helpText=[]
467
+ zt=len(options)
468
+ for num,i in enumerate(options):
469
+ msg=f"{Fore.light_green}{options[i]['cmds']}{Fore.light_red} -> {options[i]['desc']}{Style.reset}"
470
+ helpText.append(std_colorize(msg,num,zt))
471
+ helpText='\n'.join(helpText)
472
+ print(helpText)
473
+ print(defaults_msg)
474
+ cmd=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Quick Formulas|Do What?:",helpText=helpText,data="string")
475
+ if cmd is None:
484
476
  return None
485
- else:
486
- returnTypes=["float","Decimal","string","string"]
487
- returnActor=[lambda x:round(float(x),4),lambda x:Decimal(x).quantize(Decimal("0.0000")),lambda x: f"{x:.4f}",lambda x:str(x)]
488
- ct=len(returnTypes)
489
- returnType=None
490
- htext=[]
491
- strOnly=False
492
- for num,i in enumerate(returnTypes):
493
- try:
494
- htext.append(std_colorize(f"{i} - {returnActor[num](result)} ",num,ct))
495
- except Exception as e:
496
- strOnly=True
497
- print(e)
498
- htext='\n'.join(htext)
499
- while returnType not in range(0,ct+1):
500
- print(htext)
501
- returnType=Prompt.__init2__(self,func=FormBuilderMkText,ptext="Return the value as?",helpText=f"{htext}\nwhich index?",data="integer")
502
- if returnType is None:
503
- return None
504
- elif returnType in ['d',]:
505
- if not strOnly:
506
- returnType=1
507
- else:
508
- returnType=-1
509
- break
510
- #return str(result)
511
- try:
512
- if returnTypes[returnType] == 'float':
513
- try:
514
- return returnActor[returnType](result)
515
- except Exception as e:
516
- print(e)
517
- continue
518
- elif returnTypes[returnType] == 'Decimal':
519
- try:
520
- return returnActor[returnType](result)
521
- except Exception as e:
522
- print(e)
523
- continue
524
- elif returnTypes[returnType] == 'string':
477
+ result=None
478
+ for i in options:
479
+ els=[ii.lower() for ii in options[i]['cmds']]
480
+ if cmd.lower() in els:
481
+ result=options[i]['exec']()
482
+ break
483
+ print(f"{result}")
484
+ returnResult=Prompt.__init2__(None,func=FormBuilderMkText,ptext="[Formula] Return Result?[y/n]",helpText=f"result to return is '{result}'",data="boolean")
485
+ if returnResult in [True,]:
486
+ if result is None:
487
+ return None
488
+ else:
489
+ returnTypes=["float","Decimal","string","string"]
490
+ returnActor=[lambda x:round(float(x),4),lambda x:Decimal(x),lambda x: f"{x:.4f}",lambda x:str(x)]
491
+ ct=len(returnTypes)
492
+ returnType=None
493
+ htext=[]
494
+ strOnly=False
495
+ for num,i in enumerate(returnTypes):
525
496
  try:
526
- return returnActor[returnType](result)
497
+ htext.append(std_colorize(f"{i} - {returnActor[num](result)} ",num,ct))
527
498
  except Exception as e:
499
+ strOnly=True
528
500
  print(e)
529
- continue
530
- else:
501
+ htext='\n'.join(htext)
502
+ while returnType not in range(0,ct+1):
503
+ print(htext)
504
+ returnType=Prompt.__init2__(self,func=FormBuilderMkText,ptext="Return the value as?",helpText=f"{htext}\nwhich index?",data="integer")
505
+ if returnType is None:
506
+ return None
507
+ elif returnType in ['d',]:
508
+ if not strOnly:
509
+ returnType=1
510
+ else:
511
+ returnType=-1
512
+ break
513
+ #return str(result)
514
+ try:
515
+ if returnTypes[returnType] == 'float':
516
+ try:
517
+ return returnActor[returnType](result)
518
+ except Exception as e:
519
+ print(e)
520
+ continue
521
+ elif returnTypes[returnType] == 'Decimal':
522
+ try:
523
+ return returnActor[returnType](result)
524
+ except Exception as e:
525
+ print(e)
526
+ continue
527
+ elif returnTypes[returnType] == 'string':
528
+ try:
529
+ return returnActor[returnType](result)
530
+ except Exception as e:
531
+ print(e)
532
+ continue
533
+ else:
534
+ return result
535
+ except Exception as e:
536
+ print(e)
537
+ print("returning as a string")
531
538
  return result
532
- except Exception as e:
533
- print(e)
534
- print("returning as a string")
535
- return result
536
- return result
537
- except Exception as e:
538
- print(e,str(e),repr(e))
539
- return None
539
+ return result
540
+ except Exception as e:
541
+ print(e,str(e),repr(e))
542
+ return None
540
543
 
541
544
 
542
545
  def pricing(self):
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.714'
1
+ VERSION='0.0.716'
Binary file