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

Binary file
radboy/DB/db.py CHANGED
@@ -29,50 +29,214 @@ import forecast_weather as fw
29
29
  import requests
30
30
  import holidays
31
31
  import platform
32
-
32
+ from uuid import uuid1
33
33
  import sys
34
34
 
35
- def switch_bootable():
36
- boot_dirs=Path("RadBoy_Boot_Directory")
37
- if not boot_dirs.exists():
38
- boot_dirs.mkdir()
35
+ class switch_bootable:
36
+ '''Template Cmd
37
+ str(uuid1()):{
38
+ 'cmds':[],
39
+ 'exec':None,
40
+ 'desc':""
41
+ },
39
42
 
40
- while True:
43
+ '''
44
+ def quick_parse(self,text,helptext='',no_dir_name=False):
45
+ if text.lower() in ['',]:
46
+ if no_dir_name:
47
+ return ''
48
+ else:
49
+ text=f"BOOTABLE {datetime.now().strftime('%m-%d-%Y')}"
50
+ return text
51
+ elif text.lower() in ['q','quit']:
52
+ exit("User quit!")
53
+ elif text.lower() in ['b','back']:
54
+ return None
55
+ elif text.lower() in ['?','h','help']:
56
+ print(helptext)
57
+ return False
58
+ else:
59
+ return text
60
+
61
+ def quick_parse_int(self,text,helptext=''):
62
+ if text.lower() in ['',]:
63
+ return None
64
+ elif text.lower() in ['q','quit',]:
65
+ exit("User quit!")
66
+ elif text.lower() in ['b','back']:
67
+ return None
68
+ elif text.lower() in ['?','h','help']:
69
+ print(helptext)
70
+ return False
71
+ else:
72
+ try:
73
+ val=int(text)
74
+ return val
75
+ except Exception as e:
76
+ return None
77
+
78
+ def mkBootBlank(self):
41
79
  try:
42
- bootable_dirs=[]
43
- bootable_dirs.append(str(Path(".").absolute()))
44
- for root,dirs,files in boot_dirs.walk(top_down=True):
45
- for d in dirs:
46
- dsub=root/d
47
- if dsub not in bootable_dirs:
48
- bootcfg=dsub/Path("__bootable__.py")
49
- if bootcfg.exists():
50
- bootable_dirs.append(dsub)
51
-
52
- htext=[]
53
- ct=len(bootable_dirs)
54
- for num,i in enumerate(bootable_dirs):
55
- msg=f"{Fore.light_green}{num}/{Fore.light_yellow}{num+1} of {Fore.light_red}{ct} -> {Fore.dark_goldenrod}{i}{Style.reset}"
56
- htext.append(msg)
57
- htext='\n'.join(htext)
58
- if ct > 0:
59
- print(htext)
60
- which=input("Please type an integer index for selection: ")
61
- if which.lower() in ['b','d','']:
80
+ while True:
81
+ bootdirname=self.quick_parse(input("Bootable Directory Name:"))
82
+ if bootdirname is None:
83
+ return
84
+ elif bootdirname is False:
85
+ continue
86
+ else:
62
87
  break
63
- elif which.lower() in ['q','quit']:
64
- exit("User chose to quit!")
65
- try:
66
- which=int(which)
67
- os.chdir(bootable_dirs[which])
88
+ bt=self.boot_dirs/Path(bootdirname)
89
+ if not bt.exists():
90
+ bt.mkdir(parents=True)
91
+ with open(bt/Path("__bootable__.py"),"wb") as bootfile:
92
+ bootfile.write(b'')
93
+ except Exception as e:
94
+ print(e,repr(e),str(e))
95
+
96
+ def rmboot(self):
97
+ try:
98
+ bootable_dirs=self.lsboot()
99
+ while True:
100
+ bootdirname=self.quick_parse_int(input("Bootable Directory index:"))
101
+ if bootdirname is None:
102
+ return
103
+ elif bootdirname is False:
104
+ continue
105
+ else:
68
106
  break
69
- except Exception as e:
70
- print(e)
71
- else:
72
- print("No Bootable Directories found!")
73
- break
107
+ if bootdirname == 0:
108
+ print(f"Cannot Delete the Root({bootable_dirs[0]}) instance!")
109
+ return
110
+ bt=bootable_dirs[bootdirname]
111
+ shutil.rmtree(bt)
74
112
  except Exception as e:
75
- print(e)
113
+ print(e,repr(e),str(e))
114
+
115
+
116
+ def cmdSystem(self):
117
+ cmds={
118
+ str(uuid1()):{
119
+ 'cmds':["mkblnkbt","mk_blnk_bt","make blank bootdir","mk blnk bt"],
120
+ 'exec':self.mkBootBlank,
121
+ 'desc':"make a new bootable instance directory that is completely blank"
122
+ },
123
+ str(uuid1()):{
124
+ 'cmds':['list boot','lsbt','lsboot','ls boot'],
125
+ 'exec':self.lsboot,
126
+ 'desc':"list boot dirs"
127
+ },
128
+ str(uuid1()):{
129
+ 'cmds':['remove boot','rmbt','rmboot','rm boot'],
130
+ 'exec':self.rmboot,
131
+ 'desc':"delete/remove a boot dir"
132
+ },
133
+ str(uuid1()):{
134
+ 'cmds':['boot','','bt'],
135
+ 'exec':self.legacy_start,
136
+ 'desc':"start the system by selecting instance"
137
+ },
138
+ }
139
+ cmdhtext=[]
140
+ ct=len(cmds)
141
+ for num,i in enumerate(cmds):
142
+ msg=self.static_colorize(f"{Fore.light_green}{cmds[i]['cmds']} - {Fore.green_yellow}{cmds[i]['desc']}",num,ct)
143
+ cmdhtext.append(msg)
144
+ cmdhtext='\n'.join(cmdhtext)
145
+
146
+ while True:
147
+ doWhat=self.quick_parse(input("Boot CMDS:"),helptext=cmdhtext,no_dir_name=True)
148
+ if doWhat is None:
149
+ exit("User Quit!")
150
+ elif doWhat is False:
151
+ continue
152
+ for cmd in cmds:
153
+ if doWhat.lower() in [str(i) for i in cmds[cmd]['cmds']]:
154
+ if callable(cmds[cmd]['exec']):
155
+ ready=cmds[cmd]['exec']()
156
+ print(ready)
157
+ if ready is True:
158
+ return
159
+ break
160
+ else:
161
+ print(f"cmd({cmds[cmd]['cmds']}) is not callable()")
162
+
163
+ def static_colorize(self,m,n,c):
164
+ msg=f'{Fore.cyan}{n}/{Fore.light_yellow}{n+1}{Fore.light_red} of {c} {Fore.dark_goldenrod}{m}{Style.reset}'
165
+ return msg
166
+
167
+ def __init__(self):
168
+ self.boot_dirs=Path("RadBoy_Boot_Directory")
169
+ self.cmdSystem()
170
+
171
+
172
+ #self.legacy_start()
173
+
174
+ def lsboot(self):
175
+ boot_dirs=self.boot_dirs
176
+ if not boot_dirs.exists():
177
+ boot_dirs.mkdir()
178
+ bootable_dirs=[]
179
+ bootable_dirs.append(str(Path(".").absolute()))
180
+ for root,dirs,files in boot_dirs.walk(top_down=True):
181
+ for d in dirs:
182
+ dsub=root/d
183
+ if dsub not in bootable_dirs:
184
+ bootcfg=dsub/Path("__bootable__.py")
185
+ if bootcfg.exists():
186
+ bootable_dirs.append(dsub)
187
+
188
+ htext=[]
189
+ ct=len(bootable_dirs)
190
+ for num,i in enumerate(bootable_dirs):
191
+ msg=f"{Fore.light_green}{num}/{Fore.light_yellow}{num+1} of {Fore.light_red}{ct} -> {Fore.dark_goldenrod}{i}{Style.reset}"
192
+ htext.append(msg)
193
+ htext='\n'.join(htext)
194
+ print(htext)
195
+ return bootable_dirs
196
+
197
+ def legacy_start(self):
198
+ boot_dirs=self.boot_dirs
199
+ if not boot_dirs.exists():
200
+ boot_dirs.mkdir()
201
+
202
+ while True:
203
+ try:
204
+ bootable_dirs=[]
205
+ bootable_dirs.append(str(Path(".").absolute()))
206
+ for root,dirs,files in boot_dirs.walk(top_down=True):
207
+ for d in dirs:
208
+ dsub=root/d
209
+ if dsub not in bootable_dirs:
210
+ bootcfg=dsub/Path("__bootable__.py")
211
+ if bootcfg.exists():
212
+ bootable_dirs.append(dsub)
213
+
214
+ htext=[]
215
+ ct=len(bootable_dirs)
216
+ for num,i in enumerate(bootable_dirs):
217
+ msg=f"{Fore.light_green}{num}/{Fore.light_yellow}{num+1} of {Fore.light_red}{ct} -> {Fore.dark_goldenrod}{i}{Style.reset}"
218
+ htext.append(msg)
219
+ htext='\n'.join(htext)
220
+ if ct > 0:
221
+ print(htext)
222
+ which=input("Please type an integer index for selection: ")
223
+ if which.lower() in ['d','']:
224
+ return True
225
+ elif which.lower() in ['b',]:
226
+ break
227
+ elif which.lower() in ['q','quit']:
228
+ exit("User chose to quit!")
229
+ try:
230
+ which=int(which)
231
+ os.chdir(bootable_dirs[which])
232
+ return True
233
+ except Exception as e:
234
+ print(e)
235
+ else:
236
+ print("No Bootable Directories found!")
237
+ return True
238
+ except Exception as e:
239
+ print(e)
76
240
  switch_bootable()
77
241
 
78
242
  def onAndroid()->bool:
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.341'
1
+ VERSION='0.0.343'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.341
3
+ Version: 0.0.343
4
4
  Summary: A small example package
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=XXy-o5Z_yOgrgHNju4iqM3h7xhRBkNIoHG1qePtBnGY,41316
7
7
  radboy/Run.py,sha256=JUoCTHnzQBv7n8PB2_i93ANdAC_iW__RkAge8esCnk4,76
8
- radboy/__init__.py,sha256=_t7xb17SIEi7VGo2rutycp_I7AxwfdlRT4jMvlRVkXY,17
8
+ radboy/__init__.py,sha256=Gce5KaUJBV88c4F6cpzQ09vordAY83qdp9hjOL-g1MY,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
@@ -90,7 +90,7 @@ radboy/DB/SMLabelImporter.py,sha256=eUoBDxVUUEKGL2g_PwkASM67ZB7FmXtSnn4bCagskhY,
90
90
  radboy/DB/__init__.py,sha256=JiigA9B7GalP7YuRdcwyGDu5PDSBahoi0lLjtScxlN8,49
91
91
  radboy/DB/blankDataFile.py,sha256=YX_05Usi71UpDkZN9UTMYwUipbTndTAtEgqzBEga0kE,9285
92
92
  radboy/DB/config.py,sha256=bvu43dUl1_yO3Zq3gsLuenGUgJSiS3S9Cs6ppFEvZbg,239
93
- radboy/DB/db.py,sha256=I-Ez1e11OCoiQ7u5MxLNLaVkC9UWTJ-fgARaBgeoJxk,222846
93
+ radboy/DB/db.py,sha256=yErJBnvCRZsnI5uHKuT8LMElxo5bm7IgtVLxahCF4Jg,228450
94
94
  radboy/DB/glossary_db.py,sha256=1_qxeEpjjEtpWB_eDjsgJisimLv7OBm75MuqM-Lt6zg,28218
95
95
  radboy/DB/masterLookup.py,sha256=DBaM2uscG3_X5dek49wjdnOzhrjWhKgvOEz_umdz0mY,4566
96
96
  radboy/DB/msg.txt,sha256=YxWed6A6tuP1djJ5QPS2Rz3ING4TKKf8kUiCCPtzHXE,7937
@@ -125,7 +125,7 @@ radboy/DB/__pycache__/config.cpython-312.pyc,sha256=Qo7E6MHrF6yqvKgepNFyCoekZXiv
125
125
  radboy/DB/__pycache__/config.cpython-313.pyc,sha256=_8wCIg_3jhyJjxnExD2Sm6aY-uZTw036p7Ki5znL7dc,376
126
126
  radboy/DB/__pycache__/db.cpython-311.pyc,sha256=rNgigyBd0D-cg1JxKAS8t0B_k0IEJivgVlRaZE10Xis,210105
127
127
  radboy/DB/__pycache__/db.cpython-312.pyc,sha256=ANDJPC0RoavbmSKFxG15vC7B4rEGyVt7xRJt7XGY3OA,334609
128
- radboy/DB/__pycache__/db.cpython-313.pyc,sha256=dW1YzZ8NWsgxBF88zCO6GoHsLHjpeMkjy5stWgGMQ_w,352230
128
+ radboy/DB/__pycache__/db.cpython-313.pyc,sha256=csLzBC6c7DsldxlMdEifEdAuGB6QlpQTM86thm_Yjys,359934
129
129
  radboy/DB/__pycache__/glossary_db.cpython-312.pyc,sha256=8UL-29cKqtKovx0BANm6kzKKteef1BW_2qF3wumzst4,36023
130
130
  radboy/DB/__pycache__/glossary_db.cpython-313.pyc,sha256=Ke9bkvllGv5CK0JdT9DRvQ3MOdrXxoYv7TVLNkqLux0,36582
131
131
  radboy/DB/__pycache__/masterLookup.cpython-312.pyc,sha256=bQiOkmMwwHgcO18tYSWGQ-YUff4GQlKVhBMp1GoWAqY,6324
@@ -386,7 +386,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
386
386
  radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
387
387
  radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
388
388
  radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
389
- radboy/__pycache__/__init__.cpython-313.pyc,sha256=g80DWNyKD7MNXDWi1KWYPGiKJczT2AxtfIMwA2H5P5c,165
389
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=pf8jlTg7-yP4K5u0rL35XDw1_Ou_bMgs0JIEo8Ik07A,165
390
390
  radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
391
391
  radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
392
392
  radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
@@ -411,7 +411,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
411
411
  radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
412
412
  radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
413
413
  radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
414
- radboy-0.0.341.dist-info/METADATA,sha256=HAkkqmlGyMgGwVP663z_EKuunJvlLwMwOkxUraIgTEs,794
415
- radboy-0.0.341.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
416
- radboy-0.0.341.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
417
- radboy-0.0.341.dist-info/RECORD,,
414
+ radboy-0.0.343.dist-info/METADATA,sha256=LGn1L7iwhtofYdaEDXVWExYYX78aOofDSdCFQ8TG_Yw,794
415
+ radboy-0.0.343.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
416
+ radboy-0.0.343.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
417
+ radboy-0.0.343.dist-info/RECORD,,