aepp 0.5.0.post7__py3-none-any.whl → 0.5.1__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.
aepp/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.5.0-7"
1
+ __version__ = "0.5.1"
aepp/cli/__main__.py CHANGED
@@ -63,6 +63,18 @@ class ServiceShell(cmd.Cmd):
63
63
  self.prompt = f"{self.config.sandbox}> "
64
64
  console.print(Panel(f"Connected to [bold green]{self.sandbox}[/bold green]", style="blue"))
65
65
 
66
+ def do_createConfigFile(self, arg):
67
+ """Create a configuration file for future use"""
68
+ parser = argparse.ArgumentParser(prog='createConfigFile', add_help=True)
69
+ parser.add_argument("-f", "--file_name", help="file name for your config file", default="aepp_config.json")
70
+ args = parser.parse_args(shlex.split(arg))
71
+ filename = args.file_name
72
+ aepp.createConfigFile(destination=filename)
73
+ filename_json = filename + ".json" if not filename.endswith(".json") else filename
74
+ console.print(f"Configuration file created at {Path.cwd() / Path(filename_json)}", style="green")
75
+ return
76
+
77
+
66
78
  # # --- Commands ---
67
79
  def do_config(self, arg):
68
80
  """connect to an AEP instance"""
@@ -964,19 +976,19 @@ class ServiceShell(cmd.Cmd):
964
976
  successful_runs = fl.get("Successful Runs", 0)
965
977
  failed_runs = fl.get("Failed Runs", 0)
966
978
  partial_success = fl.get('Partial Success Runs',0)
967
- if partial_success>0:
968
- partialColorStart = "[orange1]"
969
- partialColorEnd = "[/orange1]"
970
- else:
971
- partialColorStart = colorStart
972
- partialColorEnd = colorEnd
979
+ if partial_success>0 and failed_runs==0:
980
+ colorStart = "[orange1]"
981
+ colorEnd = "[/orange1]"
982
+ row_data[0] = f"{colorStart}{fl.get('id','N/A')}{colorEnd}"
983
+ row_data[1] = f"{colorStart}{fl.get('name','N/A')}{colorEnd}"
984
+ row_data[2] = f"{colorStart}{fl.get('type','N/A')}{colorEnd}"
973
985
  success_rate = (successful_runs / total_runs * 100) if total_runs > 0 else 0
974
986
  failure_rate = (failed_runs / total_runs * 100) if total_runs > 0 else 0
975
987
  row_data.extend([
976
988
  f"{colorStart}{str(total_runs)}{colorEnd}",
977
989
  f"{colorStart}{str(successful_runs)}{colorEnd}",
978
990
  f"{colorStart}{str(failed_runs)}{colorEnd}",
979
- f"{partialColorStart}{str(partial_success)}{partialColorEnd}"
991
+ f"{colorStart}{str(partial_success)}{colorEnd}",
980
992
  f"{colorStart}{success_rate:.0f}%{colorEnd}",
981
993
  f"{colorStart}{failure_rate:.0f}%{colorEnd}"
982
994
  ])
aepp/synchronizer.py CHANGED
@@ -719,7 +719,7 @@ class Synchronizer:
719
719
  match descType:
720
720
  case "xdm:descriptorIdentity":
721
721
  target_identitiesDecs = [desc for desc in target_descriptors if desc['@type'] == 'xdm:descriptorIdentity']
722
- baseIdentityNS = baseDescriptor['xdm:namespace']
722
+ baseIdentityNS = baseDescriptor['xdm:namespace'].lower()
723
723
  if self.baseConfig is not None and self.localfolder is None:
724
724
  identityConn = identity.Identity(config=self.baseConfig,region=self.region)
725
725
  baseIdentities = identityConn.getIdentities()
@@ -728,8 +728,8 @@ class Synchronizer:
728
728
  for file in self.identityFolder.glob('*.json'):
729
729
  id_file = json.load(FileIO(file))
730
730
  baseIdentities.append(id_file)
731
- if baseIdentityNS not in [el['xdm:namespace'] for el in target_identitiesDecs]: ## identity descriptor does not exists in target schema
732
- def_identity = [el for el in baseIdentities if el['code'] == baseIdentityNS][0]
731
+ if baseIdentityNS not in [el['xdm:namespace'].lower() for el in target_identitiesDecs]: ## identity descriptor does not exists in target schema
732
+ def_identity = [el for el in baseIdentities if el['code'].lower() == baseIdentityNS][0]
733
733
  self.__syncIdentity__(def_identity,verbose=verbose)
734
734
  new_desc = targetSchemaManager.createDescriptorOperation(descType=descType,
735
735
  completePath=baseDescriptor['xdm:sourceProperty'],
@@ -738,7 +738,7 @@ class Synchronizer:
738
738
  )
739
739
  res = targetSchemaManager.createDescriptor(new_desc)
740
740
  else:
741
- res = [el for el in target_identitiesDecs if el['xdm:namespace'] == baseIdentityNS][0]
741
+ res = [el for el in target_identitiesDecs if el['xdm:namespace'].lower() == baseIdentityNS][0]
742
742
  list_descriptors.append(res)
743
743
  case "xdm:descriptorOneToOne": ## lookup definition
744
744
  target_OneToOne = [desc for desc in target_descriptors if desc['@type'] == 'xdm:descriptorOneToOne']
@@ -866,15 +866,15 @@ class Synchronizer:
866
866
  """
867
867
  if not isinstance(identityDefiniton,dict):
868
868
  raise TypeError("the identityDefinition must be a dictionary")
869
- code_base_identity = identityDefiniton['code']
869
+ code_base_identity = identityDefiniton['code'].lower()
870
870
  self.dict_baseComponents['identities'][code_base_identity] = identityDefiniton
871
871
  for target in self.dict_targetsConfig.keys():
872
872
  targetIdentity = identity.Identity(config=self.dict_targetsConfig[target],region=self.region)
873
873
  t_identities = targetIdentity.getIdentities()
874
- if code_base_identity in [el['code'] for el in t_identities]:## identity already exists in target
874
+ if code_base_identity in [el['code'].lower() for el in t_identities]:## identity already exists in target
875
875
  if verbose:
876
876
  print(f"identity '{code_base_identity}' already exists in target {target}, saving it")
877
- self.dict_targetComponents[target]['identities'][code_base_identity] = [el for el in t_identities if el['code'] == code_base_identity][0]
877
+ self.dict_targetComponents[target]['identities'][code_base_identity] = [el for el in t_identities if el['code'].lower() == code_base_identity][0]
878
878
  else:
879
879
  if verbose:
880
880
  print(f"identity '{code_base_identity}' does not exist in target {target}, creating it")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aepp
3
- Version: 0.5.0.post7
3
+ Version: 0.5.1
4
4
  Summary: Package to manage AEP API endpoint and some helper functions
5
5
  Author-email: Julien Piccini <piccini.julien@gmail.com>
6
6
  License: Apache-2.0
@@ -1,5 +1,5 @@
1
1
  aepp/__init__.py,sha256=tKlipgknDl84iALUNgR9mktILF3gSk1GgMUw_Gg-HXE,27912
2
- aepp/__version__.py,sha256=35qn4nEmelMH0x1e_PBe0bZZRdaX2tn3kyyqo7Z1eds,23
2
+ aepp/__version__.py,sha256=PQu9BZ4UZrI--6Rc-s0RhFPPEWVTqddrgsWkwYl87dI,21
3
3
  aepp/accesscontrol.py,sha256=PB3FcrO4bvDjdNxjHx7p_20hp4ahBXewoOSxuTGMXC8,17423
4
4
  aepp/catalog.py,sha256=hK9m3SAP0fhgkYqu14Tcfq14qBhw54tLCOF0mH31b1M,68237
5
5
  aepp/classmanager.py,sha256=CTYGkg5ygB8HtRia6DfT9WLBqXJOVg7pSM9jBB25Bqw,64707
@@ -31,14 +31,14 @@ aepp/schemamanager.py,sha256=hwItd4vXsPFeV25gX1Fbeiu07-BCg4z_VRQREMgJZ58,50738
31
31
  aepp/segmentation.py,sha256=oSgR2yx4nawYN5XAeHV_wefvmXEf0nb-bCguaDmp8F8,43555
32
32
  aepp/sensei.py,sha256=oYNy5BSWAEqsDkEexcQso6NfA6ntGGMnCOyHri0pJs8,7761
33
33
  aepp/som.py,sha256=XNm_Lu2wt2kpSSpldLptuER2eludFXeO9fI6i3iNCzo,34175
34
- aepp/synchronizer.py,sha256=iG-E--HcxXFIW046Jzu4NAexcAoIAZOOWK4X_ra_9zg,77960
34
+ aepp/synchronizer.py,sha256=4zzUdTNqqDGQzhuXc6cCVZfuOmhzKpcKCgjORCMJ57U,78016
35
35
  aepp/tags.py,sha256=t2qBallTcWR4IOXcDBmrPpqjbSay1z3E2bcRijzVm1s,17641
36
36
  aepp/utils.py,sha256=tG-YVXylm38-bynqfp5N_Mzyo7mhlZj-dLo7wLoO4tM,1200
37
37
  aepp/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
- aepp/cli/__main__.py,sha256=C8DmUn7TGeiflem5jbxX1qO6mnRDUuu8Rdt7fS3__88,66270
39
- aepp-0.5.0.post7.dist-info/licenses/LICENSE,sha256=HjYTlfne3BbS5gNHzNqJ5COCiTQLUdf87QkzRyFbE4Y,10337
40
- aepp-0.5.0.post7.dist-info/METADATA,sha256=sl0kTGfjzJ2l25DGIWAHN4pEwnaBLCUc5ty06YKzcNQ,5317
41
- aepp-0.5.0.post7.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
42
- aepp-0.5.0.post7.dist-info/entry_points.txt,sha256=e7HAumUTymoUiCuVRzFlcchennUBLcjxvuiimySF98Y,48
43
- aepp-0.5.0.post7.dist-info/top_level.txt,sha256=dtZJI8SzhWVgZRl68PHKZX_fD6amvDiFR-lqD9FSJvE,5
44
- aepp-0.5.0.post7.dist-info/RECORD,,
38
+ aepp/cli/__main__.py,sha256=j-YOkeZb-WR9EhnbseupS8omPdKh5bZlKGYhwgDePw8,67031
39
+ aepp-0.5.1.dist-info/licenses/LICENSE,sha256=HjYTlfne3BbS5gNHzNqJ5COCiTQLUdf87QkzRyFbE4Y,10337
40
+ aepp-0.5.1.dist-info/METADATA,sha256=2LTT0FCM-RAMjBnoPQcHyjFhuygM8-28efp3IBeBw-8,5311
41
+ aepp-0.5.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
42
+ aepp-0.5.1.dist-info/entry_points.txt,sha256=e7HAumUTymoUiCuVRzFlcchennUBLcjxvuiimySF98Y,48
43
+ aepp-0.5.1.dist-info/top_level.txt,sha256=dtZJI8SzhWVgZRl68PHKZX_fD6amvDiFR-lqD9FSJvE,5
44
+ aepp-0.5.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.10.1)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5