launchpy 0.4.5.post4__tar.gz → 0.4.5.post6__tar.gz

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.
Files changed (31) hide show
  1. {launchpy-0.4.5.post4/launchpy.egg-info → launchpy-0.4.5.post6}/PKG-INFO +1 -1
  2. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/docs/releases.md +4 -0
  3. launchpy-0.4.5.post6/launchpy/__version__.py +1 -0
  4. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/launchpy/library.py +22 -5
  5. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/launchpy/property.py +12 -6
  6. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/launchpy/synchronizer.py +2 -0
  7. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6/launchpy.egg-info}/PKG-INFO +1 -1
  8. launchpy-0.4.5.post4/launchpy/__version__.py +0 -1
  9. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/LICENSE +0 -0
  10. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/README.md +0 -0
  11. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/docs/admin.md +0 -0
  12. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/docs/getstarted.md +0 -0
  13. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/docs/library.md +0 -0
  14. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/docs/main.md +0 -0
  15. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/docs/property.md +0 -0
  16. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/docs/synchronizer.md +0 -0
  17. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/docs/translator.md +0 -0
  18. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/launchpy/__init__.py +0 -0
  19. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/launchpy/admin.py +0 -0
  20. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/launchpy/config.py +0 -0
  21. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/launchpy/configs.py +0 -0
  22. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/launchpy/connector.py +0 -0
  23. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/launchpy/launchpy.py +0 -0
  24. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/launchpy.egg-info/SOURCES.txt +0 -0
  25. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/launchpy.egg-info/dependency_links.txt +0 -0
  26. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/launchpy.egg-info/requires.txt +0 -0
  27. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/launchpy.egg-info/top_level.txt +0 -0
  28. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/pyproject.toml +0 -0
  29. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/requirements.txt +0 -0
  30. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/setup.cfg +0 -0
  31. {launchpy-0.4.5.post4 → launchpy-0.4.5.post6}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: launchpy
3
- Version: 0.4.5.post4
3
+ Version: 0.4.5.post6
4
4
  Summary: Adobe Launch API wrapper
5
5
  Home-page: https://github.com/pitchmuc/launchpy
6
6
  Author: Julien Piccini
@@ -14,6 +14,10 @@ Patch:
14
14
  * Documentation improved in synchronizer
15
15
  * Support of extension added in `createTargetsLibrary`
16
16
  * Fixing dependency to `aepp` `som` module
17
+ * Fixing renaming path to use `renameComponent` and using `syncComponent`
18
+ * Adding capability to set environment to a lib in `Library` instance via `setEnvironment`
19
+ * Capability to get a `Library` class from the `getLibrary` method in `Property` instance
20
+ * Fixing code in `deleteLibrary`
17
21
 
18
22
  ## 0.4.4
19
23
  * adding a `getBuilds` method on the `Library` class instance
@@ -0,0 +1 @@
1
+ __version__ = "0.4.5-6"
@@ -313,7 +313,7 @@ class Library:
313
313
 
314
314
  def setEnvironments(self, environments_list: list, dev_name: str = None)->None:
315
315
  """
316
- Save the different environments ids available.
316
+ Save the different environments ids available in a config variable.
317
317
  It is required to use the library class.
318
318
  Arguments :
319
319
  environments_list : REQUIRED : list of environment retrieved by the getEnvironments method
@@ -340,6 +340,21 @@ class Library:
340
340
  res = new_env
341
341
  return res
342
342
 
343
+ def setEnvironment(self, env_id: str,verbose:bool=False)->None:
344
+ """
345
+ Set the environment of the library.
346
+ Arguments:
347
+ env_id : REQUIRED : The environment id you want to set.
348
+ """
349
+ obj = {
350
+ "data": {
351
+ "id": env_id,
352
+ "type": "environments"
353
+ }
354
+ }
355
+ res = self._setEnvironment(obj,verbose=verbose)
356
+ return res
357
+
343
358
  def _removeEnvironment(self)->None:
344
359
  """
345
360
  Remove environment
@@ -347,7 +362,7 @@ class Library:
347
362
  path = f'/libraries/{self.id}/relationships/environment'
348
363
  new_env = self.connector.getData(self.endpoint+path)
349
364
  return new_env
350
-
365
+
351
366
  def updateLibrary(self,empty:bool=False)->dict:
352
367
  """
353
368
  Update the library
@@ -383,12 +398,14 @@ class Library:
383
398
  return res
384
399
 
385
400
 
386
- def build(self,verbose:bool=False)->dict:
401
+ def build(self,timesleep:int=20, verbose:bool=False)->dict:
387
402
  """
388
403
  Build the library.
389
404
  Part of the code takes care of assigning the right environement before building the library.
390
405
  Returns the build when it is completed (succeed or not).
391
- It will check every 15 seconds for the build status, making sure it is not "pending".
406
+ Arguments:
407
+ timesleep : OPTIONAL : How many seconds to wait between each check of the build status. Default to 20 seconds.
408
+ It will check every 20 seconds for the build status, making sure it is not "pending".
392
409
  """
393
410
  if self.build_required == False and self.state != 'approved':
394
411
  return 'build is not required'
@@ -430,7 +447,7 @@ class Library:
430
447
  build_status = build['data']['attributes']['status']
431
448
  while build_status == 'pending':
432
449
  print('pending...')
433
- time.sleep(20)
450
+ time.sleep(timesleep)
434
451
  # return the json directly
435
452
  build = self.connector.getData(
436
453
  config.endpoints['global']+'/builds/'+str(build_id))
@@ -603,7 +603,7 @@ class Property:
603
603
  data = data + append_data
604
604
  return data
605
605
 
606
- def getLibrary(self,libraryId:str=None)->dict:
606
+ def getLibrary(self,libraryId:str=None,return_class:bool=False)->dict:
607
607
  """
608
608
  get a library based on its ID.
609
609
  Arguments:
@@ -614,6 +614,8 @@ class Property:
614
614
  path = f"/libraries/{libraryId}"
615
615
  res = self.connector.getData(self.endpoint+path)
616
616
  if 'data' in res.keys():
617
+ if return_class:
618
+ return Library(res['data'],config_object=self.connector.config,header=self.header)
617
619
  return res['data']
618
620
  return res
619
621
 
@@ -1278,7 +1280,10 @@ class Property:
1278
1280
  if library in librariesIds:
1279
1281
  libraryId = library
1280
1282
  else:
1281
- libraryId = librariesNameId[library]
1283
+ try:
1284
+ libraryId = librariesNameId[library]
1285
+ except KeyError:
1286
+ raise ValueError("Library name or ID provided not found.")
1282
1287
  path = f"/libraries/{libraryId}"
1283
1288
  if components==True:
1284
1289
  myLib = self.getLibrary(libraryId)
@@ -1286,10 +1291,11 @@ class Property:
1286
1291
  rules = libClass.getRules()
1287
1292
  dataelements = libClass.getDataElements()
1288
1293
  res = self.connector.deleteData('https://reactor.adobe.io/'+path)
1289
- for rule in rules:
1290
- self.deleteRule(rule['id'])
1291
- for de in dataelements:
1292
- self.deleteDataElement(de['id'])
1294
+ if components==True:
1295
+ for rule in rules:
1296
+ self.deleteRule(rule['id'])
1297
+ for de in dataelements:
1298
+ self.deleteDataElement(de['id'])
1293
1299
  return res
1294
1300
 
1295
1301
  def getProductionEndpoint(self)->dict:
@@ -459,6 +459,8 @@ class Synchronizer:
459
459
  copy['name'] = new_name
460
460
  comp = self.targets[target]['api'].updateRule(rule_id=component['id'],attr_dict=copy)
461
461
  self.targets[target]['libraryStack']['rules'].append(comp)
462
+ self.targets[target]['rules'].append(comp)
463
+ self.translator.extendTargetRules(ruleName=new_name,ruleId=comp['id'],property_name=target)
462
464
 
463
465
 
464
466
  def checkComponentSync(self,componentName:str=None,componentId:str=None,publishedVersion:bool=False,excludeSimilar:bool=False,**kwargs)->bool:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: launchpy
3
- Version: 0.4.5.post4
3
+ Version: 0.4.5.post6
4
4
  Summary: Adobe Launch API wrapper
5
5
  Home-page: https://github.com/pitchmuc/launchpy
6
6
  Author: Julien Piccini
@@ -1 +0,0 @@
1
- __version__ = "0.4.5-4"
File without changes
File without changes
File without changes
File without changes