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

radboy/DB/Prompt.py CHANGED
@@ -2453,10 +2453,14 @@ CMD's are not final until ended with {Fore.magenta}{hw_delim}{Style.reset}""")
2453
2453
  {Fore.grey_70}** {Fore.light_steel_blue}{generate_cmds(startcmd=['util','diff','eq'],endCmd=['text ','txt'])} {Fore.light_green}compare 2 strings/text and return True or False{Style.reset}
2454
2454
  {Fore.grey_70}** {Fore.light_steel_blue}{generate_cmds(startcmd=['util','diff','rules'],endCmd=['encounter-verify','ev'])} {Fore.light_green}confirm an encounter rules{Style.reset}
2455
2455
  {Fore.grey_70}** {Fore.light_steel_blue}['letter','message']{Fore.light_green} Generate a displayable letter from a default format, allowing to return the text as colored, or plain output; if a return is not desired, continue to the last prompt. using curly-braces you may attempt to write small python code to be evaluated and used as text in the message/letter. This includes colors from Fore,Back, and Style.{Style.reset}
2456
+ {Fore.grey_70}** {Fore.light_steel_blue}{generate_cmds(startcmd=['simple','smpl'],endCmd=['scanner','scanr','scnnr','scnr'])} {Fore.light_green}a scanner recorder that only records the text,times scanned,and dtoe, and when when time permits, comment.{Style.reset}
2456
2457
  '''
2457
2458
  print(extra)
2458
2459
  print(helpText)
2459
2460
  continue
2461
+ elif cmd.lower() in generate_cmds(startcmd=['simple','smpl'],endCmd=['scanner','scanr','scnnr','scnr']):
2462
+ TM.Tasks.TasksMode(parent=self,engine=db.ENGINE,init_only=True).simple_scanner()
2463
+ continue
2460
2464
  elif cmd.lower() in generate_cmds(startcmd=['util','checksum','cksm'],endCmd=['sha512 ','sha512']):
2461
2465
  text=Control(func=FormBuilderMkText,ptext="Text: ",helpText="text for a checksum",data="str")
2462
2466
  if text is None:
@@ -0,0 +1,467 @@
1
+ from . import *
2
+
3
+ @dataclass
4
+ class SimpleScan(BASE,Template):
5
+ __tablename__="SimpleScan"
6
+ ssid=Column(Integer,primary_key=True)
7
+
8
+ ScannedText=Column(String,default=None)
9
+ TimesScanned=Column(Float,default=0)
10
+ DTOE=Column(DateTime,default=datetime.now())
11
+
12
+ Note=Column(Text,default='')
13
+
14
+
15
+ try:
16
+ SimpleScan.metadata.create_all(ENGINE)
17
+ except Exception as e:
18
+ SimpleScan.__table__.drop(ENGINE)
19
+ SimpleScan.metadata.create_all(ENGINE)
20
+
21
+
22
+ class SimpleScanUi:
23
+ def fix_table(self):
24
+ SimpleScan.__table__.drop(ENGINE)
25
+ SimpleScan.metadata.create_all(ENGINE)
26
+
27
+ def scan_add(self,value=1):
28
+ default=False
29
+ ask_qty=Control(func=FormBuilderMkText,ptext=f"Ask For Qty Each Scan[False/True](default={default})",helpText="ask for a qty to add each time an item is selected",data="boolean")
30
+ if ask_qty is None:
31
+ return
32
+ elif ask_qty in ['NaN',]:
33
+ ask_qty=False
34
+ elif ask_qty in ['d',]:
35
+ ask_qty=default
36
+
37
+ if value is None:
38
+ if not ask_qty:
39
+ value=Control(func=FormBuilderMkText,ptext=f"+/- To old(1):",helpText="How much to decrement or increment",data="float")
40
+ if value in [None,'NaN']:
41
+ return
42
+ elif value in ['d',]:
43
+ value=1
44
+ else:
45
+ value=0
46
+
47
+ if value > 0:
48
+ inc="add/+"
49
+ by_with="to"
50
+ elif value < 0:
51
+ inc="subtract/-"
52
+ by_with="from"
53
+ else:
54
+ inc="modify"
55
+ by_with='with'
56
+ with Session(ENGINE) as session:
57
+ while True:
58
+ scanText=Control(func=FormBuilderMkText,ptext="Barcode/Code/Text",helpText="whatever it is you are scanning, its just text.",data="string")
59
+ if scanText is None:
60
+ return
61
+ elif scanText.lower() in ['d','','nan']:
62
+ continue
63
+ else:
64
+ pass
65
+ results=session.query(SimpleScan).filter(SimpleScan.ScannedText.icontains(scanText)).all()
66
+ cta=len(results)
67
+ if cta < 1:
68
+ if ask_qty:
69
+ value=Control(func=FormBuilderMkText,ptext=f"+/- To old(1):",helpText="How much to decrement or increment",data="float")
70
+ if value in [None,'NaN']:
71
+ return
72
+ elif value in ['d',]:
73
+ value=1
74
+ else:
75
+ value=1
76
+ scanned=SimpleScan(ScannedText=scanText,DTOE=datetime.now(),TimesScanned=value)
77
+ session.add(scanned)
78
+ session.commit()
79
+ elif cta == 1:
80
+ index=0
81
+ if ask_qty:
82
+ value=Control(func=FormBuilderMkText,ptext=f"+/- To old({results[index].TimesScanned}):",helpText="How much to decrement or increment",data="float")
83
+ if value in [None,'NaN']:
84
+ return
85
+ elif value in ['d',]:
86
+ value=1
87
+ results[index].TimesScanned+=value
88
+ session.commit()
89
+ else:
90
+ while True:
91
+ try:
92
+ htext=[]
93
+ for num,i in enumerate(results):
94
+ htext.append(std_colorize(i,num,cta))
95
+ htext='\n'.join(htext)
96
+ print(htext)
97
+ selected=Control(func=FormBuilderMkText,ptext=f"{Fore.orange_red_1}DUPLICATE SELECT{Fore.light_yellow} Which indexes do you wish to {inc} TimesScanned {by_with}?",helpText=htext,data="list")
98
+ if selected in [None,'NAN','NaN']:
99
+ return
100
+ elif selected in ['d',]:
101
+ selected=[0,]
102
+ for i in selected:
103
+ try:
104
+ index=int(i)
105
+ if index_inList(index,results):
106
+ if ask_qty:
107
+ value=Control(func=FormBuilderMkText,ptext=f"+/- To old({results[index].TimesScanned}):",helpText="How much to decrement or increment",data="float")
108
+ if value in [None,'NaN']:
109
+ return
110
+ elif value in ['d',]:
111
+ value=1
112
+ results[index].TimesScanned+=value
113
+ session.commit()
114
+ except Exception as e:
115
+ print(e)
116
+ break
117
+ except Exception as e:
118
+ print(e)
119
+
120
+
121
+ def findAndUse2(self):
122
+ with Session(ENGINE) as session:
123
+ 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")
124
+ if cmd in ['d',None]:
125
+ return
126
+ else:
127
+ options=copy(self.options)
128
+
129
+ session.query(FindCmd).delete()
130
+ session.commit()
131
+ for num,k in enumerate(options):
132
+ stage=0
133
+ cmds=options[k]['cmds']
134
+ l=[]
135
+ l.extend(cmds)
136
+ l.append(options[k]['desc'])
137
+ cmdStr=' '.join(l)
138
+ cmd_string=FindCmd(CmdString=cmdStr,CmdKey=k)
139
+ session.add(cmd_string)
140
+ if num % 50 == 0:
141
+ session.commit()
142
+ session.commit()
143
+ session.flush()
144
+
145
+ results=session.query(FindCmd).filter(FindCmd.CmdString.icontains(cmd)).all()
146
+
147
+
148
+ ct=len(results)
149
+ if ct == 0:
150
+ print(f"No Cmd was found by {Fore.light_red}{cmd}{Style.reset}")
151
+ return
152
+ for num,x in enumerate(results):
153
+ msg=f"{Fore.light_yellow}{num}/{Fore.light_steel_blue}{num+1} of {Fore.light_red}{ct} -> {Fore.turquoise_4}{f'{Fore.light_yellow},{Style.reset}{Fore.turquoise_4}'.join(options[x.CmdKey]['cmds'])} - {Fore.green_yellow}{options[x.CmdKey]['desc']}"
154
+ print(msg)
155
+ select=Prompt.__init2__(None,func=FormBuilderMkText,ptext="which index?",helpText="the number farthest to the left before the /",data="integer")
156
+ if select in [None,'d']:
157
+ return
158
+ try:
159
+ ee=options[results[select].CmdKey]['exec']
160
+ if callable(ee):
161
+ ee()
162
+ except Exception as e:
163
+ print(e)
164
+
165
+ def delete_all(self):
166
+ fieldname=f'{__class__.__name__}'
167
+ mode=f'DeleteAll'
168
+ h=f'{Prompt.header.format(Fore=Fore,mode=mode,fieldname=fieldname,Style=Style)}'
169
+
170
+ code=''.join([str(random.randint(0,9)) for i in range(10)])
171
+ verification_protection=detectGetOrSet("Protect From Delete",code,setValue=False,literal=True)
172
+ while True:
173
+ try:
174
+ really=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"{h}Really delete All SimpleScanItems?",helpText="yes or no boolean,default is NO",data="boolean")
175
+ if really in [None,]:
176
+ print(f"{Fore.light_steel_blue}Nothing was {Fore.orange_red_1}{Style.bold}Deleted!{Style.reset}")
177
+ return True
178
+ elif really in ['d',False]:
179
+ print(f"{Fore.light_steel_blue}Nothing was {Fore.orange_red_1}{Style.bold}Deleted!{Style.reset}")
180
+ return True
181
+ else:
182
+ pass
183
+ really=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"To {Fore.orange_red_1}Delete everything completely,{Fore.light_steel_blue}what is today's date?[{'.'.join([str(int(i)) for i in datetime.now().strftime("%m.%d.%y").split(".")])}]{Style.reset}",helpText="type y/yes for prompt or type as m.d.Y",data="datetime")
184
+ if really in [None,'d']:
185
+ print(f"{Fore.light_steel_blue}Nothing was {Fore.orange_red_1}{Style.bold}Deleted!{Style.reset}")
186
+ return True
187
+ today=datetime.today()
188
+ if really.day == today.day and really.month == today.month and really.year == today.year:
189
+ really=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Please type the verification code {Style.reset}'{Entry.cfmt(None,verification_protection)}'?",helpText=f"type '{Entry.cfmt(None,verification_protection)}' to finalize!",data="string")
190
+ if really in [None,]:
191
+ print(f"{Fore.light_steel_blue}Nothing was {Fore.orange_red_1}{Style.bold}Deleted!{Style.reset}")
192
+ return True
193
+ elif really in ['d',False]:
194
+ print(f"{Fore.light_steel_blue}Nothing was {Fore.orange_red_1}{Style.bold}Deleted!{Style.reset}")
195
+ return True
196
+ elif really == verification_protection:
197
+ break
198
+ else:
199
+ pass
200
+ except Exception as e:
201
+ print(e)
202
+ with Session(ENGINE) as session:
203
+ session.query(SimpleScan).delete()
204
+ session.commit()
205
+
206
+ def clear_all(self):
207
+ fieldname=f'{__class__.__name__}'
208
+ mode=f'ClearAll'
209
+ h=f'{Prompt.header.format(Fore=Fore,mode=mode,fieldname=fieldname,Style=Style)}'
210
+
211
+ code=''.join([str(random.randint(0,9)) for i in range(10)])
212
+ verification_protection=detectGetOrSet("Protect From Delete",code,setValue=False,literal=True)
213
+ while True:
214
+ try:
215
+ really=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"{h}Really Clear All SimpleScanItems to TimesScanned=0?",helpText="yes or no boolean,default is NO",data="boolean")
216
+ if really in [None,]:
217
+ print(f"{Fore.light_steel_blue}Nothing was {Fore.orange_red_1}{Style.bold}Cleared!{Style.reset}")
218
+ return True
219
+ elif really in ['d',False]:
220
+ print(f"{Fore.light_steel_blue}Nothing was {Fore.orange_red_1}{Style.bold}Cleared!{Style.reset}")
221
+ return True
222
+ else:
223
+ pass
224
+ really=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"To {Fore.orange_red_1}Clear everything completely,{Fore.light_steel_blue}what is today's date?[{'.'.join([str(int(i)) for i in datetime.now().strftime("%m.%d.%y").split(".")])}]{Style.reset}",helpText="type y/yes for prompt or type as m.d.Y",data="datetime")
225
+ if really in [None,'d']:
226
+ print(f"{Fore.light_steel_blue}Nothing was {Fore.orange_red_1}{Style.bold}Deleted!{Style.reset}")
227
+ return True
228
+ today=datetime.today()
229
+ if really.day == today.day and really.month == today.month and really.year == today.year:
230
+ really=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Please type the verification code {Style.reset}'{Entry.cfmt(None,verification_protection)}'?",helpText=f"type '{Entry.cfmt(None,verification_protection)}' to finalize!",data="string")
231
+ if really in [None,]:
232
+ print(f"{Fore.light_steel_blue}Nothing was {Fore.orange_red_1}{Style.bold}Cleared!{Style.reset}")
233
+ return True
234
+ elif really in ['d',False]:
235
+ print(f"{Fore.light_steel_blue}Nothing was {Fore.orange_red_1}{Style.bold}Cleared!{Style.reset}")
236
+ return True
237
+ elif really == verification_protection:
238
+ break
239
+ else:
240
+ pass
241
+ except Exception as e:
242
+ print(e)
243
+ with Session(ENGINE) as session:
244
+ session.query(SimpleScan).update({'TimesScanned':0,'DTOE':datetime.now(),'Note':''})
245
+ session.commit()
246
+
247
+ def list_scan(self,sch=False,dated=False,menu=False):
248
+ default=True
249
+ FORMAT=f"terse==short;default={default};output is short using {Fore.light_steel_blue}[- chunked ScannedText]{Fore.light_magenta}ScannedText:{Fore.light_red}ssid[{Fore.green_yellow}DTOE]={Fore.cyan}TimesScanned{Style.reset}"
250
+ terse=Control(func=FormBuilderMkText,ptext="Terse output [False/True] ",helpText=FORMAT,data="boolean")
251
+ if terse is None:
252
+ return
253
+ elif terse in ['NaN',]:
254
+ terse=False
255
+ elif terse in ['d',]:
256
+ terse=default
257
+
258
+ with Session(ENGINE) as session:
259
+ query=session.query(SimpleScan)
260
+
261
+ if dated:
262
+ start_date=Control(func=FormBuilderMkText,ptext="Start Date:",helpText="start date",data="datetime")
263
+ if start_date in [None,'NaN']:
264
+ return
265
+ elif start_date in ['d',]:
266
+ start_date=datetime.today()
267
+
268
+ end_date=Control(func=FormBuilderMkText,ptext="end Date:",helpText="end date",data="datetime")
269
+ if end_date in [None,'NaN']:
270
+ return
271
+ elif end_date in ['d',]:
272
+ end_date=datetime.today()
273
+ query=query.filter(and_(SimpleScan.DTOE<end_date,SimpleScan.DTOE>start_date))
274
+
275
+ if sch:
276
+ term=Control(func=FormBuilderMkText,ptext="What are you looking for? ",helpText="a string of text",data="string")
277
+ if term is None:
278
+ return
279
+ elif term in ['d','NaN']:
280
+ term=''
281
+ query=query.filter(SimpleScan.ScannedText.icontains(term))
282
+
283
+ query=orderQuery(query,SimpleScan.DTOE,inverse=True)
284
+ results=query.all()
285
+ cta=len(results)
286
+ if cta < 1:
287
+ print("There are no results!")
288
+ return
289
+ for num, i in enumerate(results):
290
+ if not terse:
291
+ msg=std_colorize(f"{Fore.light_magenta}{__class__.__name__}{Fore.dark_goldenrod}{i}",num,cta)
292
+ else:
293
+ if i.ScannedText == None:
294
+ i.ScannedText=''
295
+ chunked=stre(i.ScannedText)/4
296
+ chunked='-'.join(chunked)
297
+ msg=std_colorize(f"{Fore.light_steel_blue}[{chunked}]{Fore.light_magenta}{i.ScannedText}:{Fore.light_red}{i.ssid}[{Fore.green_yellow}{i.DTOE}] = {Fore.cyan}{i.TimesScanned} {Fore.dark_goldenrod}",num,cta)
298
+ print(msg)
299
+ if menu:
300
+ doWhat=Control(func=FormBuilderMkText,ptext="clear/clr, reset/rst, edit/e/ed, or delete/del/remove/rm (<Enter> Continues)?",helpText="clear/clr, reset/rst, edit/e/ed or delete/del/remove/rm?",data="string")
301
+ if doWhat in [None,'NaN']:
302
+ return
303
+ elif doWhat.lower() in "edit/e/ed".split("/"):
304
+ self.edit(i)
305
+ session.refresh(i)
306
+ if not terse:
307
+ msg=std_colorize(f"{Fore.light_magenta}{__class__.__name__}{Fore.dark_goldenrod}{i}",num,cta)
308
+ else:
309
+ msg=std_colorize(f"{Fore.light_magenta}{i.ScannedText}:{Fore.light_red}{i.ssid}[{Fore.green_yellow}{i.DTOE}] = {Fore.cyan}{i.TimesScanned} {Fore.dark_goldenrod}",num,cta)
310
+ print(msg)
311
+ elif doWhat.lower() in "delete/del/remove/rm".split("/"):
312
+ session.delete(i)
313
+ session.commit()
314
+ elif doWhat.lower() in "clear/clr".split("/"):
315
+ self.edit(i,clear=True)
316
+ session.refresh(i)
317
+ if not terse:
318
+ msg=std_colorize(f"{Fore.light_magenta}{__class__.__name__}{Fore.dark_goldenrod}{i}",num,cta)
319
+ else:
320
+ msg=std_colorize(f"{Fore.light_magenta}{i.ScannedText}:{Fore.light_red}{i.ssid}[{Fore.green_yellow}{i.DTOE}] = {Fore.cyan}{i.TimesScanned} {Fore.dark_goldenrod}",num,cta)
321
+ print(msg)
322
+ elif doWhat.lower() in "reset/rst".split("/"):
323
+ self.edit(i,reset=True)
324
+ session.refresh(i)
325
+ if not terse:
326
+ msg=std_colorize(f"{Fore.light_magenta}{__class__.__name__}{Fore.dark_goldenrod}{i}",num,cta)
327
+ else:
328
+ msg=std_colorize(f"{Fore.light_magenta}{i.ScannedText}:{Fore.light_red}{i.ssid}[{Fore.green_yellow}{i.DTOE}] = {Fore.cyan}{i.TimesScanned} {Fore.dark_goldenrod}",num,cta)
329
+ print(msg)
330
+
331
+ print(FORMAT)
332
+
333
+ def edit(self,i:SimpleScan,excludes=['ssid',],reset=False,clear=False):
334
+ if reset:
335
+ with Session(ENGINE) as session:
336
+ r=session.query(SimpleScan).filter(SimpleScan.ssid==i.ssid).first()
337
+ r.ScannedText=''
338
+ r.DTOE=datetime.now()
339
+ r.Note=''
340
+ r.TimesScanned=0
341
+ session.commit()
342
+ return
343
+
344
+ if clear:
345
+ with Session(ENGINE) as session:
346
+ r=session.query(SimpleScan).filter(SimpleScan.ssid==i.ssid).first()
347
+ r.DTOE=datetime.now()
348
+ r.Note=''
349
+ r.TimesScanned=0
350
+ session.commit()
351
+ return
352
+ fields={
353
+ x.name:{
354
+ 'default':getattr(i,x.name),
355
+ 'type':str(x.type).lower()
356
+ } for x in i.__table__.columns if x.name not in excludes
357
+ }
358
+ fd=FormBuilder(data=fields)
359
+ if fd is None:
360
+ return
361
+ with Session(ENGINE) as session:
362
+ r=session.query(SimpleScan).filter(SimpleScan.ssid==i.ssid).update(fd)
363
+ session.commit()
364
+
365
+ def __init__(self):
366
+ MENUDO="edit,delete, clear count,reset all fields"
367
+ self.options={}
368
+ self.options[str(uuid1())]={
369
+ 'cmds':generate_cmds(startcmd=["fix","fx"],endCmd=['tbl','table']),
370
+ 'desc':'''
371
+ drop and regenerate SimpleScan Table
372
+ ''',
373
+ 'exec':self.fix_table
374
+ }
375
+ self.options[str(uuid1())]={
376
+ 'cmds':['ca','clearall','clear all','clear-all','clear.all'],
377
+ 'desc':f'clear qty of simple scans',
378
+ 'exec':self.clear_all
379
+ }
380
+ self.options[str(uuid1())]={
381
+ 'cmds':['da','deleteall','delete all','delete-all','delete.all'],
382
+ 'desc':f'delete all of simple scans',
383
+ 'exec':self.delete_all
384
+ }
385
+ self.options[str(uuid1())]={
386
+ 'cmds':['list scan','lst scn',],
387
+ 'desc':f'List Scans',
388
+ 'exec':self.list_scan
389
+ }
390
+ self.options[str(uuid1())]={
391
+ 'cmds':['list scan search','lst scn sch','lst sch','list find','lst fnd'],
392
+ 'desc':f'List Scans with search by scanned text',
393
+ 'exec':lambda self=self:self.list_scan(sch=True)
394
+ }
395
+ self.options[str(uuid1())]={
396
+ 'cmds':['list scan dated','lst scn dt','lst dt','list dtd','lst d'],
397
+ 'desc':f'List Scans within start and end dates',
398
+ 'exec':lambda self=self:self.list_scan(dated=True)
399
+ }
400
+ self.options[str(uuid1())]={
401
+ 'cmds':['list scan search date','lst scn sch dt','lst sch dt','list find dt','lst fnd dt'],
402
+ 'desc':f'List Scans with search by scanned text between start and end dates',
403
+ 'exec':lambda self=self:self.list_scan(sch=True,dated=True)
404
+ }
405
+
406
+ self.options[str(uuid1())]={
407
+ 'cmds':['list scan menu','lst scn m',],
408
+ 'desc':f'List Scans with menu to {MENUDO}',
409
+ 'exec':lambda self=self:self.list_scan(menu=True)
410
+ }
411
+ self.options[str(uuid1())]={
412
+ 'cmds':['list scan search menu','lst scn sch m','lst sch m','list find menu','lst fnd m'],
413
+ 'desc':f'List Scans with search by scanned text with menu to {MENUDO}',
414
+ 'exec':lambda self=self:self.list_scan(sch=True,menu=True)
415
+ }
416
+ self.options[str(uuid1())]={
417
+ 'cmds':['list scan dated menu','lst scn dt m','lst dt m','list dtd m','lst d m'],
418
+ 'desc':f'List Scans within start and end dates with menu to {MENUDO}',
419
+ 'exec':lambda self=self:self.list_scan(dated=True,menu=True)
420
+ }
421
+ self.options[str(uuid1())]={
422
+ 'cmds':['list scan search date menu','lst scn sch dt m','lst sch dt m','list find dt m','lst fnd dt m'],
423
+ 'desc':f'List Scans with search by scanned text between start and end dates with menu to {MENUDO}',
424
+ 'exec':lambda self=self:self.list_scan(sch=True,dated=True,menu=True)
425
+ }
426
+
427
+ self.options[str(uuid1())]={
428
+ 'cmds':['scan1','scn1',],
429
+ 'desc':f'Scan and add {Fore.light_yellow}1{Fore.medium_violet_red}{Style.reset}',
430
+ 'exec':self.scan_add
431
+ }
432
+ self.options[str(uuid1())]={
433
+ 'cmds':['scan-multi','scan-batch','scn-btch','scn-mlt','scn1',],
434
+ 'desc':f'Scan and add a {Fore.light_yellow}Custom{Fore.medium_violet_red} value{Style.reset}',
435
+ 'exec':lambda:self.scan_add(value=None)
436
+ }
437
+ #new methods() start
438
+
439
+ #new methods() end
440
+ self.options[str(uuid1())]={
441
+ 'cmds':['fcmd','findcmd','find cmd'],
442
+ 'desc':f'Find {Fore.light_yellow}cmd{Fore.medium_violet_red} and excute for return{Style.reset}',
443
+ 'exec':self.findAndUse2
444
+ }
445
+
446
+ for num,i in enumerate(self.options):
447
+ if str(num) not in self.options[i]['cmds']:
448
+ self.options[i]['cmds'].append(str(num))
449
+ options=copy(self.options)
450
+
451
+ while True:
452
+ helpText=[]
453
+ for i in options:
454
+ msg=f"{Fore.light_green}{options[i]['cmds']}{Fore.light_red} -> {options[i]['desc']}{Style.reset}"
455
+ helpText.append(msg)
456
+ helpText='\n'.join(helpText)
457
+
458
+ cmd=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"{__class__.__name__}|Do What?:",helpText=helpText,data="string")
459
+ if cmd is None:
460
+ return None
461
+ result=None
462
+ for i in options:
463
+ els=[ii.lower() for ii in options[i]['cmds']]
464
+ if cmd.lower() in els:
465
+ options[i]['exec']()
466
+ break
467
+
@@ -0,0 +1,28 @@
1
+ from radboy.DB.db import *
2
+ from radboy.DB.RandomStringUtil import *
3
+ import radboy.Unified.Unified as unified
4
+ import radboy.possibleCode as pc
5
+ from radboy.DB.Prompt import *
6
+ from radboy.DB.Prompt import prefix_text
7
+ from radboy.TasksMode.ReFormula import *
8
+ from radboy.TasksMode.SetEntryNEU import *
9
+ from radboy.FB.FormBuilder import *
10
+ from radboy.FB.FBMTXT import *
11
+ from radboy.RNE.RNE import *
12
+ from radboy.Lookup2.Lookup2 import Lookup as Lookup2
13
+ from radboy.DayLog.DayLogger import *
14
+ from radboy.DB.masterLookup import *
15
+ from collections import namedtuple,OrderedDict
16
+ import nanoid,qrcode,io
17
+ from password_generator import PasswordGenerator
18
+ import random
19
+ from pint import UnitRegistry
20
+ import pandas as pd
21
+ import numpy as np
22
+ from datetime import *
23
+ from colored import Style,Fore
24
+ import json,sys,math,re,calendar,hashlib,haversine
25
+ from time import sleep
26
+ import itertools
27
+
28
+ from .SimpleScanner import *
Binary file
radboy/DB/db.py CHANGED
@@ -5949,4 +5949,4 @@ try:
5949
5949
  except Exception as e:
5950
5950
  print(e)
5951
5951
  TaxRate.__table__.drop(ENGINE)
5952
- TaxRate.metadata.create_all(ENGINE)
5952
+ TaxRate.metadata.create_all(ENGINE)
radboy/TasksMode/Tasks.py CHANGED
@@ -47,7 +47,7 @@ from radboy.Comm2Common import *
47
47
  import radboy.DB.OrderedAndRxd as OAR
48
48
  import radboy.DB.LetterWriter as LW
49
49
  from scipy.io.wavfile import write
50
-
50
+ from radboy.DB.SimpleScanner import SimpleScanner
51
51
 
52
52
  def today():
53
53
  dt=datetime.now()
@@ -1160,6 +1160,8 @@ def generateWhiteNoise():
1160
1160
 
1161
1161
 
1162
1162
  class TasksMode:
1163
+ def simple_scanner(self):
1164
+ SimpleScanner.SimpleScanUi()
1163
1165
  def white_noise(self):
1164
1166
  generateWhiteNoise()
1165
1167
 
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.665'
1
+ VERSION='0.0.668'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.665
3
+ Version: 0.0.668
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=JaZTGxBN1dPK9Tb_gAAXRe-Ty1yPBxy1ZHo8zys44vk,17
8
+ radboy/__init__.py,sha256=Rl9VwLyqrUPcsG7T4EjmdlVl5usLAHPe8ICDY0Ick-A,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
@@ -88,20 +88,22 @@ radboy/DB/OrderedAndRxd.py,sha256=PZ_Rbm0H3DFhHuN1SZEnd1RhEnKOU_L0X0MHXwYN3-s,23
88
88
  radboy/DB/PayDay.py,sha256=H2kPGvBCDkMOz7lbxQhYtUt_oAInpxi37Q6MFrah98I,8710
89
89
  radboy/DB/PayModels.py,sha256=hjwWxP7PL33hmfzQl5YTf0HqzaMxXJxFknPdxFJXJc8,3499
90
90
  radboy/DB/PrintLogging.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
91
- radboy/DB/Prompt.py,sha256=ZzA07Z3YEs7K0acYByQq1UI1xzOFWSrDnk5OW7ln_1s,174134
91
+ radboy/DB/Prompt.py,sha256=RvL5Kyjbg00V8j7uINRLw4JUOvlRF1JHl1OTTkkVmak,174661
92
92
  radboy/DB/RandomStringUtil.py,sha256=eZCpR907WStgfbk4Evcghjv9hOkUDXH-iMXIq0-kXq8,24386
93
93
  radboy/DB/ResetTools.py,sha256=RbI-Ua7UlsN0S9qLqtEkTWvzyTZ6R-hHR3CW4NHlUPE,6660
94
94
  radboy/DB/SMLabelImporter.py,sha256=eUoBDxVUUEKGL2g_PwkASM67ZB7FmXtSnn4bCagskhY,4013
95
95
  radboy/DB/__init__.py,sha256=JiigA9B7GalP7YuRdcwyGDu5PDSBahoi0lLjtScxlN8,49
96
96
  radboy/DB/blankDataFile.py,sha256=YX_05Usi71UpDkZN9UTMYwUipbTndTAtEgqzBEga0kE,9285
97
97
  radboy/DB/config.py,sha256=bvu43dUl1_yO3Zq3gsLuenGUgJSiS3S9Cs6ppFEvZbg,239
98
- radboy/DB/db.py,sha256=GuaulDuCPgH6LF5KqT1DQxC_HkzC5bsqtwtt2W-Uzg8,262819
98
+ radboy/DB/db.py,sha256=VCMe0fJ1pV6vAIBwOfQvipOUr7UeJoZI6yWHkMJXLtc,262820
99
99
  radboy/DB/glossary_db.py,sha256=1_qxeEpjjEtpWB_eDjsgJisimLv7OBm75MuqM-Lt6zg,28218
100
100
  radboy/DB/masterLookup.py,sha256=DBaM2uscG3_X5dek49wjdnOzhrjWhKgvOEz_umdz0mY,4566
101
101
  radboy/DB/msg.txt,sha256=YxWed6A6tuP1djJ5QPS2Rz3ING4TKKf8kUiCCPtzHXE,7937
102
102
  radboy/DB/rad_types.py,sha256=mtZpBMIFPcw1IhmO7UQ7nV_1gNNURs4INwx3x40hLUU,4725
103
103
  radboy/DB/renderText2Png.py,sha256=PWnTicLTfOPg9UlQYia3wMpjM9rh7MIyDVsmcsDRUBo,5678
104
104
  radboy/DB/testClass.py,sha256=t3zT1gbvReUncnPY8R9JUfKXQ5UEB2wmQx8DNeds0hI,310
105
+ radboy/DB/SimpleScanner/SimpleScanner.py,sha256=wSnqWfrUAJNE5QIaIVmrmSUpitDG7yoqQgbvfDGdY9s,23088
106
+ radboy/DB/SimpleScanner/__init__.py,sha256=BknbeGbEv48sqoCWwCQbKbgbqLUuBAyeeIh4EFerJ0g,899
105
107
  radboy/DB/__pycache__/DatePicker.cpython-311.pyc,sha256=VMJnJ7scb4VHMQi1HDZCF67KVYfb9m-fZK96IAoJzTQ,19676
106
108
  radboy/DB/__pycache__/DatePicker.cpython-312.pyc,sha256=cc5XWJ6Sbtcg0xWPz3SOP93VceIqr1pH42kjkLl5iYs,30294
107
109
  radboy/DB/__pycache__/DatePicker.cpython-313.pyc,sha256=jV__j5ER1oshsenGPynR0UNHWMI7VStgyw73-iLKxzg,33993
@@ -113,7 +115,7 @@ radboy/DB/__pycache__/FormBuilder.cpython-312.pyc,sha256=p1o-5SMRL8OXP_XQ5liUpf-
113
115
  radboy/DB/__pycache__/PrintLogging.cpython-312.pyc,sha256=pIAFqTi6OiQQORSc-oMH1zAbsdH7sY1TifxrN_QOvnU,148
114
116
  radboy/DB/__pycache__/Prompt.cpython-311.pyc,sha256=P2uPRpeqfLFtxieZ0JHBG3X_HZzWUCsFSLb_fpRqky0,6407
115
117
  radboy/DB/__pycache__/Prompt.cpython-312.pyc,sha256=6CcQ1gE2hcz3cKPjo4f6d7xNM2PTDnl8NzQG0Pme5BE,142886
116
- radboy/DB/__pycache__/Prompt.cpython-313.pyc,sha256=emGpBfQE4Oln1pqRnlE9j4w1nWWtnbTqkXWUQdZEhjQ,258770
118
+ radboy/DB/__pycache__/Prompt.cpython-313.pyc,sha256=Ke-daS6l0DhStSjLvGzutY_FfWWIylOby89nbMJH0UQ,259600
117
119
  radboy/DB/__pycache__/RandomStringUtil.cpython-312.pyc,sha256=TrbEY89MuLmNlvoo5d8vOE6Dyshh5_EMlTZvk8MDVN4,48597
118
120
  radboy/DB/__pycache__/RandomStringUtil.cpython-313.pyc,sha256=MCcgVwV2Y-9rAY2FVaJZCKcou3HDX70EZudoiCigT0o,49217
119
121
  radboy/DB/__pycache__/ResetTools.cpython-311.pyc,sha256=4Vyc57iAAF0yRPjjglnVKovnTn8OoFIi6Zok3Wpj_YM,9292
@@ -131,7 +133,7 @@ radboy/DB/__pycache__/config.cpython-312.pyc,sha256=Qo7E6MHrF6yqvKgepNFyCoekZXiv
131
133
  radboy/DB/__pycache__/config.cpython-313.pyc,sha256=_8wCIg_3jhyJjxnExD2Sm6aY-uZTw036p7Ki5znL7dc,376
132
134
  radboy/DB/__pycache__/db.cpython-311.pyc,sha256=rNgigyBd0D-cg1JxKAS8t0B_k0IEJivgVlRaZE10Xis,210105
133
135
  radboy/DB/__pycache__/db.cpython-312.pyc,sha256=ANDJPC0RoavbmSKFxG15vC7B4rEGyVt7xRJt7XGY3OA,334609
134
- radboy/DB/__pycache__/db.cpython-313.pyc,sha256=Q-cTX5QwWIUIvQDvmr2kBvZMkT64bGNOL5-vVGP6DgQ,412019
136
+ radboy/DB/__pycache__/db.cpython-313.pyc,sha256=dcZx_5o0wGn6q4oj8NqF6p3XQ_-5-RjbG0ocb5p1ces,412019
135
137
  radboy/DB/__pycache__/glossary_db.cpython-312.pyc,sha256=8UL-29cKqtKovx0BANm6kzKKteef1BW_2qF3wumzst4,36023
136
138
  radboy/DB/__pycache__/glossary_db.cpython-313.pyc,sha256=Ke9bkvllGv5CK0JdT9DRvQ3MOdrXxoYv7TVLNkqLux0,36582
137
139
  radboy/DB/__pycache__/masterLookup.cpython-312.pyc,sha256=bQiOkmMwwHgcO18tYSWGQ-YUff4GQlKVhBMp1GoWAqY,6324
@@ -346,7 +348,7 @@ radboy/SystemSettings/__pycache__/__init__.cpython-312.pyc,sha256=aIzp4Po0t8EhSA
346
348
  radboy/SystemSettings/__pycache__/__init__.cpython-313.pyc,sha256=QFDuoidxMWsGVLsy5lN-rDs6TP8nKJ4yyCyiamNOhwo,156
347
349
  radboy/TasksMode/ReFormula.py,sha256=REDRJYub-OEOE6g14oRQOLOQwv8pHqVJy4NQk3CCM90,2255
348
350
  radboy/TasksMode/SetEntryNEU.py,sha256=mkV9zAZe0lfpu_3coMuIILEzh6PgCNi7g9lJ4yDUpYM,20596
349
- radboy/TasksMode/Tasks.py,sha256=T-5htmLa912moGD5dfkYtvUYg84FZRNWjYU9OuP1NWk,355152
351
+ radboy/TasksMode/Tasks.py,sha256=90a79iRnHo3P_Fnvn2h18kv8S8bWTUJV1iNozSViQh4,355268
350
352
  radboy/TasksMode/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
351
353
  radboy/TasksMode/__pycache__/ReFormula.cpython-311.pyc,sha256=QEG3PwVw-8HTd_Mf9XbVcxU56F1fC9yBqWXYPLC39DU,4865
352
354
  radboy/TasksMode/__pycache__/ReFormula.cpython-312.pyc,sha256=aX7BWm2PPjCTnxsbGUitR-2h9hq4AjaBiHMrUXvIl0Y,3967
@@ -355,7 +357,7 @@ radboy/TasksMode/__pycache__/SetEntryNEU.cpython-312.pyc,sha256=pCdFj61aPKkHL6Sv
355
357
  radboy/TasksMode/__pycache__/SetEntryNEU.cpython-313.pyc,sha256=jMSrUX9pvEhf67uVwrPE2ZlBCems8V7tHJ1LcC15ovU,24603
356
358
  radboy/TasksMode/__pycache__/Tasks.cpython-311.pyc,sha256=6QOTJnLiXSKdF81hkhy3vyrz49PPhS20s5_0X52g3Hw,131120
357
359
  radboy/TasksMode/__pycache__/Tasks.cpython-312.pyc,sha256=hyJwdaYaaRLdcrNxgg36diJ5iijX5_3I0UAORsj-6LU,310295
358
- radboy/TasksMode/__pycache__/Tasks.cpython-313.pyc,sha256=INSBT7OsGawhX2J0zzG7KEhGich8fPXfPr3jVMV1kuA,429557
360
+ radboy/TasksMode/__pycache__/Tasks.cpython-313.pyc,sha256=0Oce_YV6-LNWK_6VprrXQDMdCr9NN_ihlT0FXdIwXLM,429819
359
361
  radboy/TasksMode/__pycache__/__init__.cpython-311.pyc,sha256=PKV1JbihEacm639b53bZozRQvcllSkjGP3q8STVMxF4,234
360
362
  radboy/TasksMode/__pycache__/__init__.cpython-312.pyc,sha256=ERgnEvRMiGSecWp1BpNzLdSq_SdKw7GvFWUvUM7bLVw,272
361
363
  radboy/TasksMode/__pycache__/__init__.cpython-313.pyc,sha256=lvsTxukyvGKB3C0rdF9dQi_bvVh6ceDVINfwcuIsd0s,151
@@ -402,7 +404,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
402
404
  radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
403
405
  radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
404
406
  radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
405
- radboy/__pycache__/__init__.cpython-313.pyc,sha256=9BPV8JfNDIDUFknlN_SsvSNocceug9tZK80fe_8hPx0,165
407
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=vp_zf7d3SRumJdA24N9dhbAgMedYrQ9vgnozCDjOe2A,165
406
408
  radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
407
409
  radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
408
410
  radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
@@ -430,7 +432,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
430
432
  radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
431
433
  radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
432
434
  radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
433
- radboy-0.0.665.dist-info/METADATA,sha256=sgT3KVxc3AeKAIqvpQz41tRUwHvR9aP2-Wm7BRooBTQ,1891
434
- radboy-0.0.665.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
435
- radboy-0.0.665.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
436
- radboy-0.0.665.dist-info/RECORD,,
435
+ radboy-0.0.668.dist-info/METADATA,sha256=T5LqC0kQ9YVGvJ9-jes7tYYRUlW1uQhR7Cmpa3DEWR8,1891
436
+ radboy-0.0.668.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
437
+ radboy-0.0.668.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
438
+ radboy-0.0.668.dist-info/RECORD,,