radboy 0.0.384__py3-none-any.whl → 0.0.386__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
@@ -5066,14 +5066,14 @@ class Scheduled_And_Appointments(BASE,Template):
5066
5066
  Establishment_ZIP_Code=Column(String,default="00000-0000")
5067
5067
  Establishment_Country=Column(String,default="Not Available")
5068
5068
 
5069
- StartTime=Column(Time,default=time(8,0))
5070
- EndTime=Column(Time,default=time(21,0))
5069
+ StartTime=Column(Time,default=None)
5070
+ EndTime=Column(Time,default=None)
5071
5071
 
5072
- StartDate=Column(Date,default=date(datetime.now().year,1,1))
5073
- EndDate=Column(Date,default=date(datetime.now().year,12,31))
5072
+ StartDate=Column(Date,default=None)
5073
+ EndDate=Column(Date,default=None)
5074
5074
 
5075
- StartDateTime=Column(DateTime,default=datetime(datetime.now().year,1,1))
5076
- EndDateTime=Column(DateTime,default=datetime(datetime.now().year,12,25))
5075
+ StartDateTime=Column(DateTime,default=None)
5076
+ EndDateTime=Column(DateTime,default=None)
5077
5077
 
5078
5078
  TotalCost=Column(Float,default=0.000)
5079
5079
  CoPay=Column(Float,default=0.000)
@@ -10,29 +10,75 @@ class BhTrSa_Gui:
10
10
  else:
11
11
  display_past_due=True
12
12
 
13
- stext=Prompt.__init2__(None,func=FormBuilderMkText,ptext="What are you looking for?",helpText="a textwise search",data="string")
13
+ most_recent_x=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Limit to First, or Last, of Results by X(default={sys.maxsize}):",helpText="an integer",data="integer")
14
+ if most_recent_x is None:
15
+ return
16
+ elif most_recent_x in ['d']:
17
+ most_recent_x=sys.maxsize
18
+
19
+ offset=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Offset to First, or Last, of Results by X(default=0):",helpText="an integer",data="integer")
20
+ if offset is None:
21
+ return
22
+ elif offset in ['d']:
23
+ offset=0
24
+
25
+ stext=Prompt.__init2__(None,func=FormBuilderMkText,ptext="What are you looking for?",helpText="a textwise search, but may include saa_id",data="string")
14
26
  if stext in [None,]:
15
27
  return
16
28
  lu_state=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
17
29
  includes=["varchar","string","str","text"]
18
30
  sfields=[str(i.name) for i in BusinessHours.__table__.columns if str(i.type).lower() in includes]
19
31
  with Session(ENGINE) as session:
32
+ def mquery(lu_state,display_past_due,squery,offset,most_recent_x):
33
+ if lu_state:
34
+ sorted_query=squery.order_by(Scheduled_And_Appointments.StartDate.asc(),Scheduled_And_Appointments.StartDateTime.asc(),Scheduled_And_Appointments.DTOE.asc())
35
+ else:
36
+ sorted_query=squery.order_by(Scheduled_And_Appointments.StartDate.desc(),Scheduled_And_Appointments.StartDateTime.desc(),Scheduled_And_Appointments.DTOE.desc())
37
+ now=datetime.now()
38
+ if not display_past_due:
39
+ sorted_query=sorted_query.filter(or_(
40
+ and_(Scheduled_And_Appointments.StartDate!=None,Scheduled_And_Appointments.StartDate>=date(now.year,now.month,now.day)),
41
+ and_(Scheduled_And_Appointments.StartDateTime !=None,Scheduled_And_Appointments.StartDateTime>=datetime(now.year,now.month,now.day))
42
+ )
43
+ )
44
+ else:
45
+ sorted_query=sorted_query.filter(or_(
46
+ and_(Scheduled_And_Appointments.StartDate!=None,Scheduled_And_Appointments.StartDate<=date(now.year,now.month,now.day)),
47
+ and_(Scheduled_And_Appointments.StartDateTime !=None,Scheduled_And_Appointments.StartDateTime<=datetime(now.year,now.month,now.day))
48
+ )
49
+ )
50
+ limited_query=sorted_query.offset(offset).limit(most_recent_x)
51
+
52
+ return limited_query
53
+
20
54
  query=session.query(Scheduled_And_Appointments)
21
- q=[]
22
- if stext != 'd':
23
- for i in sfields:
24
- q.append(getattr(Scheduled_And_Appointments,i).icontains(stext))
25
- squery=query.filter(or_(*q))
26
- else:
27
- squery=query
28
- if lu_state:
29
- sorted_query=squery.order_by(Scheduled_And_Appointments.DTOE.asc())
30
- else:
31
- sorted_query=squery.order_by(Scheduled_And_Appointments.DTOE.desc())
32
- now=datetime.now()
33
- if not display_past_due:
34
- sorted_query=sorted_query.filter(Scheduled_And_Appointments.StartDate>date(now.year,now.month,now.day))
35
- results=sorted_query.all()
55
+
56
+ def stage2(query,sfields,stext):
57
+ q=[]
58
+ if stext != 'd':
59
+ for i in sfields:
60
+ q.append(getattr(Scheduled_And_Appointments,i).icontains(stext))
61
+ squery=query.filter(or_(*q))
62
+ else:
63
+ squery=query
64
+ return squery
65
+
66
+ try:
67
+ print(stext)
68
+ if stext != 'd':
69
+ print(stext)
70
+ SAA_id=int(stext)
71
+ squery=query.filter(Scheduled_And_Appointments.saa_id==SAA_id)
72
+ else:
73
+ squery=stage2(query,sfields,stext)
74
+ squery=mquery(lu_state,display_past_due,squery,offset,most_recent_x)
75
+ except Exception as e:
76
+ print(f"{Fore.light_red}could not use '{stext}' as saa_id{Fore.light_steel_blue} this is not a failure{Style.reset}",e,repr(e))
77
+ squery=stage2(query,sfields,stext)
78
+ squery=mquery(lu_state,display_past_due,squery,offset,most_recent_x)
79
+
80
+ results=squery.all()
81
+ #sorted_query.all()
36
82
  ct=len(results)
37
83
  htext=[]
38
84
  if ct == 0:
@@ -344,8 +390,10 @@ class BhTrSa_Gui:
344
390
  fd=FormBuilder(data=fields)
345
391
  if fd is None:
346
392
  return
393
+
347
394
  for i in fd:
348
395
  setattr(newBH,i,fd[i])
396
+
349
397
  session.add(newBH)
350
398
  session.commit()
351
399
  session.refresh(newBH)
radboy/FB/FBMTXT.py CHANGED
@@ -1,7 +1,7 @@
1
1
  import radboy.TasksMode as TM
2
2
  import radboy.DB.db as db
3
3
  import string
4
- from datetime import datetime
4
+ from datetime import datetime,date,time
5
5
  from pathlib import Path
6
6
  from decimal import Decimal,getcontext
7
7
  import re
@@ -174,10 +174,73 @@ def FormBuilderMkText(text,data,passThru=[],PassThru=True,alternative_false=None
174
174
  value=text
175
175
  elif data.lower() == 'date':
176
176
  if text.lower() in ['y','yes','1','t','true']:
177
- value=value=TM.Tasks.TasksMode(parent=None,engine=db.ENGINE,init_only=True).DatePkr()
177
+ value=TM.Tasks.TasksMode(parent=None,engine=db.ENGINE,init_only=True).DatePkr()
178
+ else:
179
+ try:
180
+ def try_date(ds,format='%m%d%Y'):
181
+ try:
182
+ #print(format)
183
+ return datetime.strptime(ds,format)
184
+ except Exception as e:
185
+ #print(e)
186
+ return None
187
+ def process_ds(ds):
188
+ months=['january','february','march','april','may','june','july','august','september','october','november','december']
189
+ predate="%m{c}%d{c}{year}"
190
+ t1=[]
191
+ chars=[i for i in string.punctuation]
192
+ chars.pop(chars.index('%'))
193
+ for i in chars:
194
+ test=ds.split(i)
195
+ if len(test) == 3:
196
+ for num,m in enumerate(months):
197
+ if test[0].lower() == m or m.startswith(test[0].lower()):
198
+ test[0]=str(num+1).zfill(2)
199
+ ds=f'{i}'.join(test)
200
+ break
201
+ for i in chars:
202
+ for year in ['%y','%Y']:
203
+ t1.append(predate.format(c=i,year=year))
204
+ for ii in chars:
205
+ for year in ['%y','%Y']:
206
+ t1.append(f"%m{i}%d{ii}{year}")
207
+ for f in t1:
208
+ dt=try_date(format=f,ds=ds)
209
+ if dt:
210
+ return dt
211
+ value=process_ds(text)
212
+ except Exception as e:
213
+ print(e)
178
214
  elif data.lower() == 'time':
179
215
  if text.lower() in ['y','yes','1','t','true']:
180
- value=value=TM.Tasks.TasksMode(parent=None,engine=db.ENGINE,init_only=True).TimePkr()
216
+ value=TM.Tasks.TasksMode(parent=None,engine=db.ENGINE,init_only=True).TimePkr()
217
+ else:
218
+ try:
219
+ def try_time(ds,format='%m%d%Y'):
220
+ try:
221
+ #print(format)
222
+ todaysDate=datetime.strptime(ds,format)
223
+ return time(todaysDate.hour,todaysDate.minute,todaysDate.second)
224
+ except Exception as e:
225
+ print(e)
226
+ return None
227
+ def process_time(ds):
228
+ predate="%H{c}%M{c}%S"
229
+ t1=[]
230
+ chars=[i for i in string.punctuation]
231
+ chars.pop(chars.index('%'))
232
+
233
+ for i in chars:
234
+ t1.append(predate.format(c=i))
235
+ for ii in chars:
236
+ t1.append(f"%H{i}%M{ii}%S")
237
+ for f in t1:
238
+ dt=try_time(format=f,ds=ds)
239
+ if dt:
240
+ return dt
241
+ value=process_time(text)
242
+ except Exception as e:
243
+ print(e)
181
244
  elif data.lower() in ['datetime','datetime-','datetime~']:
182
245
  try:
183
246
 
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.384'
1
+ VERSION='0.0.386'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.384
3
+ Version: 0.0.386
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=xuIRMPmHaAcv0S_dloafHTDtAxq34ngYjhRcdt_7mnE,17
8
+ radboy/__init__.py,sha256=MO1KiVymotj1qsEJvZr8Yi4x-WdnLmyK9Fwh6hJdFnA,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=PMNTlfGH4BFJJLOVXwHmm6MB8O3VIeS0D0aQ1roNCbg,234272
93
+ radboy/DB/db.py,sha256=2FKqmdrXe5XWbzw_XYjIrBhzrS6DmxPl3W5Ekx4xcU8,234149
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=TzOvoadaFkdsLOoEi1vFsdXCzObzQMcRKeivoods7dM,370574
128
+ radboy/DB/__pycache__/db.cpython-313.pyc,sha256=PgUaizVSkdeBXTa4cBCjbQ5bmv3xlURvz5TzFsR7qj0,370136
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
@@ -139,7 +139,7 @@ radboy/DayLog/TaxiFares.py,sha256=3slYjtBcTnRe8IeneJ-_iZJJ3E7alW09f6GWYXPxhOo,10
139
139
  radboy/DayLog/Wavelength4Freq.py,sha256=MfN2EATrN3bbEDgP1qOPjV1Fk8sVnkc_4tgX6sKfSE0,2054
140
140
  radboy/DayLog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
141
141
  radboy/DayLog/BhTrSa/__init__.py,sha256=q6xDsXAiWpQR2QWILKZKf--D3apR_KOE1CRbZaP7Vq4,976
142
- radboy/DayLog/BhTrSa/bhtrsaa.py,sha256=2BfClss38UcJiN-jf7aJ8Jfluanws_Jk6JZHuxah360,13970
142
+ radboy/DayLog/BhTrSa/bhtrsaa.py,sha256=9zEPvLOyf7hZvrBE867yTUNAIVE_OZQp7CAaXdLbpRQ,16039
143
143
  radboy/DayLog/__pycache__/DayLogger.cpython-311.pyc,sha256=TmRnRZHp5tMTokSEB8hWTxnasi-iJdh6TmYcb_nXGoY,29557
144
144
  radboy/DayLog/__pycache__/DayLogger.cpython-312.pyc,sha256=bfDCQZrIhgQYzoUle7roicRE_bhGPYZtIbCRIiDrsxU,68240
145
145
  radboy/DayLog/__pycache__/DayLogger.cpython-313.pyc,sha256=L3BYIw7SMXTsTK64KnTRg0mn-CRZn2Eq-4rjh75JXcs,151046
@@ -190,11 +190,11 @@ radboy/ExtractPkg/__pycache__/ExtractPkg2.cpython-313.pyc,sha256=bgw-00G_ouurOtO
190
190
  radboy/ExtractPkg/__pycache__/__init__.cpython-311.pyc,sha256=62yPgrgPZffZFLr6FscOqCdo45vfhScJ8aZbLTbD7I4,235
191
191
  radboy/ExtractPkg/__pycache__/__init__.cpython-312.pyc,sha256=Ll1iKcG0MDtoCIloQ_frcihvCSe1HPtyERzcAoXwQT0,273
192
192
  radboy/ExtractPkg/__pycache__/__init__.cpython-313.pyc,sha256=kL3Y3KxCTaGNg3aq5fhf2fsnQHZolGfvniEUfsx2bwY,152
193
- radboy/FB/FBMTXT.py,sha256=UhD6DbKW9jaCuaw6Ju-mmi-Kgx2RipB1ysOITiZfsqw,19424
193
+ radboy/FB/FBMTXT.py,sha256=D2x_EkKA8v0O0Oku_cPRshBOOwYKBvNLQvVeY6eGAx4,22431
194
194
  radboy/FB/FormBuilder.py,sha256=oOlGmvrUaAOVf0DpM_wlHKfIyz-Q8WU9pJRZ7XPzdQg,14275
195
195
  radboy/FB/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
196
196
  radboy/FB/__pycache__/FBMTXT.cpython-312.pyc,sha256=XCVFa7Mo83LGIdRrTvcK73siUpcVIEQfXKCH2QHeViw,9626
197
- radboy/FB/__pycache__/FBMTXT.cpython-313.pyc,sha256=sF3WL-63m1AjAOTxhfwMlkRvz7Axag5gRv9Nqitcj1k,31133
197
+ radboy/FB/__pycache__/FBMTXT.cpython-313.pyc,sha256=Lz0Lz_aTeF3phBfU-hksKzIfiAVA9qf0WSFGdoKV_H8,33891
198
198
  radboy/FB/__pycache__/FormBuilder.cpython-312.pyc,sha256=lNQdB-zApsXM7OQF9MIi0zRZD1SAL6stKEN-AyQiIKg,18873
199
199
  radboy/FB/__pycache__/FormBuilder.cpython-313.pyc,sha256=WOX7ndix3aTqTaF01w1x4X_b-DX15RAoBdH7_L5NPCc,19706
200
200
  radboy/FB/__pycache__/__init__.cpython-312.pyc,sha256=ULEL8Au_CxcYpNAcSoSbI65M7-av1W6Zuy6kQJUu-Mw,265
@@ -388,7 +388,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
388
388
  radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
389
389
  radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
390
390
  radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
391
- radboy/__pycache__/__init__.cpython-313.pyc,sha256=_dTRrTnEELa-a2BwzVmpLlZOSbh9uHViJR-_NU3VfGQ,165
391
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=pOoMOpj2gNP83Kq-8l6vPzRD39uZ2eWtBOQbqCRVXIQ,165
392
392
  radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
393
393
  radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
394
394
  radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
@@ -413,7 +413,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
413
413
  radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
414
414
  radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
415
415
  radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
416
- radboy-0.0.384.dist-info/METADATA,sha256=3ORA8SXWXV2MYmnACZ3ewAazlRNV3ZUjspiipcf5Ex4,794
417
- radboy-0.0.384.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
418
- radboy-0.0.384.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
419
- radboy-0.0.384.dist-info/RECORD,,
416
+ radboy-0.0.386.dist-info/METADATA,sha256=zIZN0-nLK610SL_h1HA_RCKZbpT1orEfzuTd-O1RLe4,794
417
+ radboy-0.0.386.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
418
+ radboy-0.0.386.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
419
+ radboy-0.0.386.dist-info/RECORD,,