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

@@ -254,7 +254,18 @@ class SimpleScanUi:
254
254
  terse=False
255
255
  elif terse in ['d',]:
256
256
  terse=default
257
-
257
+ writeToFile=Control(func=FormBuilderMkText,ptext="writeToFile output [False/True] ",helpText=str(Path(db.detectGetOrSet('text2file','TextOut.txt',setValue=False,literal=True))),data="boolean")
258
+ if writeToFile is None:
259
+ return
260
+ elif writeToFile in ['NaN',]:
261
+ writeToFile=False
262
+ elif writeToFile in ['d',]:
263
+ writeToFile=default
264
+
265
+ if writeToFile:
266
+ outfile=Path(db.detectGetOrSet('text2file','TextOut.txt',setValue=False,literal=True))
267
+ outfile.open('w').write('')
268
+
258
269
  total=0
259
270
  with Session(ENGINE) as session:
260
271
  query=session.query(SimpleScan)
@@ -301,6 +312,8 @@ class SimpleScanUi:
301
312
  note=f" | Note = '''{i.Note}'''"
302
313
  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}{note}",num,cta)
303
314
  print(msg)
315
+ if writeToFile:
316
+ self.save2file_write(msg)
304
317
  if menu:
305
318
  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")
306
319
  if doWhat in [None,'NaN']:
@@ -334,8 +347,14 @@ class SimpleScanUi:
334
347
  print(msg)
335
348
  if (num % 15) == 0 and num > 0:
336
349
  print(f"{Fore.grey_70}{'*'*os.get_terminal_size().columns}")
350
+ if writeToFile:
351
+ self.save2file_write(f"{Fore.grey_70}{'*'*os.get_terminal_size().columns}")
337
352
  print(f"Total TimesScanned = {total}")
338
353
  print(FORMAT)
354
+ if writeToFile:
355
+ print(f"Written to {str(Path(db.detectGetOrSet('text2file','TextOut.txt',setValue=False,literal=True)))}")
356
+ self.save2file_write(f"Total TimesScanned = {total}")
357
+ self.save2file_write(strip_colors(FORMAT))
339
358
 
340
359
  def terse(self,i,num,cta):
341
360
  return 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)
@@ -384,6 +403,17 @@ class SimpleScanUi:
384
403
  elif terse in ['d',]:
385
404
  terse=default
386
405
  '''print the newest scan'''
406
+ writeToFile=Control(func=FormBuilderMkText,ptext="writeToFile output [False/True] ",helpText=str(Path(db.detectGetOrSet('text2file','TextOut.txt',setValue=False,literal=True))),data="boolean")
407
+ if writeToFile is None:
408
+ return
409
+ elif writeToFile in ['NaN',]:
410
+ writeToFile=False
411
+ elif writeToFile in ['d',]:
412
+ writeToFile=default
413
+
414
+ if writeToFile:
415
+ outfile=Path(db.detectGetOrSet('text2file','TextOut.txt',setValue=False,literal=True))
416
+ outfile.open('w').write('')
387
417
  with Session(ENGINE) as session:
388
418
  total=0
389
419
  query=session.query(SimpleScan)
@@ -410,12 +440,24 @@ class SimpleScanUi:
410
440
  msg=self.terse(i,num,cta)
411
441
  else:
412
442
  msg=std_colorize(f"{Fore.light_magenta}{__class__.__name__}{Fore.dark_goldenrod}{i}",num,cta)
413
-
443
+ if writeToFile:
444
+ self.save2file_write(strip_colors(msg))
414
445
  print(msg)
415
446
  if (num % 15) == 0 and num > 0:
416
447
  print(f"{Fore.grey_70}{'*'*os.get_terminal_size().columns}")
448
+ if writeToFile:
449
+ self.save2file_write(strip_colors(f"{Fore.grey_70}{'*'*os.get_terminal_size().columns}"))
417
450
  print(f"Total TimesScanned = {total}")
418
451
  print(FORMAT)
452
+ if writeToFile:
453
+ print(f"Written to {str(Path(db.detectGetOrSet('text2file','TextOut.txt',setValue=False,literal=True)))}")
454
+ self.save2file_write(f"Total TimesScanned = {total}")
455
+ self.save2file_write(strip_colors(FORMAT))
456
+
457
+ def clear_file(self):
458
+ with Path(db.detectGetOrSet('text2file','TextOut.txt',setValue=False,literal=True)).open('w') as out:
459
+ out.write('')
460
+ print("Cleared!")
419
461
 
420
462
  def last_DTOE(self):
421
463
  default=True
@@ -427,6 +469,18 @@ class SimpleScanUi:
427
469
  terse=False
428
470
  elif terse in ['d',]:
429
471
  terse=default
472
+ writeToFile=Control(func=FormBuilderMkText,ptext="writeToFile output [False/True] ",helpText=str(Path(db.detectGetOrSet('text2file','TextOut.txt',setValue=False,literal=True))),data="boolean")
473
+ if writeToFile is None:
474
+ return
475
+ elif writeToFile in ['NaN',]:
476
+ writeToFile=False
477
+ elif writeToFile in ['d',]:
478
+ writeToFile=default
479
+
480
+ if writeToFile:
481
+ outfile=Path(db.detectGetOrSet('text2file','TextOut.txt',setValue=False,literal=True))
482
+ outfile.open('w').write('')
483
+
430
484
  '''print the newest scan'''
431
485
  with Session(ENGINE) as session:
432
486
  total=0
@@ -456,12 +510,32 @@ class SimpleScanUi:
456
510
  msg=std_colorize(f"{Fore.light_magenta}{__class__.__name__}{Fore.dark_goldenrod}{i}",num,cta)
457
511
 
458
512
  print(msg)
513
+ if writeToFile:
514
+ self.save2file_write(strip_colors(msg))
459
515
  if (num % 15) == 0 and num > 0:
516
+ if writeToFile:
517
+ self.save2file_write(strip_colors(f"{Fore.grey_70}{'*'*os.get_terminal_size().columns}"))
460
518
  print(f"{Fore.grey_70}{'*'*os.get_terminal_size().columns}")
461
519
  print(f"Total TimesScanned = {total}")
520
+ if writeToFile:
521
+ print(f"Written to {str(Path(db.detectGetOrSet('text2file','TextOut.txt',setValue=False,literal=True)))}")
522
+ self.save2file_write(f"Total TimesScanned = {total}")
523
+ self.save2file_write(strip_colors(FORMAT))
462
524
  print(FORMAT)
463
525
 
464
526
 
527
+ def save2file_write(self,text):
528
+ outfile=Path(db.detectGetOrSet('text2file','TextOut.txt',setValue=False,literal=True))
529
+ with open(outfile,'a') as x:
530
+ otext=strip_colors(text+"\n")
531
+ if otext in [None,'d','']:
532
+ print("nothing was saved!")
533
+ if otext is None:
534
+ return
535
+ x.write(otext)
536
+ #print(f"wrote '{otext}' to '{outfile}'")
537
+
538
+
465
539
  def __init__(self):
466
540
  MENUDO="edit,delete, clear count,reset all fields"
467
541
  self.options={}
@@ -487,6 +561,11 @@ drop and regenerate SimpleScan Table
487
561
  'desc':f'List Scans',
488
562
  'exec':self.list_scan
489
563
  }
564
+ self.options[str(uuid1())]={
565
+ 'cmds':['clear file','clr fl',],
566
+ 'desc':f'clear outfile',
567
+ 'exec':self.clear_file
568
+ }
490
569
  self.options[str(uuid1())]={
491
570
  'cmds':['list scan search','lst scn sch','lst sch','list find','lst fnd'],
492
571
  'desc':f'List Scans with search by scanned text',
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.703'
1
+ VERSION='0.0.704'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.703
3
+ Version: 0.0.704
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=1S9xJ_YhgiHH4coMnxJ1qgm4Vrh1-9v9ZoltFtPLxvY,17
8
+ radboy/__init__.py,sha256=xW26G8ol_NbFc85bkPipYFtqZoVn4QlF5SxFGHf2_uE,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
@@ -102,7 +102,7 @@ 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=o9UnsJa2gV8gsc8CAITkJYXYRxlGVwSvbUN6EdBcwLQ,27959
105
+ radboy/DB/SimpleScanner/SimpleScanner.py,sha256=w8A82pk9IKM6-gcDWKYz8U64naCheh49wWRd0OO-Ygo,31967
106
106
  radboy/DB/SimpleScanner/__init__.py,sha256=BknbeGbEv48sqoCWwCQbKbgbqLUuBAyeeIh4EFerJ0g,899
107
107
  radboy/DB/__pycache__/DatePicker.cpython-311.pyc,sha256=VMJnJ7scb4VHMQi1HDZCF67KVYfb9m-fZK96IAoJzTQ,19676
108
108
  radboy/DB/__pycache__/DatePicker.cpython-312.pyc,sha256=cc5XWJ6Sbtcg0xWPz3SOP93VceIqr1pH42kjkLl5iYs,30294
@@ -404,7 +404,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
404
404
  radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
405
405
  radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
406
406
  radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
407
- radboy/__pycache__/__init__.cpython-313.pyc,sha256=WFcjG-TYPKomfP5UvkyIjcZXz3XNdbCDx5oZ1iTGiMg,165
407
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=qXdoii2sMKXFC66OkUdgQHDja4qAeJF0gLRtfsNS-FE,165
408
408
  radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
409
409
  radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
410
410
  radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
@@ -432,7 +432,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
432
432
  radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
433
433
  radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
434
434
  radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
435
- radboy-0.0.703.dist-info/METADATA,sha256=YJ1BjaWHzcPcABKX8jLoewzgS4mDj_9E6vtJwbxSS5Y,1891
436
- radboy-0.0.703.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
437
- radboy-0.0.703.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
438
- radboy-0.0.703.dist-info/RECORD,,
435
+ radboy-0.0.704.dist-info/METADATA,sha256=CLE8F1Z6I-GjCb7RE1__z_FJhfVYik9RijwAcIFzX20,1891
436
+ radboy-0.0.704.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
437
+ radboy-0.0.704.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
438
+ radboy-0.0.704.dist-info/RECORD,,