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

@@ -286,7 +286,7 @@ except Exception as e:
286
286
  OrderedAndRecieved.metadata.create_all(ENGINE)
287
287
 
288
288
  class OrderAndRxdUi():
289
- def between_dates(self,paged=False,limit=False,short_display=False):
289
+ def between_dates(self,query):
290
290
  '''list everything between start and end
291
291
  paged=True -> page results and use menu to edit/delete/stop paging
292
292
  paged=False -> print all at once
@@ -294,9 +294,27 @@ class OrderAndRxdUi():
294
294
  limit=False -> everything is printed
295
295
  short_display=True -> display less information
296
296
  '''
297
- with Session(ENGINE) as session:
298
- start=None
299
- end=None
297
+ start=Control(func=FormBuilderMkText,ptext="Start DateTime: ",helpText="starting datetime",data="datetime")
298
+ if start is None:
299
+ return
300
+ elif not isinstance(start,datetime):
301
+ return
302
+
303
+ end=Control(func=FormBuilderMkText,ptext="End DateTime: ",helpText="ending datetime",data="datetime")
304
+ if end is None:
305
+ return
306
+ elif not isinstance(end,datetime):
307
+ return
308
+ print(f""""
309
+ {Fore.orange_red_1}Results are for dates between
310
+ {Fore.light_green}Start: {start}
311
+ {Fore.light_red}End: {end}
312
+ {'-'*(os.get_terminal_size().columns-len(Style.reset))}{Style.reset}
313
+ """)
314
+ return orderQuery(query.filter(and_(
315
+ OrderedAndRecieved.dtoe >= start,
316
+ OrderedAndRecieved.dtoe <= end))
317
+ ,OrderedAndRecieved.dtoe,inverse=True)
300
318
 
301
319
  def fixtable(self):
302
320
  OrderedAndRecieved.__table__.drop(ENGINE)
@@ -323,7 +341,7 @@ class OrderAndRxdUi():
323
341
  #uncomment these to troubleshoot
324
342
  #print('x3',and_(*filte))
325
343
  #print('x4')
326
- return and_(*filte)
344
+
327
345
 
328
346
  def OrderedAndRecieved_as(self,_exlcudes=[],as_=None,item=None):
329
347
  excludes=['oarid',]
@@ -417,33 +435,43 @@ class OrderAndRxdUi():
417
435
  continue
418
436
 
419
437
 
420
- if terms is not None:
421
- with Session(ENGINE) as session:
422
- query=session.query(OrderedAndRecieved).filter(terms)
423
- query=orderQuery(query,OrderedAndRecieved.dtoe)
424
- results=query.all()
425
- ct=len(results)
426
- plural=''
427
- if ct > 1:
428
- plural="s"
429
- print(f"{ct} result{plural}!")
430
- zebra=0
431
-
432
-
433
- if selector:
434
- #for returning a list of OrderedAndRecieved
435
- selectortext(resuls)
436
- zebra+=1
437
- pass
438
- if menu:
439
- #for paged edit/delete of OrderedAndRecieved and returns None
440
- selectortext(results,page=True)
441
- zebra+=1
442
- pass
443
-
444
- if not(zebra > 0):
445
- for num,i in enumerate(results):
446
- print(std_colorize(i,num,ct))
438
+
439
+ with Session(ENGINE) as session:
440
+ query=session.query(OrderedAndRecieved)
441
+ if terms is not None:
442
+ query=query.filter(terms)
443
+ query=orderQuery(query,OrderedAndRecieved.dtoe)
444
+ between_dates=Control(func=FormBuilderMkText,ptext="Between dates? y/n",helpText="values between two dates",data="boolean")
445
+ if between_dates is None:
446
+ return None
447
+ if between_dates in ['d',False]:
448
+ pass
449
+ else:
450
+ query=self.between_dates(query)
451
+
452
+ results=query.all()
453
+ ct=len(results)
454
+ plural=''
455
+ if ct > 1:
456
+ plural="s"
457
+ print(f"{ct} result{plural}!")
458
+ zebra=0
459
+
460
+
461
+ if selector:
462
+ #for returning a list of OrderedAndRecieved
463
+ selectortext(resuls)
464
+ zebra+=1
465
+ pass
466
+ if menu:
467
+ #for paged edit/delete of OrderedAndRecieved and returns None
468
+ selectortext(results,page=True)
469
+ zebra+=1
470
+ pass
471
+
472
+ if not(zebra > 0):
473
+ for num,i in enumerate(results):
474
+ print(std_colorize(i,num,ct))
447
475
 
448
476
 
449
477
  def __init__(self,*args,**kwargs):
@@ -504,7 +532,7 @@ class OrderAndRxdUi():
504
532
  elif i in self.registry:
505
533
  self.cmds[cmd]['cmds'].pop(self.cmds[cmd]['cmds'].index(i))
506
534
  htext.append(std_colorize(f"{self.cmds[cmd]['cmds']} - {self.cmds[cmd]['desc']}",xnum,ct))
507
- htext=''.join(htext)
535
+ htext='\n'.join(htext)
508
536
  print(htext)
509
537
  while True:
510
538
  doWhat=Control(func=FormBuilderMkText,ptext=f"{self.__class__.__name__}:Do What what",helpText=htext,data="string")
@@ -538,6 +566,6 @@ class OrderAndRxdUi():
538
566
  for k in fd:
539
567
  setattr(t,k,fd[k])
540
568
  session.commit()
541
- session.refresh(t)
542
-
543
- print(t)
569
+ session.refresh(t)
570
+
571
+ print(t)
radboy/FB/FormBuilder.py CHANGED
@@ -11,7 +11,57 @@ import json
11
11
  from pathlib import Path
12
12
  from datetime import date,time,datetime
13
13
  from radboy.FB.FBMTXT import *
14
+ from copy import copy
15
+ from radboy.DB import db as DB
14
16
 
17
+ def findAndSelectKey(options=None):
18
+ if options is None:
19
+ options=[]
20
+ with Session(ENGINE) as session:
21
+ cmd=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"{Fore.light_red}[FindAndUse2]{Fore.light_yellow}what cmd are your looking for?",helpText="type the cmd",data="string")
22
+ if cmd in ['d',None]:
23
+ return
24
+ else:
25
+ options=copy(options)
26
+
27
+ session.query(DB.db.FindCmd).delete()
28
+ session.commit()
29
+ for num,k in enumerate(options):
30
+ stage=0
31
+ if isinstance(options,dict):
32
+ cmds=options[k]['cmds']
33
+ l=[]
34
+ l.extend(cmds)
35
+ l.append(options[k]['desc'])
36
+ else:
37
+ l=[]
38
+ l.extend(options)
39
+ cmdStr=' '.join(l)
40
+ cmd_string=DB.db.FindCmd(CmdString=cmdStr,CmdKey=k)
41
+ session.add(cmd_string)
42
+ if num % 50 == 0:
43
+ session.commit()
44
+ session.commit()
45
+ session.flush()
46
+
47
+ results=session.query(DB.db.FindCmd).filter(DB.db.FindCmd.CmdString.icontains(cmd)).all()
48
+
49
+
50
+ ct=len(results)
51
+ if ct == 0:
52
+ print(f"No Cmd was found by {Fore.light_red}{cmd}{Style.reset}")
53
+ return
54
+ for num,x in enumerate(results):
55
+ msg=DB.db.std_colorize(x.CmdKey,num,ct)
56
+ print(msg)
57
+ select=Prompt.__init2__(None,func=FormBuilderMkText,ptext="which index?",helpText="the number farthest to the left before the /",data="integer")
58
+ if select in [None,'d']:
59
+ return
60
+ try:
61
+ if select in list(i for i in range(len(options))):
62
+ return results[select].CmdKey
63
+ except Exception as e:
64
+ print(e)
15
65
 
16
66
  def FormBuilder(data,extra_tooling=False,passThruText=None):
17
67
  if passThruText != None:
@@ -96,6 +146,7 @@ def FormBuilder(data,extra_tooling=False,passThruText=None):
96
146
  {Fore.grey_70}*{Fore.light_yellow}goto {Fore.light_cyan}i{Fore.light_yellow}/goto{Fore.light_cyan}i{Fore.light_green} - go to {Fore.light_cyan}index{Style.reset}
97
147
  {Fore.grey_70}*{Fore.light_yellow}goto{Fore.light_cyan}k{Fore.light_yellow},goto {Fore.light_cyan}k{Fore.light_green} goto {Fore.light_cyan}key{Fore.light_green} for field in Form {Style.reset}
98
148
  {Fore.grey_70}*{Fore.light_yellow}showkeys{Fore.light_green} to see indexes refering to form keys{Style.reset}
149
+ {Fore.grey_70}*{Fore.light_yellow}'schk','search keys','sch ky{Fore.light_green} to search select and goto key{Style.reset}
99
150
  {Fore.grey_70}* {Fore.grey_50}These cmds only work with fields that return str/VARCHAR/TEXT/str+/list of str's, i.e. [str,]{Style.reset}"""
100
151
  print(ht2)
101
152
  FormBuilderHelpText()
@@ -151,6 +202,17 @@ def FormBuilder(data,extra_tooling=False,passThruText=None):
151
202
  finalize=True
152
203
  skip_review=True
153
204
  break
205
+ elif isinstance(line,str) and line.lower() in ['schk','search keys','sch ky']:
206
+ DATA={str(i):{'cmds':[i,],'desc':''} for i in data}
207
+ GOTOK=findAndSelectKey(options=DATA)
208
+ while GOTOK not in list(data.keys()):
209
+ GOTOK=setGOTOK_str(GOTOK)
210
+ if GOTOK in [None,]:
211
+ return
212
+ done=True
213
+ finalize=True
214
+ skip_review=True
215
+ break
154
216
  elif isinstance(line,str) and line.lower() in ['showkeys','show keys']:
155
217
  keys_index(data)
156
218
  '''
@@ -185,7 +247,7 @@ def FormBuilder(data,extra_tooling=False,passThruText=None):
185
247
  else:
186
248
  if_continue=False
187
249
  while True:
188
- passThru=['gotoi','goto i','gotok','goto k','showkeys','show keys','ff','finalize','finish']
250
+ passThru=['gotoi','goto i','gotok','goto k','showkeys','show keys','ff','finalize','finish','schk','search keys','sch ky']
189
251
  cmd=Prompt.__init2__(None,func=lambda text,data:FormBuilderMkText(text,data,passThru=passThru,PassThru=True),ptext=f"{passThruText} You(m):{item.get(k)}|Default(d):{data[k]['default']} Field:{str(k)}",helpText=f'{ht}',data=data[k]['type'])
190
252
  if cmd in [None,]:
191
253
  return
@@ -216,7 +278,16 @@ def FormBuilder(data,extra_tooling=False,passThruText=None):
216
278
  GOTOK=setGOTOK_str(data)
217
279
  if_continue=True
218
280
  break
219
-
281
+ elif isinstance(cmd,str) and cmd.lower() in ['schk','search keys','sch ky']:
282
+ DATA={str(i):{'cmds':[i,],'desc':''} for i in data}
283
+ GOTOK=findAndSelectKey(options=DATA)
284
+ print(GOTOK)
285
+ while GOTOK not in list(data.keys()):
286
+ GOTOK=setGOTOK_str(GOTOK)
287
+ if GOTOK in [None,]:
288
+ return
289
+ if_continue=True
290
+ break
220
291
  elif isinstance(cmd,str) and cmd.lower() in ['showkeys','show keys']:
221
292
  keys_index(data)
222
293
  continue
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.623'
1
+ VERSION='0.0.625'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.623
3
+ Version: 0.0.625
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=fBZ5VGRL7hGrbcfp01JvZHd8YCLR3k9xUFxN2sEGXK8,17
8
+ radboy/__init__.py,sha256=kM9c_XEi4wIBSRbfAb3gaCSwns39NLVMpTKPwRCr7FI,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=cGkArh68IUezdjmIUW7SyyMmlqc9I0nUk5tO97sD4FQ,22021
86
+ radboy/DB/OrderedAndRxd.py,sha256=PZ_Rbm0H3DFhHuN1SZEnd1RhEnKOU_L0X0MHXwYN3-s,23004
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
@@ -196,12 +196,12 @@ radboy/ExtractPkg/__pycache__/__init__.cpython-311.pyc,sha256=62yPgrgPZffZFLr6Fs
196
196
  radboy/ExtractPkg/__pycache__/__init__.cpython-312.pyc,sha256=Ll1iKcG0MDtoCIloQ_frcihvCSe1HPtyERzcAoXwQT0,273
197
197
  radboy/ExtractPkg/__pycache__/__init__.cpython-313.pyc,sha256=kL3Y3KxCTaGNg3aq5fhf2fsnQHZolGfvniEUfsx2bwY,152
198
198
  radboy/FB/FBMTXT.py,sha256=AVD6TV4b4D9OZN7ePZBIiSDnlWIe2a7kYvnhPTpVNiI,42121
199
- radboy/FB/FormBuilder.py,sha256=aa-Yrvnq1Qjw3mJFhA1me8dvbKLdSxnjfe4QhpGD3vQ,15141
199
+ radboy/FB/FormBuilder.py,sha256=v9Ax07LvOwpLlHqEXENO4HGvEyuQfoO-sJm7o8AhKj0,18516
200
200
  radboy/FB/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
201
201
  radboy/FB/__pycache__/FBMTXT.cpython-312.pyc,sha256=XCVFa7Mo83LGIdRrTvcK73siUpcVIEQfXKCH2QHeViw,9626
202
202
  radboy/FB/__pycache__/FBMTXT.cpython-313.pyc,sha256=nmunRZkKeCef8OqvHVjcC6Mc2eD6sNf-O61jaycHrKM,56467
203
203
  radboy/FB/__pycache__/FormBuilder.cpython-312.pyc,sha256=lNQdB-zApsXM7OQF9MIi0zRZD1SAL6stKEN-AyQiIKg,18873
204
- radboy/FB/__pycache__/FormBuilder.cpython-313.pyc,sha256=r1ZKoACDl-tgPwuGxGixzX-bgcdhDZUAnyG0HVSa6cY,19962
204
+ radboy/FB/__pycache__/FormBuilder.cpython-313.pyc,sha256=nJP30kg8NFod4fTA9cZdAdnz8osjrfNJuXK9QVnHOtI,24775
205
205
  radboy/FB/__pycache__/__init__.cpython-312.pyc,sha256=ULEL8Au_CxcYpNAcSoSbI65M7-av1W6Zuy6kQJUu-Mw,265
206
206
  radboy/FB/__pycache__/__init__.cpython-313.pyc,sha256=Mp4kqFJa86-gyUu1vr9rubcUHUDr-O75hevV5IQdSFw,144
207
207
  radboy/GDOWN/GDOWN.py,sha256=Z5q6TR92I4eQpxhsJpOwhH__f1tK2IcGctPRw8OAEr8,798
@@ -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=62bEorwVobvtSzIXeivag39_t3Hl1wdbUU_18Z3vLbI,165
404
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=PwghP7D7Hp6F0l9WfJ7UFwhWxDfCE2OFMs8I41QaQcI,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.623.dist-info/METADATA,sha256=_vlo7_QC_gHlGQg2EFnpXT7aVW_X5wZD4aZHySUIgA8,1662
433
- radboy-0.0.623.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
434
- radboy-0.0.623.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
435
- radboy-0.0.623.dist-info/RECORD,,
432
+ radboy-0.0.625.dist-info/METADATA,sha256=uRMe1S_9LCWLpD_c1OZFyGJQfnrw_ANTLHcKBTrAAns,1662
433
+ radboy-0.0.625.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
434
+ radboy-0.0.625.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
435
+ radboy-0.0.625.dist-info/RECORD,,