radboy 0.0.458__py3-none-any.whl → 0.0.460__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
@@ -875,148 +875,149 @@ class Prompt(object):
875
875
  esblb- bldls(bldlse=True,sbld=True,minus=True)
876
876
  '''
877
877
  def bldls(bldlse=False,sbld=False,minus=False):
878
- extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
879
- if extras in [None,'d',False]:
880
- extras=False
881
- msg=''
882
- if bldlse:
883
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file,clear_only=True)
884
- with db.Session(db.ENGINE) as session:
885
- results_query=session.query(db.Entry).filter(db.Entry.InList==True)
886
- if sbld:
887
- def mkT(text,data):
888
- return text
889
- code=Prompt.__init2__(None,func=mkT,ptext="Code|Barcode|Name: ",helpText="find by code,barcode,name",data='')
890
- if code in [None,'d']:
891
- return
892
- results_query=results_query.filter(
893
- db.or_(
894
- db.Entry.Code==code,
895
- db.Entry.Barcode==code,
896
- db.Entry.Barcode.icontains(code),
897
- db.Entry.Code.icontains(code),
898
- db.Entry.Name.icontains(code)
899
- )
900
- )
901
- location_fields=["Shelf","BackRoom","Display_1","Display_2","Display_3","Display_4","Display_5","Display_6","ListQty","SBX_WTR_DSPLY","SBX_CHP_DSPLY","SBX_WTR_KLR","FLRL_CHP_DSPLY","FLRL_WTR_DSPLY","WD_DSPLY","CHKSTND_SPLY","Distress"]
902
- z=Prompt.mkfield_list(None,location_fields)
903
- if z in [[],None]:
904
- z=location_fields
905
- location_fields=z
906
- tmp=[]
907
- for f in location_fields:
908
- if not minus:
909
- tmp.append(or_(getattr(db.Entry,f)>=0.0001))
878
+ try:
879
+ extras=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Show Extras?",helpText="extra data attached to each entry yes or no",data="boolean")
880
+ if extras in [None,'d',False]:
881
+ extras=False
882
+ msg=''
883
+ if bldlse:
884
+ db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file,clear_only=True)
885
+ with db.Session(db.ENGINE) as session:
886
+ results_query=session.query(db.Entry).filter(db.Entry.InList==True)
887
+ if sbld:
888
+ def mkT(text,data):
889
+ return text
890
+ code=Prompt.__init2__(None,func=mkT,ptext="Code|Barcode|Name: ",helpText="find by code,barcode,name",data='')
891
+ if code in [None,'d']:
892
+ return
893
+ results_query=results_query.filter(
894
+ db.or_(
895
+ db.Entry.Code==code,
896
+ db.Entry.Barcode==code,
897
+ db.Entry.Barcode.icontains(code),
898
+ db.Entry.Code.icontains(code),
899
+ db.Entry.Name.icontains(code)
900
+ )
901
+ )
902
+ location_fields=["Shelf","BackRoom","Display_1","Display_2","Display_3","Display_4","Display_5","Display_6","ListQty","SBX_WTR_DSPLY","SBX_CHP_DSPLY","SBX_WTR_KLR","FLRL_CHP_DSPLY","FLRL_WTR_DSPLY","WD_DSPLY","CHKSTND_SPLY","Distress"]
903
+ z=Prompt.mkfield_list(None,location_fields)
904
+ if z in [[],None]:
905
+ z=location_fields
906
+ location_fields=z
907
+ tmp=[]
908
+ for f in location_fields:
909
+ if not minus:
910
+ tmp.append(or_(getattr(db.Entry,f)>=0.0001))
911
+ else:
912
+ tmp.append(or_(getattr(db.Entry,f)!=0,getattr(db.Entry,f)!=None))
913
+
914
+ results_query=results_query.filter(or_(*tmp))
915
+ LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
916
+ if not isinstance(LookUpState,bool):
917
+ LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=True,literal=False)
918
+ if LookUpState == True:
919
+ results=results_query.order_by(db.Entry.Timestamp.asc()).all()
910
920
  else:
911
- tmp.append(or_(getattr(db.Entry,f)!=0,getattr(db.Entry,f)!=None))
912
-
913
- results_query=results_query.filter(or_(*tmp))
914
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
915
- if not isinstance(LookUpState,bool):
916
- LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=True,literal=False)
917
- if LookUpState == True:
918
- results=results_query.order_by(db.Entry.Timestamp.asc()).all()
919
- else:
920
- results=results_query.order_by(db.Entry.Timestamp.desc()).all()
921
- ct=len(results)
922
- if ct < 1:
923
- msg=f"{Fore.light_steel_blue}Nothing in {Fore.slate_blue_1}Bld{Fore.light_red}LS!{Style.reset}"
924
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
925
- print(msg)
926
- return
927
- #start
928
- ROUNDTO=int(db.detectGetOrSet("lsbld ROUNDTO default",3,setValue=False,literal=True))
929
- master_total=Decimal("0.00")
930
- master_total_crv=Decimal("0.00")
931
- master_total_tax=Decimal("0.00")
932
- master_total_tax_crv=Decimal("0.00")
933
-
934
- for num,i in enumerate(results):
935
- getExtras(i.EntryId,extras)
936
- msg=f'{"*"*os.get_terminal_size().columns}\n{Fore.light_green}{num}{Fore.light_magenta}/{Fore.orange_3}{num+1} of {Fore.light_red}{ct}[{Fore.dark_slate_gray_1}EID{Fore.orange_3}]{Fore.dark_violet_1b}{i.EntryId}{Style.reset} |-| {Fore.light_yellow}{i.Name}|{Fore.light_salmon_1}[{Fore.light_red}BCD]{i.rebar()}{Fore.medium_violet_red}|[{Fore.light_red}CD{Fore.medium_violet_red}]{i.cfmt(i.Code)} {Style.reset}|-| '
937
- colormapped=[
938
- Fore.deep_sky_blue_4c,
939
- Fore.spring_green_4,
940
- Fore.turquoise_4,
941
- Fore.dark_cyan,
942
- Fore.deep_sky_blue_2,
943
- Fore.spring_green_2a,
944
- Fore.medium_spring_green,
945
- Fore.steel_blue,
946
- Fore.cadet_blue_1,
947
- Fore.aquamarine_3,
948
- Fore.purple_1a,
949
- Fore.medium_purple_3a,
950
- Fore.slate_blue_1,
951
- Fore.light_slate_grey,
952
- Fore.dark_olive_green_3a,
953
- Fore.deep_pink_4c,
954
- Fore.orange_3,
955
- ]
956
- #print("#0")
957
- total=Decimal("0.00")
958
- crv=Decimal("0.00")
959
- tax=Decimal("0.0000")
960
- tax_crv=Decimal("0.00")
961
- i.Tax=Decimal(i.Tax).quantize(Decimal("0.0000"))
962
- i.CRV=Decimal(i.CRV).quantize(Decimal("0.00"))
963
- i.Price=Decimal(i.Price).quantize(Decimal("0.00"))
964
- taxRate=Decimal(i.Tax/(i.Price+i.CRV)).quantize(Decimal("0.0000"))
965
- #print("#1")
966
- if not minus:
967
- for n2,f in enumerate(location_fields):
968
- try:
921
+ results=results_query.order_by(db.Entry.Timestamp.desc()).all()
922
+ ct=len(results)
923
+ if ct < 1:
924
+ msg=f"{Fore.light_steel_blue}Nothing in {Fore.slate_blue_1}Bld{Fore.light_red}LS!{Style.reset}"
925
+ db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
926
+ print(msg)
927
+ return
928
+ #start
929
+ ROUNDTO=int(db.detectGetOrSet("lsbld ROUNDTO default",3,setValue=False,literal=True))
930
+ master_total=Decimal("0.00")
931
+ master_total_crv=Decimal("0.00")
932
+ master_total_tax=Decimal("0.00")
933
+ master_total_tax_crv=Decimal("0.00")
934
+
935
+ for num,i in enumerate(results):
936
+ getExtras(i.EntryId,extras)
937
+ msg=f'{"*"*os.get_terminal_size().columns}\n{Fore.light_green}{num}{Fore.light_magenta}/{Fore.orange_3}{num+1} of {Fore.light_red}{ct}[{Fore.dark_slate_gray_1}EID{Fore.orange_3}]{Fore.dark_violet_1b}{i.EntryId}{Style.reset} |-| {Fore.light_yellow}{i.Name}|{Fore.light_salmon_1}[{Fore.light_red}BCD]{i.rebar()}{Fore.medium_violet_red}|[{Fore.light_red}CD{Fore.medium_violet_red}]{i.cfmt(i.Code)} {Style.reset}|-| '
938
+ colormapped=[
939
+ Fore.deep_sky_blue_4c,
940
+ Fore.spring_green_4,
941
+ Fore.turquoise_4,
942
+ Fore.dark_cyan,
943
+ Fore.deep_sky_blue_2,
944
+ Fore.spring_green_2a,
945
+ Fore.medium_spring_green,
946
+ Fore.steel_blue,
947
+ Fore.cadet_blue_1,
948
+ Fore.aquamarine_3,
949
+ Fore.purple_1a,
950
+ Fore.medium_purple_3a,
951
+ Fore.slate_blue_1,
952
+ Fore.light_slate_grey,
953
+ Fore.dark_olive_green_3a,
954
+ Fore.deep_pink_4c,
955
+ Fore.orange_3,
956
+ ]
957
+ #print("#0")
958
+ total=Decimal("0.00")
959
+ crv=Decimal("0.00")
960
+ tax=Decimal("0.0000")
961
+ tax_crv=Decimal("0.00")
962
+ i.Tax=Decimal(i.Tax).quantize(Decimal("0.0000"))
963
+ i.CRV=Decimal(i.CRV).quantize(Decimal("0.00"))
964
+ i.Price=Decimal(i.Price).quantize(Decimal("0.00"))
965
+ taxRate=Decimal(i.Tax/(i.Price+i.CRV)).quantize(Decimal("0.0000"))
966
+ #print("#1")
967
+ if not minus:
968
+ for n2,f in enumerate(location_fields):
969
+ try:
970
+ if getattr(i,f) > 0:
971
+ total+=Decimal(getattr(i,f)).quantize(Decimal("0.00"))
972
+ except Exception as e:
973
+ print(e)
974
+ for n2,f in enumerate(location_fields):
969
975
  if getattr(i,f) > 0:
970
- total+=Decimal(getattr(i,f)).quantize(Decimal("0.00"))
971
- except Exception as e:
972
- print(e)
973
- for n2,f in enumerate(location_fields):
974
- if getattr(i,f) > 0:
975
- msg2=f'{colormapped[n2]}{f} = {Decimal(getattr(i,f)).quantize(Decimal("0.00"))}{Style.reset}'
976
- if n2 < len(location_fields):
977
- msg2+=","
978
- msg+=msg2
979
- else:
980
- for n2,f in enumerate(location_fields):
981
- try:
976
+ msg2=f'{colormapped[n2]}{f} = {Decimal(getattr(i,f)).quantize(Decimal("0.00"))}{Style.reset}'
977
+ if n2 < len(location_fields):
978
+ msg2+=","
979
+ msg+=msg2
980
+ else:
981
+ for n2,f in enumerate(location_fields):
982
+ try:
983
+ if getattr(i,f) != 0:
984
+ total+=Decimal(getattr(i,f)).quantize(Decimal("0.00"))
985
+ except Exception as e:
986
+ print(e)
987
+ for n2,f in enumerate(location_fields):
982
988
  if getattr(i,f) != 0:
983
- total+=Decimal(getattr(i,f)).quantize(Decimal("0.00"))
984
- except Exception as e:
985
- print(e)
986
- for n2,f in enumerate(location_fields):
987
- if getattr(i,f) != 0:
988
- msg2=f'{colormapped[n2]}{f} = {Decimal(str(getattr(i,f))).quantize(Decimal("0.00"))}{Style.reset}'
989
- if n2 < len(location_fields):
990
- msg2+=","
991
- msg+=msg2
992
- master_total+=total*Decimal(i.Price).quantize(Decimal("0.00"))
993
-
994
- crv+=(Decimal(i.CRV).quantize(Decimal("0.00"))*total)
995
- tax+=(Decimal(i.Tax).quantize(Decimal("0.00"))*total)
996
-
997
- tax_crv=(crv+tax)
998
- master_total_tax+=tax
999
- master_total_crv+=crv
1000
- master_total_tax_crv+=tax_crv
1001
- #print("#exegen",type(total),type(tax_crv))
1002
- try:
1003
- #print((total*Decimal(i.Price).quantize(Decimal("0.00"))+tax_crv),"s1")
1004
- #print(Decimal(getSuperTotal(results,location_fields,colormapped)['final total']).quantize(Decimal("00.00")),"s2")
1005
- #print(tax_crv,"s3")
1006
- #super_total=(round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)/getSuperTotal(results,location_fields,colormapped)['final total'],ROUNDTO))*100
1007
- super_total=(total*Decimal(i.Price).quantize(Decimal("0.00"))+tax+crv)/Decimal(getSuperTotal(results,location_fields,colormapped)['final total']).quantize(Decimal("00.00"))
1008
- super_total=super_total*100
1009
- except Exception as e:
1010
- p1=total*Decimal(i.Price).quantize(Decimal("0.00"))+tax_crv
1011
- p2=Decimal(getSuperTotal(results,location_fields,colormapped)['final total']).quantize(Decimal("0.00"))
1012
- print(e)
1013
- print(p1,"p1")
1014
- print(p2,"p2")
1015
- super_total=0
1016
- #print("#exegen2")
1017
- super_total=Decimal(super_total).quantize(Decimal("0.00"))
1018
- #print(super_total)
1019
- msg+=f"""{Fore.light_magenta} |-|{Fore.light_green} Total = {Fore.light_sea_green}{total}
989
+ msg2=f'{colormapped[n2]}{f} = {Decimal(str(getattr(i,f))).quantize(Decimal("0.00"))}{Style.reset}'
990
+ if n2 < len(location_fields):
991
+ msg2+=","
992
+ msg+=msg2
993
+ master_total+=total*Decimal(i.Price).quantize(Decimal("0.00"))
994
+
995
+ crv+=(Decimal(i.CRV).quantize(Decimal("0.00"))*total)
996
+ tax+=(Decimal(i.Tax).quantize(Decimal("0.00"))*total)
997
+
998
+ tax_crv=(crv+tax)
999
+ master_total_tax+=tax
1000
+ master_total_crv+=crv
1001
+ master_total_tax_crv+=tax_crv
1002
+ #print("#exegen",type(total),type(tax_crv))
1003
+ try:
1004
+ #print((total*Decimal(i.Price).quantize(Decimal("0.00"))+tax_crv),"s1")
1005
+ #print(Decimal(getSuperTotal(results,location_fields,colormapped)['final total']).quantize(Decimal("00.00")),"s2")
1006
+ #print(tax_crv,"s3")
1007
+ #super_total=(round(round(round(total*i.Price,ROUNDTO)+tax_crv,ROUNDTO)/getSuperTotal(results,location_fields,colormapped)['final total'],ROUNDTO))*100
1008
+ super_total=(total*Decimal(i.Price).quantize(Decimal("0.00"))+tax+crv)/Decimal(getSuperTotal(results,location_fields,colormapped)['final total']).quantize(Decimal("00.00"))
1009
+ super_total=super_total*100
1010
+ except Exception as e:
1011
+ p1=total*Decimal(i.Price).quantize(Decimal("0.00"))+tax_crv
1012
+ p2=Decimal(getSuperTotal(results,location_fields,colormapped)['final total']).quantize(Decimal("0.00"))
1013
+ print(e)
1014
+ print(p1,"p1")
1015
+ print(p2,"p2")
1016
+ super_total=0
1017
+ #print("#exegen2")
1018
+ super_total=Decimal(super_total).quantize(Decimal("0.00"))
1019
+ #print(super_total)
1020
+ msg+=f"""{Fore.light_magenta} |-|{Fore.light_green} Total = {Fore.light_sea_green}{total}
1020
1021
  {Fore.light_magenta}Price({Decimal(i.Price).quantize(Decimal("0.00"))}){Fore.medium_violet_red}*{Fore.light_slate_blue}Total({total}):{Decimal(i.Price).quantize(Decimal("0.00"))*total}
1021
1022
  {Fore.grey_70}+CRV({Decimal(i.CRV).quantize(Decimal("0.00"))})*Total({total.quantize(Decimal("0.00"))}){Fore.slate_blue_1}
1022
1023
  {Fore.medium_spring_green}= {Fore.slate_blue_1}TotalCRV({crv})+TotalPrice({total*Decimal(i.Price).quantize(Decimal("0.00"))})
@@ -1030,17 +1031,17 @@ class Prompt(object):
1030
1031
  {Fore.medium_violet_red}PercentOfTotal({super_total}%) of FinalTotal({getSuperTotal(results,location_fields,colormapped)['final total']})
1031
1032
  {Fore.orange_red_1}TaxRate({taxRate})={Decimal(taxRate*100).quantize(Decimal("0.00"))}%{Style.reset}
1032
1033
  {'*'*os.get_terminal_size().columns}{Style.reset}"""
1033
- if bldlse:
1034
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
1035
- print(msg)
1036
- master_total=Decimal(str(master_total)).quantize(Decimal("0.00"))
1037
- master_total_crv=Decimal(str(master_total_crv)).quantize(Decimal("0.00"))
1038
- master_total_tax=Decimal(str(master_total_tax)).quantize(Decimal("0.00"))
1039
- master_total_tax_crv=Decimal(str(master_total_tax_crv)).quantize(Decimal("0.00"))
1040
-
1041
- actual=(master_total_crv+master_total)+master_total_tax
1042
-
1043
- msg=f"""{Fore.light_green}Total Product Value
1034
+ if bldlse:
1035
+ db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
1036
+ print(msg)
1037
+ master_total=Decimal(str(master_total)).quantize(Decimal("0.00"))
1038
+ master_total_crv=Decimal(str(master_total_crv)).quantize(Decimal("0.00"))
1039
+ master_total_tax=Decimal(str(master_total_tax)).quantize(Decimal("0.00"))
1040
+ master_total_tax_crv=Decimal(str(master_total_tax_crv)).quantize(Decimal("0.00"))
1041
+
1042
+ actual=(master_total_crv+master_total)+master_total_tax
1043
+
1044
+ msg=f"""{Fore.light_green}Total Product Value
1044
1045
  {Fore.orange_red_1}= {Style.bold}{Fore.slate_blue_1}{master_total}{Style.reset}
1045
1046
  {Fore.light_green}Total Product Value w/CRV({master_total_crv})
1046
1047
  {Fore.orange_red_1}= {Style.bold}{Fore.slate_blue_1}{master_total_crv+master_total}{Style.reset}
@@ -1048,10 +1049,12 @@ class Prompt(object):
1048
1049
  {Fore.orange_red_1}= {Style.bold}{Fore.slate_blue_1}{master_total_tax+master_total}{Style.reset}
1049
1050
  {Fore.light_green}Total Product Value Taxed({master_total_tax}) w/ CRV({master_total_crv})
1050
1051
  {Fore.orange_red_1}= {Style.bold}{Fore.slate_blue_1}{actual}{Style.reset}
1051
- {Style.reset}"""
1052
- if bldlse:
1053
- db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
1054
- print(msg)
1052
+ {Style.reset}"""
1053
+ if bldlse:
1054
+ db.logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=Prompt.bld_file)
1055
+ print(msg)
1056
+ except Exception as e:
1057
+ print(e,"you might try and re-run the cmd")
1055
1058
  while True:
1056
1059
  try:
1057
1060
  lastTime=db.detectGetOrSet("PromptLastDTasFloat",datetime.now().timestamp())
@@ -2085,6 +2088,7 @@ CMD's are not final until ended with {Fore.magenta}{hw_delim}{Style.reset}""")
2085
2088
  {Fore.grey_85}** {Fore.light_steel_blue}{f'{Fore.light_red},{Fore.light_steel_blue}'.join(generate_cmds(startcmd=['orddts','ordts','loads','lds','orders','loads','rxdates'],endCmd=['','all','all dates','all dts','aldts','*']))}{Fore.light_green} print all load dates {Style.reset}
2086
2089
  {Fore.grey_70}** {Fore.light_steel_blue}{f'{Fore.light_red},{Fore.light_steel_blue}'.join(generate_cmds(startcmd=['units',],endCmd=['']))}{Fore.light_green} list supported units{Style.reset}
2087
2090
  {Fore.grey_70}** {Fore.light_steel_blue}{f'{Fore.light_red},{Fore.light_steel_blue}'.join(generate_cmds(startcmd=['lds2','rdts'],endCmd=['',]))}{Fore.light_green} repeable dates,orders,etc...{Style.reset}
2091
+ {Fore.grey_70}** {Fore.light_steel_blue}{f'{Fore.light_red},{Fore.light_steel_blue}'.join(generate_cmds(startcmd=["set inlist","sil"],endCmd=["qtyu","u"]))}{Fore.light_green} set Entry's with InList==True to value, from prompt{Style.reset}
2088
2092
  {Fore.grey_70}** {Fore.light_steel_blue}['dsu','daystring','daystr']{Fore.light_green} print daystring {Style.reset}
2089
2093
  {Fore.grey_70}** {Fore.light_steel_blue}['dsur','daystring return','dstr r']{Fore.light_green} print and return daystring {Style.reset}
2090
2094
  {Fore.grey_70}** {Fore.light_steel_blue}['dsup','daystring plain','daystrpln']{Fore.light_green} print daystring as plain text with no colors{Style.reset}
@@ -2181,6 +2185,8 @@ CMD's are not final until ended with {Fore.magenta}{hw_delim}{Style.reset}""")
2181
2185
  continue
2182
2186
  elif cmd.lower() in generate_cmds(startcmd=['units',],endCmd=['']):
2183
2187
  TM.Tasks.TasksMode(parent=self,engine=db.ENGINE,init_only=True).listSystemUnits()
2188
+ elif cmd.lower() in generate_cmds(startcmd=["set inlist","sil"],endCmd=["qtyu","u"]):
2189
+ TM.Tasks.TasksMode(parent=self,engine=db.ENGINE,init_only=True).set_inList()
2184
2190
  elif cmd.lower() in ['rllo','reverse list lookup order']:
2185
2191
  try:
2186
2192
  state=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
radboy/TasksMode/Tasks.py CHANGED
@@ -290,6 +290,150 @@ def save(value):
290
290
 
291
291
 
292
292
  class TasksMode:
293
+ def set_inList(self):
294
+ h=[]
295
+ ct=len(self.locationFields)
296
+ for num,i in enumerate(self.locationFields):
297
+ msg=std_colorize(i,num,ct)
298
+ h.append(msg)
299
+ h='\n'.join(h)
300
+ print(h)
301
+ fields=Prompt.__init2__(None,func=FormBuilderMkText,ptext="which fields to modify?",helpText=h,data="list")
302
+ if fields is None:
303
+ return
304
+ elif fields in ['d',]:
305
+ return
306
+
307
+ h=[]
308
+ operations=['*','**','+','-','/','//','=','%','>','>=','<','<=','==','and','or','!and','!or','|','&','!|','!&','!=','not =','not !=']
309
+ ct=len(operations)
310
+ for num,i in enumerate(operations):
311
+ msg=std_colorize(i,num,ct)
312
+ h.append(msg)
313
+ h='\n'.join(h)
314
+ print(h)
315
+ operator=Prompt.__init2__(None,func=FormBuilderMkText,ptext="which operator use to to modify?",helpText=h,data="integer")
316
+ if operator is None:
317
+ return
318
+ elif operator in ['d',]:
319
+ return
320
+ operator=operations[operator]
321
+
322
+ quantity=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Amount to modify with? ",helpText="a float/integer",data="integer")
323
+ if quantity in [None,'d']:
324
+ return
325
+
326
+ with Session(ENGINE) as session:
327
+ query=session.query(Entry).filter(Entry.InList==True)
328
+ query=orderQuery(query,Entry.Timestamp,inverse=True)
329
+
330
+ results=query.all()
331
+ cta=len(results)
332
+ for num,result in enumerate(results):
333
+ for field in fields:
334
+ try:
335
+ field=int(field)
336
+ old=getattr(result,self.locationFields[field])
337
+ if operator == '+':
338
+ setattr(result,self.locationFields[field],old+quantity)
339
+ session.commit()
340
+ session.refresh(result)
341
+ elif operator == '-':
342
+ setattr(result,self.locationFields[field],old-quantity)
343
+ session.commit()
344
+ session.refresh(result)
345
+ elif operator == '*':
346
+ setattr(result,self.locationFields[field],old*quantity)
347
+ session.commit()
348
+ session.refresh(result)
349
+ elif operator == '/':
350
+ setattr(result,self.locationFields[field],old/quantity)
351
+ session.commit()
352
+ session.refresh(result)
353
+ elif operator == '**':
354
+ setattr(result,self.locationFields[field],old**quantity)
355
+ session.commit()
356
+ session.refresh(result)
357
+ elif operator == '//':
358
+ setattr(result,self.locationFields[field],old//quantity)
359
+ session.commit()
360
+ session.refresh(result)
361
+ elif operator == '=':
362
+ setattr(result,self.locationFields[field],quantity)
363
+ session.commit()
364
+ session.refresh(result)
365
+ elif operator == '%':
366
+ setattr(result,self.locationFields[field],old%quantity)
367
+ session.commit()
368
+ session.refresh(result)
369
+ elif operator == '>':
370
+ setattr(result,self.locationFields[field],float(old>quantity))
371
+ session.commit()
372
+ session.refresh(result)
373
+ elif operator == '>=':
374
+ setattr(result,self.locationFields[field],float(old>=quantity))
375
+ session.commit()
376
+ session.refresh(result)
377
+ elif operator == '<':
378
+ setattr(result,self.locationFields[field],float(old<quantity))
379
+ session.commit()
380
+ session.refresh(result)
381
+ elif operator == '<=':
382
+ setattr(result,self.locationFields[field],float(old<=quantity))
383
+ session.commit()
384
+ session.refresh(result)
385
+ elif operator == '%':
386
+ setattr(result,self.locationFields[field],float(old==quantity))
387
+ session.commit()
388
+ session.refresh(result)
389
+ elif operator == 'and':
390
+ setattr(result,self.locationFields[field],float(old and quantity))
391
+ session.commit()
392
+ session.refresh(result)
393
+ elif operator == 'or':
394
+ setattr(result,self.locationFields[field],float(old or quantity))
395
+ session.commit()
396
+ session.refresh(result)
397
+ elif operator == '!and':
398
+ setattr(result,self.locationFields[field],float(not old and quantity))
399
+ session.commit()
400
+ session.refresh(result)
401
+ elif operator == '!or':
402
+ setattr(result,self.locationFields[field],float(not old or quantity))
403
+ session.commit()
404
+ session.refresh(result)
405
+ elif operator == '|':
406
+ setattr(result,self.locationFields[field],float(int(old) | int(quantity)))
407
+ session.commit()
408
+ session.refresh(result)
409
+ elif operator == '&':
410
+ setattr(result,self.locationFields[field],float(int(old) & int(quantity)))
411
+ session.commit()
412
+ session.refresh(result)
413
+ elif operator == '!|':
414
+ setattr(result,self.locationFields[field],float(not int(old) | int(quantity)))
415
+ session.commit()
416
+ session.refresh(result)
417
+ elif operator == '!&':
418
+ setattr(result,self.locationFields[field],float(not int(old) & int(quantity)))
419
+ session.commit()
420
+ session.refresh(result)
421
+ elif operator == '!=':
422
+ setattr(result,self.locationFields[field],float(old != quantity))
423
+ session.commit()
424
+ session.refresh(result)
425
+ elif operator == 'not =':
426
+ setattr(result,self.locationFields[field],float(not old == quantity))
427
+ session.commit()
428
+ session.refresh(result)
429
+ elif operator == 'not !=':
430
+ setattr(result,self.locationFields[field],float(not old != quantity))
431
+ session.commit()
432
+ session.refresh(result)
433
+ except Exception as e:
434
+ print(e)
435
+
436
+
293
437
  def day_string(self,plain=False):
294
438
  today=Prompt.__init2__(None,func=FormBuilderMkText,ptext="what is today?",helpText="a datetime or date",data="datetime")
295
439
  if today is None:
@@ -4788,6 +4932,12 @@ where:
4788
4932
  'exec':lambda self=self: print(self.rd_ui()),
4789
4933
  }
4790
4934
  count+=1
4935
+ self.options[str(uuid1())]={
4936
+ 'cmds':["#"+str(count),*[i for i in generate_cmds(startcmd=["set inlist","sil"],endCmd=["qty",])]],
4937
+ 'desc':f"set Entry's with InList==True to value",
4938
+ 'exec':lambda self=self: print(self.set_inList()),
4939
+ }
4940
+ count+=1
4791
4941
  #self.product_history=
4792
4942
 
4793
4943
  '''
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.458'
1
+ VERSION='0.0.460'
Binary file
radboy/code.png CHANGED
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.458
3
+ Version: 0.0.460
4
4
  Summary: A small example package
5
5
  Author: Carl Joseph Hirner III
6
6
  Author-email: Carl Hirner III <k.j.hirner.wisdom@gmail.com>
@@ -5,12 +5,12 @@ 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=jzI8mERdqmxqp9XslL15CtjRX90DldgCjMKKxGq56Lo,17
8
+ radboy/__init__.py,sha256=_auH3f3uw_Q1llr9-QCbdDOXPfyUbdwVSOBLDF_ndrY,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
12
12
  radboy/changelog.txt,sha256=_73e-OcHDecsK-eHEE45T84zHbUZ8Io3FzvLNwHPdoY,3714
13
- radboy/code.png,sha256=YKN-2pqd2YzmW1I4CJzQYissselOYGZDWZ6M-j051pI,663
13
+ radboy/code.png,sha256=QtATCUkppebsmSMEFmf2EIANO4KrlDrD4ylIFpSpuYw,1059
14
14
  radboy/db.csv,sha256=hpecu18LtCow5fH01queqWgqPByR628K7pLuEuLSuj4,19
15
15
  radboy/dictionary.txt,sha256=EJlEazI8RfTDX_Uzd6xnXLm9IjU5AEq6HVDwi42Y4_4,195680
16
16
  radboy/export.csv,sha256=YIU8c34enlknKMzKwzfQEN8e0mUdyW8m6O8GvgUQ9do,41015
@@ -85,7 +85,7 @@ radboy/DB/ExerciseTracker.py,sha256=CZ8jdKJiAE_QTAiJTRXi8ZOnS1NUiSvWVSKLHLpYVGk,
85
85
  radboy/DB/PayDay.py,sha256=H2kPGvBCDkMOz7lbxQhYtUt_oAInpxi37Q6MFrah98I,8710
86
86
  radboy/DB/PayModels.py,sha256=hjwWxP7PL33hmfzQl5YTf0HqzaMxXJxFknPdxFJXJc8,3499
87
87
  radboy/DB/PrintLogging.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
- radboy/DB/Prompt.py,sha256=qOQOvOAdVMvlKTkEQcaXWa0DCfdSjTobxSv32vs-uhQ,141739
88
+ radboy/DB/Prompt.py,sha256=zQCZvZapPCtLZ5SE2cUHkB0o2WQELllNz_UsOfwwoRo,142906
89
89
  radboy/DB/RandomStringUtil.py,sha256=eZCpR907WStgfbk4Evcghjv9hOkUDXH-iMXIq0-kXq8,24386
90
90
  radboy/DB/ResetTools.py,sha256=RbI-Ua7UlsN0S9qLqtEkTWvzyTZ6R-hHR3CW4NHlUPE,6660
91
91
  radboy/DB/SMLabelImporter.py,sha256=eUoBDxVUUEKGL2g_PwkASM67ZB7FmXtSnn4bCagskhY,4013
@@ -109,7 +109,7 @@ radboy/DB/__pycache__/FormBuilder.cpython-312.pyc,sha256=p1o-5SMRL8OXP_XQ5liUpf-
109
109
  radboy/DB/__pycache__/PrintLogging.cpython-312.pyc,sha256=pIAFqTi6OiQQORSc-oMH1zAbsdH7sY1TifxrN_QOvnU,148
110
110
  radboy/DB/__pycache__/Prompt.cpython-311.pyc,sha256=P2uPRpeqfLFtxieZ0JHBG3X_HZzWUCsFSLb_fpRqky0,6407
111
111
  radboy/DB/__pycache__/Prompt.cpython-312.pyc,sha256=6CcQ1gE2hcz3cKPjo4f6d7xNM2PTDnl8NzQG0Pme5BE,142886
112
- radboy/DB/__pycache__/Prompt.cpython-313.pyc,sha256=r2fXEtDzSaQKb-Ywzfn7R9HbfITexoEGzHwWev6Ills,218429
112
+ radboy/DB/__pycache__/Prompt.cpython-313.pyc,sha256=YePitPZWmNTQIR8RuHhywJiTveliA4upyPF2R4lCxg8,219593
113
113
  radboy/DB/__pycache__/RandomStringUtil.cpython-312.pyc,sha256=TrbEY89MuLmNlvoo5d8vOE6Dyshh5_EMlTZvk8MDVN4,48597
114
114
  radboy/DB/__pycache__/RandomStringUtil.cpython-313.pyc,sha256=MCcgVwV2Y-9rAY2FVaJZCKcou3HDX70EZudoiCigT0o,49217
115
115
  radboy/DB/__pycache__/ResetTools.cpython-311.pyc,sha256=4Vyc57iAAF0yRPjjglnVKovnTn8OoFIi6Zok3Wpj_YM,9292
@@ -340,7 +340,7 @@ radboy/SystemSettings/__pycache__/__init__.cpython-312.pyc,sha256=aIzp4Po0t8EhSA
340
340
  radboy/SystemSettings/__pycache__/__init__.cpython-313.pyc,sha256=QFDuoidxMWsGVLsy5lN-rDs6TP8nKJ4yyCyiamNOhwo,156
341
341
  radboy/TasksMode/ReFormula.py,sha256=REDRJYub-OEOE6g14oRQOLOQwv8pHqVJy4NQk3CCM90,2255
342
342
  radboy/TasksMode/SetEntryNEU.py,sha256=TTzlAT5rNXvXUAy16BHBq0hJOKhONYpPhdAfQKdTfGw,17364
343
- radboy/TasksMode/Tasks.py,sha256=8YRxz3yRoVjRLRAulfVcgqBVC6vfh_xg-N42lLPcosM,311209
343
+ radboy/TasksMode/Tasks.py,sha256=JehX_k5o3qvupOSdS9ua7UTpBFYKgLheoG_p1uZl7hA,319006
344
344
  radboy/TasksMode/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
345
345
  radboy/TasksMode/__pycache__/ReFormula.cpython-311.pyc,sha256=QEG3PwVw-8HTd_Mf9XbVcxU56F1fC9yBqWXYPLC39DU,4865
346
346
  radboy/TasksMode/__pycache__/ReFormula.cpython-312.pyc,sha256=aX7BWm2PPjCTnxsbGUitR-2h9hq4AjaBiHMrUXvIl0Y,3967
@@ -349,7 +349,7 @@ radboy/TasksMode/__pycache__/SetEntryNEU.cpython-312.pyc,sha256=pCdFj61aPKkHL6Sv
349
349
  radboy/TasksMode/__pycache__/SetEntryNEU.cpython-313.pyc,sha256=eSWkYvfm5RuRE5rbO5wI7XxzFyKnp6KlbphSqPAF2z4,20133
350
350
  radboy/TasksMode/__pycache__/Tasks.cpython-311.pyc,sha256=6QOTJnLiXSKdF81hkhy3vyrz49PPhS20s5_0X52g3Hw,131120
351
351
  radboy/TasksMode/__pycache__/Tasks.cpython-312.pyc,sha256=hyJwdaYaaRLdcrNxgg36diJ5iijX5_3I0UAORsj-6LU,310295
352
- radboy/TasksMode/__pycache__/Tasks.cpython-313.pyc,sha256=D-NsV0_EJYLdpJmQSFb6-5KmpZ55fB3u_PXeDrvRFLc,383814
352
+ radboy/TasksMode/__pycache__/Tasks.cpython-313.pyc,sha256=raXKFmureEN0O9we-1aF_OhVxOgkbZzol3QfZzmlsqY,392453
353
353
  radboy/TasksMode/__pycache__/__init__.cpython-311.pyc,sha256=PKV1JbihEacm639b53bZozRQvcllSkjGP3q8STVMxF4,234
354
354
  radboy/TasksMode/__pycache__/__init__.cpython-312.pyc,sha256=ERgnEvRMiGSecWp1BpNzLdSq_SdKw7GvFWUvUM7bLVw,272
355
355
  radboy/TasksMode/__pycache__/__init__.cpython-313.pyc,sha256=lvsTxukyvGKB3C0rdF9dQi_bvVh6ceDVINfwcuIsd0s,151
@@ -396,7 +396,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
396
396
  radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
397
397
  radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
398
398
  radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
399
- radboy/__pycache__/__init__.cpython-313.pyc,sha256=TZ7Yd6nRq_N-JpTa6rVEL8X_LMih-zqCbKbKs9y2FSY,165
399
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=fwVHfGHkvuehwHeJMRBXfxL_Yuh5sccGCc4vznNdj_Y,165
400
400
  radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
401
401
  radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
402
402
  radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
@@ -421,7 +421,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
421
421
  radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
422
422
  radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
423
423
  radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
424
- radboy-0.0.458.dist-info/METADATA,sha256=hoZ7ytcZidaGXfS6yeQD-EJFAbS0HquMmg0tLY32Ns8,1601
425
- radboy-0.0.458.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
426
- radboy-0.0.458.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
427
- radboy-0.0.458.dist-info/RECORD,,
424
+ radboy-0.0.460.dist-info/METADATA,sha256=3nYXoJl7SmgemsZ89dStSxV8ZbEhbvGcK1aruXUUlbM,1601
425
+ radboy-0.0.460.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
426
+ radboy-0.0.460.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
427
+ radboy-0.0.460.dist-info/RECORD,,