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

@@ -57,6 +57,127 @@ class HealthLogUi:
57
57
  session.refresh(hl)
58
58
  print(std_colorize(f"Updated {hl}",0,1))
59
59
 
60
+ def search(self):
61
+ page=Prompt.__init2__(None,func=FormBuilderMkText,ptext="page?",helpText="page/display one at a time y/n",data="boolean")
62
+ if page in ['None',]:
63
+ return None
64
+ elif page in [True,'d']:
65
+ page=True
66
+ with localcontext() as CTX:
67
+ with Session(ENGINE) as session:
68
+ fields={
69
+ i.name:{
70
+ 'default':None,
71
+ 'type':str(i.type).lower()
72
+ } for i in HealthLog.__table__.columns
73
+ }
74
+ fd=FormBuilder(data=fields,passThruText="Your Search Terms `showkeys` and `gotoi` are useful.")
75
+ if fd is None:
76
+ return
77
+ FD={}
78
+ for i in fd:
79
+ if fd[i] is not None:
80
+ FD[i]=fd[i]
81
+ fd=FD
82
+ filte=[]
83
+ for i in fd:
84
+ if isinstance(fd[i],str):
85
+ filte.append(getattr(HealthLog,i).icontains(fd[i]))
86
+ else:
87
+ filte.append(getattr(HealthLog,i)==fd[i])
88
+ query=session.query(HealthLog).filter(and_(*filte))
89
+ ordered=orderQuery(query,HealthLog.DTOE)
90
+ lo={
91
+ 'limit':{
92
+ 'default':10,
93
+ 'type':'integer',
94
+ },
95
+ 'offset':{
96
+ 'type':'integer',
97
+ 'default':0,
98
+ }
99
+ }
100
+ lod=FormBuilder(data=lo,passThruText="Limit your results?")
101
+ if lod is None:
102
+ return
103
+
104
+ loq=limitOffset(query,lod['limit'],lod['offset'])
105
+ results=loq.all()
106
+ ct=len(results)
107
+ if len(results) < 1:
108
+ print("No Results!")
109
+ return
110
+ for num,i in enumerate(results):
111
+ view=[]
112
+ for x in i.__table__.columns:
113
+ if getattr(i,str(x.name)) not in [None]:
114
+ view.append(f'{Fore.green_3b}{Style.bold}{str(x.name)}{Fore.deep_sky_blue_1}={Fore.sea_green_2}{str(getattr(i,str(x.name)))}{Style.reset}')
115
+ msg=f"{'|'.join(view)}"
116
+ print(std_colorize(msg,num,ct))
117
+ if page:
118
+ n=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Next?",helpText="next, anything else is goes next, just b/q that diff",data="boolean")
119
+ if n in ['None',]:
120
+ return None
121
+ else:
122
+ continue
123
+
124
+
125
+ def searchText(self):
126
+ page=Prompt.__init2__(None,func=FormBuilderMkText,ptext="page?",helpText="page/display one at a time y/n",data="boolean")
127
+ if page in ['None',]:
128
+ return None
129
+ elif page in [True,'d']:
130
+ page=True
131
+ filte=[]
132
+ with localcontext() as CTX:
133
+ with Session(ENGINE) as session:
134
+ query=session.query(HealthLog)
135
+ fields=[i for i in HealthLog.__table__.columns if str(i.type).lower() in ['string','varchar','char','text']]
136
+
137
+ term=Control(func=FormBuilderMkText,ptext="What are you searching?",helpText="just text is searched.",data="string")
138
+ if term in [None,'NaN','d']:
139
+ return
140
+ else:
141
+ filte=[]
142
+ for i in fields:
143
+ filte.append((getattr(HealthLog,i.name).icontains(term)))
144
+
145
+ query=session.query(HealthLog).filter(or_(*filte))
146
+ ordered=orderQuery(query,HealthLog.DTOE)
147
+ lo={
148
+ 'limit':{
149
+ 'default':10,
150
+ 'type':'integer',
151
+ },
152
+ 'offset':{
153
+ 'type':'integer',
154
+ 'default':0,
155
+ }
156
+ }
157
+ lod=FormBuilder(data=lo,passThruText="Limit your results?")
158
+ if lod is None:
159
+ return
160
+
161
+ loq=limitOffset(query,lod['limit'],lod['offset'])
162
+ results=loq.all()
163
+ ct=len(results)
164
+ if len(results) < 1:
165
+ print("No Results!")
166
+ return
167
+ for num,i in enumerate(results):
168
+ view=[]
169
+ for x in i.__table__.columns:
170
+ if getattr(i,str(x.name)) not in [None]:
171
+ view.append(f'{Fore.green_3b}{Style.bold}{str(x.name)}{Fore.deep_sky_blue_1}={Fore.sea_green_2}{str(getattr(i,str(x.name)))}{Style.reset}')
172
+ msg=f"{'|'.join(view)}"
173
+ print(std_colorize(msg,num,ct))
174
+ if page:
175
+ n=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Next?",helpText="next, anything else is goes next, just b/q that diff",data="boolean")
176
+ if n in ['None',]:
177
+ return None
178
+ else:
179
+ continue
180
+
60
181
  def new_health_log(self):
61
182
  with Session(ENGINE) as session:
62
183
  hl=HealthLog()
@@ -572,6 +693,11 @@ class HealthLogUi:
572
693
 
573
694
 
574
695
  def showAllField(self,fields=[],not_none=[],total_drg=False,total_fd=False):
696
+ page=Prompt.__init2__(None,func=FormBuilderMkText,ptext="page?",helpText="page/display one at a time y/n",data="boolean")
697
+ if page in ['None',]:
698
+ return None
699
+ elif page in [True,'d']:
700
+ page=True
575
701
  unit_registry=pint.UnitRegistry()
576
702
  try:
577
703
  useDateRange=Prompt.__init2__(None,func=FormBuilderMkText,ptext="use a date range?",helpText="yes or no",data="boolean")
@@ -682,6 +808,12 @@ class HealthLogUi:
682
808
  view.append(f'{color_date}{Style.bold}{str(x.name)}{Fore.deep_sky_blue_1}={color}{str(getattr(i,str(x.name)))}{Style.reset}')
683
809
  msg=f"{Fore.light_green}{num}{Fore.light_yellow}/{num+1} of {Fore.light_red}{ct} ->{'|'.join(view)}"
684
810
  print(msg)
811
+ if page:
812
+ n=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Next?",helpText="next, anything else is goes next, just b/q that diff",data="boolean")
813
+ if n in ['None',]:
814
+ return None
815
+ else:
816
+ continue
685
817
  if total_drg or total_fd:
686
818
  print(f"{Fore.orange_red_1}Broken into Totals{Style.reset}")
687
819
  ct=len(dummy)
@@ -699,6 +831,12 @@ class HealthLogUi:
699
831
  view.append(f'{color_date}{Style.bold}{str(x.name)}{Fore.deep_sky_blue_1}={color}{str(getattr(i,str(x.name)))}{Style.reset}')
700
832
  msg=f"{Fore.light_green}{num}{Fore.light_yellow}/{num+1} of {Fore.light_red}{ct} ->{'|'.join(view)}"
701
833
  print(msg)
834
+ if page:
835
+ n=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Next?",helpText="next, anything else is goes next, just b/q that diff",data="boolean")
836
+ if n in ['None',]:
837
+ return None
838
+ else:
839
+ continue
702
840
  except Exception as e:
703
841
  print(e)
704
842
 
@@ -919,6 +1057,16 @@ class HealthLogUi:
919
1057
  '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',])
920
1058
  },
921
1059
  str(uuid1()):{
1060
+ 'cmds':generate_cmds(startcmd=['sch','search'],endCmd=['specific','spec','spcfc','finer']),
1061
+ 'desc':'search with formbuilder with just equals/icontains',
1062
+ 'exec':lambda self=self:self.search()
1063
+ },
1064
+ str(uuid1()):{
1065
+ 'cmds':generate_cmds(startcmd=['sch','search'],endCmd=['text','txt','str','t']),
1066
+ 'desc':'search with text only fields by term',
1067
+ 'exec':lambda self=self:self.searchText()
1068
+ },
1069
+ str(uuid1()):{
922
1070
  'cmds':['ordered and recieved','oar','ordered and rxd','ordered & rxd','ordered & recieved','o&r'],
923
1071
  'desc':'ordered and recieved journal',
924
1072
  'exec':lambda self=self:OrderAndRxdUi()
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.721'
1
+ VERSION='0.0.723'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.721
3
+ Version: 0.0.723
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=KI7Jmf3MX0Zng_YUvcjVKN2siyUOhaMAHQGzpPuX8KQ,41373
7
7
  radboy/Run.py,sha256=JUoCTHnzQBv7n8PB2_i93ANdAC_iW__RkAge8esCnk4,76
8
- radboy/__init__.py,sha256=4O88k8mFIYsjET9qpt_POXkjh7WzptHdy5JBHPOlOmc,17
8
+ radboy/__init__.py,sha256=KzukZQkFagF6sdE47blFXa_Jr96kiH_1YzOgExeX7G0,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
@@ -218,10 +218,10 @@ radboy/GeoTools/__pycache__/GeoClass.cpython-313.pyc,sha256=eZ6hpLKoic1XCb7BKKg-
218
218
  radboy/GeoTools/__pycache__/OSMClass.cpython-312.pyc,sha256=5RoT8_wiI8R7yb_B9FWIC7mALdGNoqyWtkzsjM2pbh0,40387
219
219
  radboy/GeoTools/__pycache__/__init__.cpython-312.pyc,sha256=Y7Xtrzwm44-xuY_4NK8aDjYfVmXIzUFWOyexJu9le8A,1238
220
220
  radboy/GeoTools/__pycache__/__init__.cpython-313.pyc,sha256=-bk9eEIxWZgHYZHtNJbrpubDRWkbdYNkGr5J7sVhyIE,1238
221
- radboy/HealthLog/HealthLog.py,sha256=kab1O3Pb_gwwCXzEHPUetq99cR-nf0ueSISqjL29Z4Y,37763
221
+ radboy/HealthLog/HealthLog.py,sha256=a1G8tT9NNyEJ0m9SN4AfJ5xRBAr48EY7rmoaxVor65A,42547
222
222
  radboy/HealthLog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
223
223
  radboy/HealthLog/__pycache__/HealthLog.cpython-312.pyc,sha256=hTo4o7jo9L2yqPZgzuKUw_kon_PVcCuTRguELTuLrIo,27946
224
- radboy/HealthLog/__pycache__/HealthLog.cpython-313.pyc,sha256=OQ-NlyGzqyvleIjFdnm-lVEmIoM0B0nXDVV9gD_7EUE,58838
224
+ radboy/HealthLog/__pycache__/HealthLog.cpython-313.pyc,sha256=tCVpsQ3q0fxzKrH2Ipj5pYC_h3F4uPedFZ0Jzyo4seg,67005
225
225
  radboy/HealthLog/__pycache__/__init__.cpython-312.pyc,sha256=yZrYKBk31pGSjCRqmqzpX409iw-muC1zsNO2ObqkGlY,272
226
226
  radboy/HealthLog/__pycache__/__init__.cpython-313.pyc,sha256=cqdZbEJKq9XVoVqDAwsW0pwwBBGSerJNWGlST3YVR3g,151
227
227
  radboy/InListRestore/ILR.py,sha256=s8fbbHLKQSVJX1VaeyGE-vdIUGBEbOPX29kRIG2j2WY,16847
@@ -406,7 +406,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
406
406
  radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
407
407
  radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
408
408
  radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
409
- radboy/__pycache__/__init__.cpython-313.pyc,sha256=iVg1iZ45VdgL347nqfh5Lynu5SM02Sf3-4PQSqbxuBY,165
409
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=tIH_ZLvJR0hxsMsnUCGIQ2rx4uD5pey0vrkYcbzSguE,165
410
410
  radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
411
411
  radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
412
412
  radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
@@ -434,7 +434,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
434
434
  radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
435
435
  radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
436
436
  radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
437
- radboy-0.0.721.dist-info/METADATA,sha256=ErdHTnvy4AvvBnw2U7uaQEtZwKyr7YxwUoiSDtnzwcY,1891
438
- radboy-0.0.721.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
439
- radboy-0.0.721.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
440
- radboy-0.0.721.dist-info/RECORD,,
437
+ radboy-0.0.723.dist-info/METADATA,sha256=ZJvP1s6QlOkvdRshU356X_cpye583EEoseTVbxJtxX0,1891
438
+ radboy-0.0.723.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
439
+ radboy-0.0.723.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
440
+ radboy-0.0.723.dist-info/RECORD,,