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

@@ -2,6 +2,7 @@ from radboy.DB.db import *
2
2
  from radboy.FB.FormBuilder import FormBuilder
3
3
  from copy import deepcopy as copy
4
4
  from radboy.ExportUtility import *
5
+ import radboy.HealthLog as HL
5
6
  def CountTo():
6
7
  fd={
7
8
  'Start':{
@@ -497,14 +498,23 @@ class OrderAndRxdUi():
497
498
  raise Exception(f"Not a registered as_('{as_}')")
498
499
  if fields is not None:
499
500
  fd=FormBuilder(data=fields)
501
+ if fd is None:
502
+ print("User Cancelled! OrderedAndRecieved_as(self,_exlcudes=[],as_=None,item=None)")
503
+ return
500
504
  return fd,fields
501
505
 
502
506
  def search(self,selector=False,menu=False):
503
- terms,z=self.OrderedAndRecieved_as(as_=None)
507
+ nantucket=self.OrderedAndRecieved_as(as_=None)
508
+ if nantucket is None:
509
+ print("User cancelled! search(self,selector=False,menu=False)")
510
+ return
511
+ terms,z=nantucket
504
512
  terms=self.filter(terms)
505
513
  def selectortext(results,page=False,self=self):
506
514
  def edit(i,self=self):
507
515
  edits=self.OrderedAndRecieved_as(as_="from_item",item=i)
516
+ if edits is None:
517
+ return
508
518
  with Session(ENGINE) as session:
509
519
  e=session.query(OrderedAndRecieved).filter(OrderedAndRecieved.oarid==i.oarid).first()
510
520
  if e is not None:
@@ -525,6 +535,7 @@ class OrderAndRxdUi():
525
535
  while not ready:
526
536
  menu=Control(func=FormBuilderMkText,ptext="edit/e or r/rm/del/delete/dlt",helpText="edit or delete",data="string")
527
537
  if menu is None:
538
+ ready=True
528
539
  continue
529
540
  elif menu in ['d',]:
530
541
  print(std_colorize(i,num,ct))
@@ -595,6 +606,11 @@ class OrderAndRxdUi():
595
606
  'desc':'drop and recreate table',
596
607
  'exec':lambda self=self:self.fixtable()
597
608
  }
609
+ self.cmds[uuid1()]={
610
+ 'cmds':generate_cmds(startcmd=['health','h',],endCmd=['log', 'l',]),
611
+ 'desc':'healthlog',
612
+ 'exec':lambda self=self:HL.HealthLog.HealthLogUi()
613
+ }
598
614
  self.cmds["ExportTables"]={
599
615
  'cmds':["export tables","xpttbl",],
600
616
  'desc':f'import/export selected tables to/from selected XLSX (Excel)/ODF',
@@ -223,6 +223,72 @@ class ExportTable:
223
223
  #print(key,dictionary,dictionary[key],rep,alt.encode())
224
224
  return dictionary
225
225
 
226
+ def import_x_from_excel(self):
227
+ print("Not Yet Ready")
228
+ return
229
+ import_file=Control(func=FormBuilderMkText,ptext="Filename: ",helpText="file to import from",data="string")
230
+ if import_file is None:
231
+ return
232
+ if not Path(import_file).exists():
233
+ print(f"file: {import_file} does not exist!")
234
+ return
235
+
236
+ try:
237
+ dtype={
238
+ }
239
+ df=pd.read_excel(import_file,dtype=dtype)
240
+ if len(df) < 2:
241
+ print("There is nothing to import")
242
+ return
243
+ with Session(ENGINE) as session:
244
+ for row in df.itertuples():
245
+ skip=False
246
+ entryRow=row._asdict()
247
+ classes=[i for i in BASE.registry.metadata.tables.keys()]
248
+ htext=[]
249
+ ct=len(classes)
250
+ for num,i in enumerate(classes):
251
+ htext.append(std_colorize(i,num,ct))
252
+ htext='\n'.join(htext)
253
+ print(htext)
254
+ import_as=Control(func=FormBuilderMkText,ptext="import as index:",helpText=htext,data="integer")
255
+ if import_as is None:
256
+ return
257
+ elif import_as in ['d','']:
258
+ return
259
+ if import_as in [i for i in range(0,ct)]:
260
+ CLASS=BASE.metadata.tables.get(classes[import_as])
261
+
262
+ with Session(ENGINE) as session:
263
+ for row in df.itertuples():
264
+ skip=False
265
+ entryRow=row._asdict()
266
+ try:
267
+ if import_as in [i for i in range(0,ct)]:
268
+ CLASS=BASE.metadata.tables.get(classes[import_as])
269
+ #i need the class for the table
270
+ entry=CLASS
271
+ else:
272
+ return
273
+
274
+ for k in entryRow:
275
+ print(row)
276
+ entryRow[k]=self.alterDictionary(entryRow,k)[k]
277
+ if k in excludes:
278
+ continue
279
+ try:
280
+ setattr(entry,k,entryRow[k])
281
+ except Exception as ee:
282
+ print(ee)
283
+ except Exception as e:
284
+ print(e)
285
+ session.add(entry)
286
+ session.commit()
287
+ '''get classes'''
288
+ except Exception as e:
289
+ print(e)
290
+
291
+
226
292
  def importExcel(self,update=False,duplicates=False,manual=False,ods=False):
227
293
  import_file=self.importFile()
228
294
  if ods:
@@ -368,6 +434,11 @@ enter goes to next entry row'''
368
434
  'exec':self.lsTables,
369
435
  'desc':'list tables in db',
370
436
  },
437
+ f'{uuid1()}':{
438
+ 'cmds':['import x from excel','ixfe'],
439
+ 'exec':self.import_x_from_excel,
440
+ 'desc':'import a class x from excel',
441
+ },
371
442
  'export selected':{
372
443
  'cmds':['export selected table','est','xpt slct tbl'],
373
444
  'exec':self.exportSelected,
@@ -388,27 +459,27 @@ enter goes to next entry row'''
388
459
  'exec':self.exportSelectedDaylogEntry,
389
460
  'desc':'Export a specific DayLog Entry Set by search'
390
461
  },
391
- 'import from excel no duplicates no update':{
462
+ 'import Entry from excel no duplicates no update':{
392
463
  'cmds':['ife_0d_0u','import from excel no duplicates no update'],
393
464
  'exec':self.importExcel,
394
465
  'desc':'import from excel no duplicates no update'
395
466
  },
396
- 'import from excel yes duplicates yes update update':{
467
+ 'import Entry from excel yes duplicates yes update update':{
397
468
  'cmds':['ife_1d_1u','import from excel yes duplicates yes update'],
398
469
  'exec':lambda self=self:self.importExcel(update=True,duplicates=True),
399
470
  'desc':'import from excel no duplicates yes update'
400
471
  },
401
- 'import from excel yes duplicates no update':{
472
+ 'import Entry from excel yes duplicates no update':{
402
473
  'cmds':['ife_1d_0u','import from excel yes duplicates no update'],
403
474
  'exec':lambda self=self:self.importExcel(update=False,duplicates=True),
404
475
  'desc':'import from excel yes duplicates no update'
405
476
  },
406
- 'import from excel with manual Intevention':{
477
+ 'import Entry from excel with manual Intevention':{
407
478
  'cmds':['ifem','import from excel manual Intevention'],
408
479
  'exec':lambda self=self:self.importExcel(manual=True,duplicates=True),
409
480
  'desc':'import from excel with manual Intevention'
410
481
  },
411
- 'export excel template':{
482
+ 'export Entry excel template':{
412
483
  'cmds':['export excel template','eet'],
413
484
  'exec':self.exportTemplateExcel,
414
485
  'desc':'export a blank template file'
@@ -27,6 +27,7 @@ import pint_pandas
27
27
  import radboy.DB.ExerciseTracker as ET
28
28
  import zipfile
29
29
  from copy import copy
30
+ from radboy.DB.OrderedAndRxd import *
30
31
 
31
32
  class HealthLogUi:
32
33
  def edit_hlid(self):
@@ -917,6 +918,11 @@ class HealthLogUi:
917
918
  'desc':'export data for diabete\'s dr.',
918
919
  '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',])
919
920
  },
921
+ str(uuid1()):{
922
+ 'cmds':['ordered and recieved','oar','ordered and rxd','ordered & rxd','ordered & recieved','o&r'],
923
+ 'desc':'ordered and recieved journal',
924
+ 'exec':lambda self=self:OrderAndRxdUi()
925
+ },
920
926
  'xpt consumed':{
921
927
  'cmds':['xptfd','xpt fd','xpt food','xpt-fd','xpt fuel','xpt fl','xlfl'],
922
928
  'desc':'export food',
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.614'
1
+ VERSION='0.0.616'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.614
3
+ Version: 0.0.616
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=0Kqa_tk0Yv0EjXIolvpbPQa4pVGQxpQYyKz3SFobq8k,17
8
+ radboy/__init__.py,sha256=OMXBHigtSW5gtZVn0EG5ZRyuYJgMEnaECVINkuTKg8I,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
@@ -83,7 +83,7 @@ radboy/DB/DatePicker.py,sha256=B75mDtXQrkHRCpoU9TJsaBVvkK37ykMaJyaiqGOo4dM,18334
83
83
  radboy/DB/DisplayItemDb.py,sha256=uVvrNyFyBuKvrw-BEPXKYvfa-QWyFN5ahESi2l6vUUA,52046
84
84
  radboy/DB/EstimatedPayCalendarWorkSheet.txt,sha256=GOjRSmGxFoNTdAnpPe2kGv7CkXDrh0Mee01HslamGbo,17173
85
85
  radboy/DB/ExerciseTracker.py,sha256=OS9i8jGIZPj-6m1bB0-eKNHQ6vf2iv_AYPEc0s4bkBM,27809
86
- radboy/DB/OrderedAndRxd.py,sha256=yBkpGG2AeDp5kT6gI36R10ptDfTgYI30_w-vNy2xKaA,28470
86
+ radboy/DB/OrderedAndRxd.py,sha256=1nitI8graVGGWIi6lTMYIXJQY5b7H1C9vzqgeoMVsN8,29119
87
87
  radboy/DB/PayDay.py,sha256=H2kPGvBCDkMOz7lbxQhYtUt_oAInpxi37Q6MFrah98I,8710
88
88
  radboy/DB/PayModels.py,sha256=hjwWxP7PL33hmfzQl5YTf0HqzaMxXJxFknPdxFJXJc8,3499
89
89
  radboy/DB/PrintLogging.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -172,10 +172,10 @@ radboy/ExportList/__pycache__/ExportListCurrent.cpython-313.pyc,sha256=dzQW8WMGX
172
172
  radboy/ExportList/__pycache__/__init__.cpython-311.pyc,sha256=Un4CG_te_VMBqYQel5c4jsw4sHe_LYZWSaXx_vVJL9w,235
173
173
  radboy/ExportList/__pycache__/__init__.cpython-312.pyc,sha256=NdzphL0FHS2zypVi1pG6SoNpv3v3ZynIN2WSl0VMnd8,273
174
174
  radboy/ExportList/__pycache__/__init__.cpython-313.pyc,sha256=xitjWDqLahSMr4qux3sM0AyU-LZF_5XYDKruBvnPr8I,152
175
- radboy/ExportUtility/ExportTableClass.py,sha256=QdHeu0j9IzgH6qDUjdZrPAki2s1nMax_PVs405MjzOc,16739
175
+ radboy/ExportUtility/ExportTableClass.py,sha256=6t3dXSlvnOhvNTSQmLg1OjjoYmgXwp3X5YvpzyXBpl0,18670
176
176
  radboy/ExportUtility/__init__.py,sha256=cybpF7RcHJkB2V6Fc37B5X2LLUfCtlveVpz8P4nRmo4,902
177
177
  radboy/ExportUtility/__pycache__/ExportTableClass.cpython-312.pyc,sha256=R3crrAJq1SZHaIEskRkNfm1kQ4akcfw8cXK0A8SQcZ8,30267
178
- radboy/ExportUtility/__pycache__/ExportTableClass.cpython-313.pyc,sha256=Rf1gsH_b5b6wClMjbNuY2kDkmo4j8ndC-vaRpLpwAgk,31740
178
+ radboy/ExportUtility/__pycache__/ExportTableClass.cpython-313.pyc,sha256=pHd-xqL0aL_85A1_R-mlyCP669LI2OaTfwe9F2j5Z6A,32743
179
179
  radboy/ExportUtility/__pycache__/__init__.cpython-312.pyc,sha256=acMdux6Y869oA-gpjY0Fem97iQwq9BAGNrW7AEzUnTI,1308
180
180
  radboy/ExportUtility/__pycache__/__init__.cpython-313.pyc,sha256=DrB-8MZCIcENUju5eBxf1tT9Gu5h71rwfayzgm7wx3M,1308
181
181
  radboy/ExtraTools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -213,10 +213,10 @@ radboy/GeoTools/__pycache__/GeoClass.cpython-313.pyc,sha256=eZ6hpLKoic1XCb7BKKg-
213
213
  radboy/GeoTools/__pycache__/OSMClass.cpython-312.pyc,sha256=5RoT8_wiI8R7yb_B9FWIC7mALdGNoqyWtkzsjM2pbh0,40387
214
214
  radboy/GeoTools/__pycache__/__init__.cpython-312.pyc,sha256=Y7Xtrzwm44-xuY_4NK8aDjYfVmXIzUFWOyexJu9le8A,1238
215
215
  radboy/GeoTools/__pycache__/__init__.cpython-313.pyc,sha256=-bk9eEIxWZgHYZHtNJbrpubDRWkbdYNkGr5J7sVhyIE,1238
216
- radboy/HealthLog/HealthLog.py,sha256=2RQxuqSV_fRPohAd5A2UenKwElpJ19XyWbnVl-mkZOg,37513
216
+ radboy/HealthLog/HealthLog.py,sha256=kab1O3Pb_gwwCXzEHPUetq99cR-nf0ueSISqjL29Z4Y,37763
217
217
  radboy/HealthLog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
218
218
  radboy/HealthLog/__pycache__/HealthLog.cpython-312.pyc,sha256=hTo4o7jo9L2yqPZgzuKUw_kon_PVcCuTRguELTuLrIo,27946
219
- radboy/HealthLog/__pycache__/HealthLog.cpython-313.pyc,sha256=Y8zL1bsKODV08MB265tVDQ0hfc1ZB2cr0dCcf7PKO0M,58477
219
+ radboy/HealthLog/__pycache__/HealthLog.cpython-313.pyc,sha256=OQ-NlyGzqyvleIjFdnm-lVEmIoM0B0nXDVV9gD_7EUE,58838
220
220
  radboy/HealthLog/__pycache__/__init__.cpython-312.pyc,sha256=yZrYKBk31pGSjCRqmqzpX409iw-muC1zsNO2ObqkGlY,272
221
221
  radboy/HealthLog/__pycache__/__init__.cpython-313.pyc,sha256=cqdZbEJKq9XVoVqDAwsW0pwwBBGSerJNWGlST3YVR3g,151
222
222
  radboy/InListRestore/ILR.py,sha256=s8fbbHLKQSVJX1VaeyGE-vdIUGBEbOPX29kRIG2j2WY,16847
@@ -401,7 +401,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
401
401
  radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
402
402
  radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
403
403
  radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
404
- radboy/__pycache__/__init__.cpython-313.pyc,sha256=ijmJcnTrIK74HVs6HFHFIcFnNBjGdbV8Faz-1IRAdZM,165
404
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=aNWL45MlMPGmI8aDzZesoqL_dNAsG6UZHiVZaKedrow,165
405
405
  radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
406
406
  radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
407
407
  radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
@@ -429,7 +429,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
429
429
  radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
430
430
  radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
431
431
  radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
432
- radboy-0.0.614.dist-info/METADATA,sha256=7vco8NmsuaZS1mjakAHsV9t3rPHBfihh-Jp--9dRnJU,1662
433
- radboy-0.0.614.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
434
- radboy-0.0.614.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
435
- radboy-0.0.614.dist-info/RECORD,,
432
+ radboy-0.0.616.dist-info/METADATA,sha256=6fh6pbwNEpp1hxcMO1hP7tyzA-HJOJMadzVSOljmkN0,1662
433
+ radboy-0.0.616.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
434
+ radboy-0.0.616.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
435
+ radboy-0.0.616.dist-info/RECORD,,