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

@@ -498,14 +498,23 @@ class OrderAndRxdUi():
498
498
  raise Exception(f"Not a registered as_('{as_}')")
499
499
  if fields is not None:
500
500
  fd=FormBuilder(data=fields)
501
+ if fd is None:
502
+ print("User Cancelled! OrderedAndRecieved_as(self,_exlcudes=[],as_=None,item=None)")
503
+ return
501
504
  return fd,fields
502
505
 
503
506
  def search(self,selector=False,menu=False):
504
- 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
505
512
  terms=self.filter(terms)
506
513
  def selectortext(results,page=False,self=self):
507
514
  def edit(i,self=self):
508
515
  edits=self.OrderedAndRecieved_as(as_="from_item",item=i)
516
+ if edits is None:
517
+ return
509
518
  with Session(ENGINE) as session:
510
519
  e=session.query(OrderedAndRecieved).filter(OrderedAndRecieved.oarid==i.oarid).first()
511
520
  if e is not None:
@@ -526,7 +535,7 @@ class OrderAndRxdUi():
526
535
  while not ready:
527
536
  menu=Control(func=FormBuilderMkText,ptext="edit/e or r/rm/del/delete/dlt",helpText="edit or delete",data="string")
528
537
  if menu is None:
529
- continue
538
+ return
530
539
  elif menu in ['d',]:
531
540
  print(std_colorize(i,num,ct))
532
541
  continue
@@ -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'
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.615'
1
+ VERSION='0.0.617'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.615
3
+ Version: 0.0.617
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=RPT__eJy3RnPrao_wMMSpB86wVB-fBjAV2vE_lYB76I,17
8
+ radboy/__init__.py,sha256=w8Vgjryml5m7dUwsWWtnxFXNqR3FK-SEcL6k5CHO4j8,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=h5NlGr3dNMXGWuCZwQpNT3lefKNT9LefIcbC74FpAwM,28715
86
+ radboy/DB/OrderedAndRxd.py,sha256=DgvGoWYOGbYBt4JUeL4JBQALQg3AQudZIvADd0MBMKU,29078
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
@@ -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=0alng2yCmLuFr4aoCjelBunj8SmuAWO3hZn3nvbqjyM,165
404
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=rcGRs4PWtlD1-kWmGdKBdBEz9ncS148xKxQRIkmWuvM,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.615.dist-info/METADATA,sha256=83mZIdCD6Wiav8FR8PwpS7yPGFQwIlFE0ZHg-zqoN9c,1662
433
- radboy-0.0.615.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
434
- radboy-0.0.615.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
435
- radboy-0.0.615.dist-info/RECORD,,
432
+ radboy-0.0.617.dist-info/METADATA,sha256=XMqNHAlZgRukZylPTjN6TxF7gcBFKsHU-FvGODezxl0,1662
433
+ radboy-0.0.617.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
434
+ radboy-0.0.617.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
435
+ radboy-0.0.617.dist-info/RECORD,,