radboy 0.0.351__py3-none-any.whl → 0.0.352__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.
Binary file
radboy/DB/db.py CHANGED
@@ -736,8 +736,11 @@ class EntryDataExtras(BASE,Template):
736
736
  with Session(ENGINE) as session:
737
737
  check=session.query(self.__class__).filter(self.__class__.field_name==kwargs[k],self.__class__.EntryId==kwargs['EntryId']).first()
738
738
  if isinstance(check,self.__class__):
739
- dateStr=datetime.now().strftime("[Updated on %m/%d/%Y at %H:%M:%S.]")
740
- kwargs[k]=f"{kwargs[k]} {dateStr}"
739
+ if check.field_value == kwargs['field_value']:
740
+ raise Exception(f"Value is duplicated for {k}={kwargs['field_value']}")
741
+ else:
742
+ dateStr=datetime.now().strftime("[Updated on %m/%d/%Y at %H:%M:%S.]")
743
+ kwargs[k]=f"{kwargs[k]} {dateStr}"
741
744
  setattr(self,k,str(kwargs[k]))
742
745
  else:
743
746
  setattr(self,k,kwargs[k])
@@ -866,128 +866,132 @@ class EntryDataExtrasMenu:
866
866
  def sch_f2e(self,barcode=None):
867
867
  with Session(ENGINE) as session:
868
868
  while True:
869
- if self.code is None or not isinstance(self.code,str):
870
- if barcode != None:
871
- search=barcode
869
+ try:
870
+ if self.code is None or not isinstance(self.code,str):
871
+ if barcode != None:
872
+ search=barcode
873
+ else:
874
+ search=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Search? [Barcode,Code,Name]",helpText="searches Barcode,Code,Name",data="string")
875
+ if search in [None]:
876
+ return
872
877
  else:
873
- search=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Search? [Barcode,Code,Name]",helpText="searches Barcode,Code,Name",data="string")
874
- if search in [None]:
875
- return
876
- else:
877
- search=self.code
878
+ search=self.code
878
879
 
879
- results=session.query(Entry).filter(or_(Entry.Barcode==search,Entry.Code==search,Entry.Barcode.icontains(search),Entry.Code.icontains(search),Entry.Name.icontains(search))).all()
880
- ct=len(results)
881
- if ct == 0:
882
- print("No Results were Found!")
883
- return
884
- msg=[]
885
- for num,i in enumerate(results):
886
- msg.append(f"{Fore.cyan}{num}/{Fore.light_yellow}{num+1} of {Fore.light_red}{ct}{Fore.grey_50} -> {i.seeShort()}")
887
- msg='\n'.join(msg)
888
- product=None
889
- while True:
890
- print(msg)
891
- index=Prompt.__init2__(None,func=FormBuilderMkText,ptext="which index do you wish to use?",helpText=msg,data="integer")
892
- if index in [None,]:
880
+ results=session.query(Entry).filter(or_(Entry.Barcode==search,Entry.Code==search,Entry.Barcode.icontains(search),Entry.Code.icontains(search),Entry.Name.icontains(search))).all()
881
+ ct=len(results)
882
+ if ct == 0:
883
+ print("No Results were Found!")
893
884
  return
894
- try:
895
- product=results[index]
896
- break
897
- except Exception as e:
898
- print(e)
899
- if product in [None,]:
900
- return
901
- print("sf2e()")
902
- while True:
885
+ msg=[]
886
+ for num,i in enumerate(results):
887
+ msg.append(f"{Fore.cyan}{num}/{Fore.light_yellow}{num+1} of {Fore.light_red}{ct}{Fore.grey_50} -> {i.seeShort()}")
888
+ msg='\n'.join(msg)
889
+ product=None
903
890
  while True:
891
+ print(msg)
892
+ index=Prompt.__init2__(None,func=FormBuilderMkText,ptext="which index do you wish to use?",helpText=msg,data="integer")
893
+ if index in [None,]:
894
+ return
904
895
  try:
905
- fs=[]
906
- fse=session.query(EntryDataExtras).group_by(EntryDataExtras.field_name,EntryDataExtras.field_type).all()
907
- ct_fse=len(fse)
908
- for nunm,i in enumerate(fse):
909
- fs.append(f"{Fore.light_yellow}{num}/{Fore.light_cyan}{num+1} of {Fore.light_red}{ct_fse} -> {Fore.light_magenta}{i.field_name}{Style.reset}")
910
- fs='\n'.join(fs)
911
- field_search=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Search field?",helpText=f"searches EntryDataExtras field_names:\n{fs}",data="string")
912
- if field_search in [None]:
913
- return
914
- elif field_search in ['d',]:
915
- field_search=''
916
- query=session.query(EntryDataExtras).filter(EntryDataExtras.field_name.icontains(field_search))
917
- results_ede=query.group_by(EntryDataExtras.field_name,EntryDataExtras.field_type).all()
918
- if len(results_ede) < 1:
919
- continue
896
+ product=results[index]
920
897
  break
921
898
  except Exception as e:
922
899
  print(e)
923
- field=None
924
- msg_ede=[]
925
- for num,i in enumerate(results_ede):
926
- if num%2==0:
927
- color=Fore.cyan
928
- elif num%3==0:
929
- color=Fore.light_cyan
930
- elif num%4==0:
931
- color=Fore.light_steel_blue
932
- elif num%5==0:
933
- color=Fore.light_green
934
- elif num%6==0:
935
- color=Fore.turquoise_4
936
- elif num%7==0:
937
- color=Fore.deep_sky_blue_3a
938
- elif num%8==0:
939
- color=Fore.spring_green_3a
940
- elif num%9==0:
941
- color=Fore.dark_cyan
942
- else:
943
- color=Fore.light_blue
944
- msg_ede.append(f"{Fore.cyan}{num}/{Fore.light_yellow}{num+1} of {Fore.light_red}{ct}{Fore.grey_50} -> {color}{i.field_name}{Style.reset}:{i.field_type} ede_id={i.ede_id} doe={i.doe}")
945
- msg_ede='\n'.join(msg_ede)
900
+ if product in [None,]:
901
+ return
902
+ print("sf2e()")
946
903
  while True:
947
- try:
948
- print(msg_ede)
949
- index=Prompt.__init2__(None,func=FormBuilderMkText,ptext="which index do you wish to use?",helpText=msg_ede,data="integer")
950
- if index in [None,]:
951
- return
952
- if not isinstance(index,int):
953
- print(f"{Fore.light_red}Index must be an {Fore.light_cyan}integer{Style.reset}")
954
- continue
904
+ while True:
955
905
  try:
956
- print(index)
957
- if index <= len(results_ede)-1:
958
- field=results_ede[index]
959
- else:
960
- print(f"index is not within 0-{len(results_ede)-1}")
906
+ fs=[]
907
+ fse=session.query(EntryDataExtras).group_by(EntryDataExtras.field_name,EntryDataExtras.field_type).all()
908
+ ct_fse=len(fse)
909
+ for nunm,i in enumerate(fse):
910
+ fs.append(f"{Fore.light_yellow}{num}/{Fore.light_cyan}{num+1} of {Fore.light_red}{ct_fse} -> {Fore.light_magenta}{i.field_name}{Style.reset}")
911
+ fs='\n'.join(fs)
912
+ field_search=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Search field?",helpText=f"searches EntryDataExtras field_names:\n{fs}",data="string")
913
+ if field_search in [None]:
914
+ return
915
+ elif field_search in ['d',]:
916
+ field_search=''
917
+ query=session.query(EntryDataExtras).filter(EntryDataExtras.field_name.icontains(field_search))
918
+ results_ede=query.group_by(EntryDataExtras.field_name,EntryDataExtras.field_type).all()
919
+ if len(results_ede) < 1:
961
920
  continue
962
921
  break
963
922
  except Exception as e:
964
923
  print(e)
965
- break
966
- except Exception as e:
967
- print(e)
968
- if field == None:
969
- return
970
- field_name=field.field_name
971
- field_type=field.field_type
972
- field_value=Prompt.__init2__(self,func=FormBuilderMkText,ptext="What do you wish to store as the value?",helpText=field_type,data=field_type)
973
- if field_value in [None,]:
974
- return
975
-
976
- print(field_name,field_type,field_value)
977
- extra=EntryDataExtras(field_name=field_name,field_type=field_type,field_value=field_value,EntryId=product.EntryId)
978
- session.add(extra)
979
- session.commit()
980
- session.refresh(extra)
981
- print(extra)
982
- anotherField=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Add another field to this product[y/n]?",helpText="yes/no/boolean",data="boolean")
983
- if anotherField in [None,]:
984
- return
985
- elif anotherField in ['d',True]:
986
- continue
987
- else:
924
+ field=None
925
+ msg_ede=[]
926
+ for num,i in enumerate(results_ede):
927
+ if num%2==0:
928
+ color=Fore.cyan
929
+ elif num%3==0:
930
+ color=Fore.light_cyan
931
+ elif num%4==0:
932
+ color=Fore.light_steel_blue
933
+ elif num%5==0:
934
+ color=Fore.light_green
935
+ elif num%6==0:
936
+ color=Fore.turquoise_4
937
+ elif num%7==0:
938
+ color=Fore.deep_sky_blue_3a
939
+ elif num%8==0:
940
+ color=Fore.spring_green_3a
941
+ elif num%9==0:
942
+ color=Fore.dark_cyan
943
+ else:
944
+ color=Fore.light_blue
945
+ msg_ede.append(f"{Fore.cyan}{num}/{Fore.light_yellow}{num+1} of {Fore.light_red}{ct}{Fore.grey_50} -> {color}{i.field_name}{Style.reset}:{i.field_type} ede_id={i.ede_id} doe={i.doe}")
946
+ msg_ede='\n'.join(msg_ede)
947
+ while True:
948
+ try:
949
+ print(msg_ede)
950
+ index=Prompt.__init2__(None,func=FormBuilderMkText,ptext="which index do you wish to use?",helpText=msg_ede,data="integer")
951
+ if index in [None,]:
952
+ return
953
+ if not isinstance(index,int):
954
+ print(f"{Fore.light_red}Index must be an {Fore.light_cyan}integer{Style.reset}")
955
+ continue
956
+ try:
957
+ print(index)
958
+ if index <= len(results_ede)-1:
959
+ field=results_ede[index]
960
+ else:
961
+ print(f"index is not within 0-{len(results_ede)-1}")
962
+ continue
963
+ break
964
+ except Exception as e:
965
+ print(e)
966
+ break
967
+ except Exception as e:
968
+ print(e)
969
+ if field == None:
970
+ return
971
+ field_name=field.field_name
972
+ field_type=field.field_type
973
+ field_value=Prompt.__init2__(self,func=FormBuilderMkText,ptext="What do you wish to store as the value?",helpText=field_type,data=field_type)
974
+ if field_value in [None,]:
975
+ return
976
+
977
+ print(field_name,field_type,field_value)
978
+ extra=EntryDataExtras(field_name=field_name,field_type=field_type,field_value=field_value,EntryId=product.EntryId)
979
+ session.add(extra)
980
+ session.commit()
981
+ session.refresh(extra)
982
+ print(extra)
983
+ anotherField=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Add another field to this product[y/n]?",helpText="yes/no/boolean",data="boolean")
984
+ if anotherField in [None,]:
985
+ return
986
+ elif anotherField in ['d',True]:
987
+ continue
988
+ else:
989
+ break
990
+ if barcode != None:
988
991
  break
989
- if barcode != None:
990
- break
992
+ except Exception as e:
993
+ print(e)
994
+
991
995
 
992
996
  def sch_c2e(self,barcode=None):
993
997
  with Session(ENGINE) as session:
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.351'
1
+ VERSION='0.0.352'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.351
3
+ Version: 0.0.352
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=Rof_lEJXvW8euhOheSDBrewoLgLoNWnKLl-UI5eEBRY,17
8
+ radboy/__init__.py,sha256=_oBxnLh0Z3XVfFIPnmK_QBIMvDPa_I9ciceP1jg_iVM,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=bTY303S1dqV5cv2JAlddtaVDMmjT5CTJTQi9KjVcUsk,228153
93
+ radboy/DB/db.py,sha256=FuCvGyUuqaWZeh2UAIQqgGXxO8cq1D1E5lBmxYmyKOI,228386
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=phmHMqSUXsdVI60Lu8o4MTHP0ERzY1xU3RUIoTxZIL8,359887
128
+ radboy/DB/__pycache__/db.cpython-313.pyc,sha256=Y8TFajotRXIsYOWn-G6FN9Az3kOlZ60P9rFmGBEjvTM,360066
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
@@ -144,10 +144,10 @@ radboy/DayLog/__pycache__/DayLogger.cpython-313.pyc,sha256=UC2v9eX_1UZNgIA9baQzr
144
144
  radboy/DayLog/__pycache__/__init__.cpython-311.pyc,sha256=Z5Y4DdVF77LZf6-Of92MDGFdi-IXik1ASQd4AdLNNfQ,231
145
145
  radboy/DayLog/__pycache__/__init__.cpython-312.pyc,sha256=lP_GHzSPt5JTrT1jLWiRMFGPmSdJYBn4eRV__OxgJ6s,269
146
146
  radboy/DayLog/__pycache__/__init__.cpython-313.pyc,sha256=UQw5v4r7yismC9qcqP0dEme6h-lawbOA5pXYpkqUwFk,148
147
- radboy/EntryExtras/Extras.py,sha256=CzRiM3lbooG27QaqV_r2v56OtxpgbSKqEnB_x77yNXE,66339
147
+ radboy/EntryExtras/Extras.py,sha256=4z1hp3CZpia-4Y6cbmv1iyzUHUyv3MnVqlZWGmNNKVw,66933
148
148
  radboy/EntryExtras/__init__.py,sha256=K76Ku7o2DwTZU-Ya2mifH856KAcxb8MXdSaQMQLhu84,902
149
149
  radboy/EntryExtras/__pycache__/Extras.cpython-312.pyc,sha256=eHkeyKblMtG37lDhl38OEGQbvvKxXMriKK49kj2mg8o,34768
150
- radboy/EntryExtras/__pycache__/Extras.cpython-313.pyc,sha256=kVsCdqeYlNOhGlnNUEPRwkTbnL8JKQeaT1OeJKn5Mmw,85985
150
+ radboy/EntryExtras/__pycache__/Extras.cpython-313.pyc,sha256=V7jYgyWJwgUr7FIDKnmlX7WFXNtig19rJKjnm_dLUJw,86179
151
151
  radboy/EntryExtras/__pycache__/__init__.cpython-312.pyc,sha256=0bBwhp_9PYvL-Nm_J0gsYf9yfKAFJMiMdpc6XzZrPzU,829
152
152
  radboy/EntryExtras/__pycache__/__init__.cpython-313.pyc,sha256=PqXXfBeREZI2pZc22BayKH7daLXbO7p3NozaXpnA3cQ,829
153
153
  radboy/EntryExtras/__pycache__/db.cpython-312.pyc,sha256=Qcqix5yi9h7fbsmGhJOWYdLHbHMTWixwolRRQYg8ISk,1781
@@ -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=WIgbGJm5sXuP4aKVCW7jPse4lWNgq3QO6tVTbP3-Nf4,165
389
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=L4tNvdvdn9QV04q8ekxMKvnkDbqMlIyIDTnkQc8CR8s,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.351.dist-info/METADATA,sha256=tpw5FHvJbCi971RFYzmO7rw07wPIpvx2EAuF3dpfKZA,794
415
- radboy-0.0.351.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
416
- radboy-0.0.351.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
417
- radboy-0.0.351.dist-info/RECORD,,
414
+ radboy-0.0.352.dist-info/METADATA,sha256=dM7TGRzF6CHGv1QPhkmxEH8rWYCK7nS5Uf_OONuM0rA,794
415
+ radboy-0.0.352.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
416
+ radboy-0.0.352.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
417
+ radboy-0.0.352.dist-info/RECORD,,