radboy 0.0.373__py3-none-any.whl → 0.0.374__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.

@@ -824,6 +824,84 @@ class EntryDataExtrasMenu:
824
824
  session.refresh(extra)
825
825
  print(extra)
826
826
 
827
+ def edit_extra_field_from_entry(self,barcode=None):
828
+ with Session(ENGINE) as session:
829
+ if self.code is None or not isinstance(self.code,str):
830
+ if barcode != None:
831
+ search=barcode
832
+ else:
833
+ search=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Search? [Barcode,Code,Name]",helpText="searches Barcode,Code,Name",data="string")
834
+ if search in [None]:
835
+ return
836
+ else:
837
+ search=self.code
838
+ results=session.query(Entry).filter(or_(Entry.Barcode==search,Entry.Code==search,Entry.Barcode.icontains(search),Entry.Code.icontains(search),Entry.Name.icontains(search))).all()
839
+ ct=len(results)
840
+ if ct == 0:
841
+ print("No Results were Found!")
842
+ return
843
+ msg=[]
844
+ for num,i in enumerate(results):
845
+ msg.append(f"{Fore.cyan}{num}/{Fore.light_yellow}{num+1} of {Fore.light_red}{ct}{Fore.grey_50} -> {i.seeShort()}")
846
+ msg='\n'.join(msg)
847
+ product=None
848
+ while True:
849
+ print(msg)
850
+ index=Prompt.__init2__(None,func=FormBuilderMkText,ptext="which index do you wish to use?",helpText=msg,data="integer")
851
+ if index in [None,]:
852
+ return
853
+ try:
854
+ product=results[index]
855
+ break
856
+ except Exception as e:
857
+ print(e)
858
+ if product in [None,]:
859
+ return
860
+ print(f"edit_extra_field_from_entry(barcode={barcode})")
861
+ product_extras=session.query(EntryDataExtras).filter(EntryDataExtras.EntryId==product.EntryId)
862
+ LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
863
+ if not isinstance(LookUpState,bool):
864
+ LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=True,literal=False)
865
+ if LookUpState == True:
866
+ product_extras=product_extras.order_by(EntryDataExtras.doe.asc())
867
+ else:
868
+ product_extras=product_extras.order_by(EntryDataExtras.doe.desc())
869
+ extras=product_extras.all()
870
+ while True:
871
+ ct=len(extras)
872
+ lines=[]
873
+ for num,i in enumerate(extras):
874
+ lines.append(self.colorize(f"{i.field_name}[{i.field_type}] = {i.field_value} {Fore.grey_70}#created on {i.doe}",num,ct))
875
+ helpText='\n'.join(lines)
876
+ print(helpText)
877
+ which=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Which index(es) do you wish to edit?",helpText=helpText,data="list")
878
+ if which in [None,]:
879
+ return
880
+ elif isinstance(which,list):
881
+ for i in which:
882
+ try:
883
+ index=int(i)
884
+ if index in [i for i in range(len(extras))]:
885
+ extra=extras[index]
886
+ excludes=["doe","EntryId","ede_id","field_name","field_type"]
887
+ pth=f"{Fore.light_yellow}Editing {Fore.light_red}{extra.field_name}[{Fore.light_steel_blue}{extra.field_type}{Fore.light_red}]{Style.reset}"
888
+ print(pth)
889
+ data={i.name:{"default":getattr(extra,i.name),"type":str(i.type).lower()} for i in extra.__table__.columns if i.name not in excludes}
890
+ fd=FormBuilder(data=data,passThruText=pth)
891
+ if fd is None:
892
+ print("User Chose to completely cancel!")
893
+ return
894
+ toUpd8=session.query(EntryDataExtras).filter(EntryDataExtras.ede_id==extra.ede_id).update(fd)
895
+ session.commit()
896
+ session.refresh(extra)
897
+ print(extra)
898
+ else:
899
+ print(f"Unknown Index('{index}')")
900
+ except Exception as e:
901
+ print(e)
902
+ else:
903
+ continue
904
+ break
827
905
 
828
906
  def sf2e(self,barcode=None):
829
907
  with Session(ENGINE) as session:
@@ -1385,7 +1463,12 @@ field_value={Fore.light_steel_blue}{field.field_value}{Fore.light_cyan},
1385
1463
  'cmds':['edee','ensure_extras_field_exists'],
1386
1464
  'exec':self.edee,
1387
1465
  'desc':'ensures last used field is applied to all Entry\'s [SLOW!!!]',
1388
- }
1466
+ },
1467
+ 'edit selected extra':{
1468
+ 'cmds':"edit selected extra from entry,esxfe".split(","),
1469
+ 'exec':self.edit_extra_field_from_entry,
1470
+ 'desc':'edit a selected EntryDataExtra from Entry Selection'
1471
+ },
1389
1472
  })
1390
1473
  '''
1391
1474
  elif doWhat.lower() in "sch f2e,ssf2e".split(","):
radboy/FB/FormBuilder.py CHANGED
@@ -13,7 +13,9 @@ from datetime import date,time,datetime
13
13
  from radboy.FB.FBMTXT import *
14
14
 
15
15
 
16
- def FormBuilder(data,extra_tooling=False):
16
+ def FormBuilder(data,extra_tooling=False,passThruText=None):
17
+ if passThruText != None:
18
+ passThruText=f"{Fore.light_green}{passThruText}: {Fore.light_yellow}"
17
19
  GOTOK=None
18
20
  def keys_index(data):
19
21
  for num,k in enumerate(data.keys()):
@@ -103,7 +105,7 @@ def FormBuilder(data,extra_tooling=False):
103
105
  lines=[]
104
106
  skip_review=False
105
107
  while True:
106
- line=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"You(m):{item.get(k)}|Default(d):{data[k]['default']} Field:{str(k)}",helpText=f'{ht}\nuse {Fore.light_red}{Style.bold}{Back.grey_50}#done#{Style.reset} to stop.',data=data[k]['type'][:-1])
108
+ line=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"{passThruText}You(m):{item.get(k)}|Default(d):{data[k]['default']} Field:{str(k)}",helpText=f'{ht}\nuse {Fore.light_red}{Style.bold}{Back.grey_50}#done#{Style.reset} to stop.',data=data[k]['type'][:-1])
107
109
  if line in [None,]:
108
110
  return
109
111
  elif line.lower() in ['#done#',]:
@@ -168,7 +170,7 @@ def FormBuilder(data,extra_tooling=False):
168
170
  lines.append(line)
169
171
  cmd='\n'.join(lines)
170
172
  if not skip_review:
171
- use=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"{cmd}\nUse? [y/n]",helpText="type something that can be represented as a boolean, this includes boolean formulas used in if/if-then statements(True=y/1/t/true/yes/1==1,False=n/no/0/f/false/1==0)",data="boolean")
173
+ use=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"{passThruText}{cmd}\nUse? [y/n]",helpText="type something that can be represented as a boolean, this includes boolean formulas used in if/if-then statements(True=y/1/t/true/yes/1==1,False=n/no/0/f/false/1==0)",data="boolean")
172
174
  if use in [None,]:
173
175
  return
174
176
  elif use:
@@ -179,7 +181,7 @@ def FormBuilder(data,extra_tooling=False):
179
181
  continue
180
182
  else:
181
183
  passThru=['gotoi','goto i','gotok','goto k','showkeys','show keys']
182
- cmd=Prompt.__init2__(None,func=lambda text,data:FormBuilderMkText(text,data,passThru=passThru),ptext=f"You(m):{item.get(k)}|Default(d):{data[k]['default']} Field:{str(k)}",helpText=f'{ht}',data=data[k]['type'])
184
+ cmd=Prompt.__init2__(None,func=lambda text,data:FormBuilderMkText(text,data,passThru=passThru),ptext=f"{passThruText} You(m):{item.get(k)}|Default(d):{data[k]['default']} Field:{str(k)}",helpText=f'{ht}',data=data[k]['type'])
183
185
  if cmd in [None,]:
184
186
  return
185
187
  elif isinstance(cmd,list) and [i.lower() for i in cmd] in [['gotoi',],['goto i']]:
@@ -226,7 +228,7 @@ def FormBuilder(data,extra_tooling=False):
226
228
  item[k]=cmd
227
229
  else:
228
230
  item[k]=cmd
229
- review=Prompt.__init2__(None,func=FormBuilderMkText,ptext="review?",helpText="",data="bool")
231
+ review=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"{passThruText}review?",helpText="",data="bool")
230
232
  #print(review)
231
233
  if review in ['f',]:
232
234
  review=False
@@ -242,14 +244,14 @@ def FormBuilder(data,extra_tooling=False):
242
244
  #ask if extra data is needed
243
245
  count=len(tmp_item)
244
246
  while True:
245
- nkv=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"New Key:Value Pair",helpText="yes or no",data="boolean")
247
+ nkv=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"{passThruText}New Key:Value Pair",helpText="yes or no",data="boolean")
246
248
  if nkv in ['d',True]:
247
- key=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"default[{count}] Key",helpText="yes or no",data="string")
249
+ key=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"{passThruText}default[{count}] Key",helpText="yes or no",data="string")
248
250
  if key in [None,]:
249
251
  continue
250
252
  elif key in ['d',]:
251
253
  key=str(count)
252
- value=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Value",helpText="data text",data="string")
254
+ value=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"{passThruText}Value",helpText="data text",data="string")
253
255
  if value in [None,]:
254
256
  continue
255
257
  tmp_item[key]=value
@@ -259,7 +261,7 @@ def FormBuilder(data,extra_tooling=False):
259
261
  #loop through lines for removal
260
262
  final_result={}
261
263
  for k in tmp_item:
262
- keep=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"['{tmp_item[k]}'] keep?",helpText="yes or no",data="boolean")
264
+ keep=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"{passThruText}['{tmp_item[k]}'] keep?",helpText="yes or no",data="boolean")
263
265
  if keep in ['d',True]:
264
266
  final_result[k]=tmp_item[k]
265
267
  return final_result
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.373'
1
+ VERSION='0.0.374'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.373
3
+ Version: 0.0.374
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,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=XXy-o5Z_yOgrgHNju4iqM3h7xhRBkNIoHG1qePtBnGY,41316
7
7
  radboy/Run.py,sha256=JUoCTHnzQBv7n8PB2_i93ANdAC_iW__RkAge8esCnk4,76
8
- radboy/__init__.py,sha256=YQSoQ-tYJM0ppU06UL05FJFANAdHWkB1_N9Wgv1jkC0,17
8
+ radboy/__init__.py,sha256=RubYMuOG7VFG0QXDgZQKkBcxURJdyRwFQ9wQIx5YVys,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
@@ -144,10 +144,10 @@ radboy/DayLog/__pycache__/DayLogger.cpython-313.pyc,sha256=9JJ5eSMw7twg7Px0Lf_5d
144
144
  radboy/DayLog/__pycache__/__init__.cpython-311.pyc,sha256=Z5Y4DdVF77LZf6-Of92MDGFdi-IXik1ASQd4AdLNNfQ,231
145
145
  radboy/DayLog/__pycache__/__init__.cpython-312.pyc,sha256=lP_GHzSPt5JTrT1jLWiRMFGPmSdJYBn4eRV__OxgJ6s,269
146
146
  radboy/DayLog/__pycache__/__init__.cpython-313.pyc,sha256=UQw5v4r7yismC9qcqP0dEme6h-lawbOA5pXYpkqUwFk,148
147
- radboy/EntryExtras/Extras.py,sha256=ePtClk4qYdDzofclop_XUZZZpL2PWnXxiCF2POnPQAs,69743
147
+ radboy/EntryExtras/Extras.py,sha256=7P3hIjOa55SuhxAStd4Hvqprpd-Y9C0gKHP7yYQBe64,74350
148
148
  radboy/EntryExtras/__init__.py,sha256=K76Ku7o2DwTZU-Ya2mifH856KAcxb8MXdSaQMQLhu84,902
149
149
  radboy/EntryExtras/__pycache__/Extras.cpython-312.pyc,sha256=eHkeyKblMtG37lDhl38OEGQbvvKxXMriKK49kj2mg8o,34768
150
- radboy/EntryExtras/__pycache__/Extras.cpython-313.pyc,sha256=qKCiQfAxEicBdkJWMnBqz_tY7RMuYGbBS1IqOcFw93E,89694
150
+ radboy/EntryExtras/__pycache__/Extras.cpython-313.pyc,sha256=3Jg_6u-1JismQFHgL0CtTSXKpGu0It93uuqXgdb_7XY,96091
151
151
  radboy/EntryExtras/__pycache__/__init__.cpython-312.pyc,sha256=0bBwhp_9PYvL-Nm_J0gsYf9yfKAFJMiMdpc6XzZrPzU,829
152
152
  radboy/EntryExtras/__pycache__/__init__.cpython-313.pyc,sha256=PqXXfBeREZI2pZc22BayKH7daLXbO7p3NozaXpnA3cQ,829
153
153
  radboy/EntryExtras/__pycache__/db.cpython-312.pyc,sha256=Qcqix5yi9h7fbsmGhJOWYdLHbHMTWixwolRRQYg8ISk,1781
@@ -189,12 +189,12 @@ radboy/ExtractPkg/__pycache__/__init__.cpython-311.pyc,sha256=62yPgrgPZffZFLr6Fs
189
189
  radboy/ExtractPkg/__pycache__/__init__.cpython-312.pyc,sha256=Ll1iKcG0MDtoCIloQ_frcihvCSe1HPtyERzcAoXwQT0,273
190
190
  radboy/ExtractPkg/__pycache__/__init__.cpython-313.pyc,sha256=kL3Y3KxCTaGNg3aq5fhf2fsnQHZolGfvniEUfsx2bwY,152
191
191
  radboy/FB/FBMTXT.py,sha256=5qfqBQkT_6PyxrW8og5_S9V3FJm2vlSMMvbfx2BUMeI,19283
192
- radboy/FB/FormBuilder.py,sha256=CZqbZev17-w67def3_2VABFH22q78_Uxc_G916TNrH8,14036
192
+ radboy/FB/FormBuilder.py,sha256=oOlGmvrUaAOVf0DpM_wlHKfIyz-Q8WU9pJRZ7XPzdQg,14275
193
193
  radboy/FB/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
194
194
  radboy/FB/__pycache__/FBMTXT.cpython-312.pyc,sha256=XCVFa7Mo83LGIdRrTvcK73siUpcVIEQfXKCH2QHeViw,9626
195
195
  radboy/FB/__pycache__/FBMTXT.cpython-313.pyc,sha256=8T151SE7c5gd3h2gyftDRQj7gVT0fluau0XKanuAEEQ,30867
196
196
  radboy/FB/__pycache__/FormBuilder.cpython-312.pyc,sha256=lNQdB-zApsXM7OQF9MIi0zRZD1SAL6stKEN-AyQiIKg,18873
197
- radboy/FB/__pycache__/FormBuilder.cpython-313.pyc,sha256=JQtq0r_h-1EJ_Q9m-VWN7Cv9nfAokau8EDQI92nrZSI,19408
197
+ radboy/FB/__pycache__/FormBuilder.cpython-313.pyc,sha256=WOX7ndix3aTqTaF01w1x4X_b-DX15RAoBdH7_L5NPCc,19706
198
198
  radboy/FB/__pycache__/__init__.cpython-312.pyc,sha256=ULEL8Au_CxcYpNAcSoSbI65M7-av1W6Zuy6kQJUu-Mw,265
199
199
  radboy/FB/__pycache__/__init__.cpython-313.pyc,sha256=Mp4kqFJa86-gyUu1vr9rubcUHUDr-O75hevV5IQdSFw,144
200
200
  radboy/GDOWN/GDOWN.py,sha256=Z5q6TR92I4eQpxhsJpOwhH__f1tK2IcGctPRw8OAEr8,798
@@ -386,7 +386,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
386
386
  radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
387
387
  radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
388
388
  radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
389
- radboy/__pycache__/__init__.cpython-313.pyc,sha256=IGiFseRfeEp0UE1ko1nbJocwIeeUjqFboCrcy8vvT4g,165
389
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=Y9yK0KEannCV4hOInwUjLrJtq0VQIB3iYXcnNlcPlqs,165
390
390
  radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
391
391
  radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
392
392
  radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
@@ -411,7 +411,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
411
411
  radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
412
412
  radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
413
413
  radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
414
- radboy-0.0.373.dist-info/METADATA,sha256=Uox3D7KFAPv_ZAL5JnyrYpJEVVRpNFabTthB-C26YRs,794
415
- radboy-0.0.373.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
416
- radboy-0.0.373.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
417
- radboy-0.0.373.dist-info/RECORD,,
414
+ radboy-0.0.374.dist-info/METADATA,sha256=xm2KS2gomT9p-HiGzOzTdS2JnjAdg2WaJaOtJNt_TIw,794
415
+ radboy-0.0.374.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
416
+ radboy-0.0.374.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
417
+ radboy-0.0.374.dist-info/RECORD,,