cleepcli 1.34.2__tar.gz → 1.35.0__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 (28) hide show
  1. {cleepcli-1.34.2/cleepcli.egg-info → cleepcli-1.35.0}/PKG-INFO +1 -1
  2. {cleepcli-1.34.2 → cleepcli-1.35.0}/bin/ccli +5 -1
  3. {cleepcli-1.34.2 → cleepcli-1.35.0}/bin/cleep-cli +5 -1
  4. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli/file.py +30 -3
  5. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli/version.py +1 -1
  6. {cleepcli-1.34.2 → cleepcli-1.35.0/cleepcli.egg-info}/PKG-INFO +1 -1
  7. {cleepcli-1.34.2 → cleepcli-1.35.0}/LICENSE +0 -0
  8. {cleepcli-1.34.2 → cleepcli-1.35.0}/MANIFEST.in +0 -0
  9. {cleepcli-1.34.2 → cleepcli-1.35.0}/README.md +0 -0
  10. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli/__init__.py +0 -0
  11. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli/check.py +0 -0
  12. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli/ci.py +0 -0
  13. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli/cleepapi.py +0 -0
  14. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli/config.py +0 -0
  15. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli/console.py +0 -0
  16. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli/docs.py +0 -0
  17. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli/git.py +0 -0
  18. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli/module.py +0 -0
  19. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli/package.py +0 -0
  20. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli/test.py +0 -0
  21. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli/tools.py +0 -0
  22. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli/watch.py +0 -0
  23. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli.egg-info/SOURCES.txt +0 -0
  24. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli.egg-info/dependency_links.txt +0 -0
  25. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli.egg-info/requires.txt +0 -0
  26. {cleepcli-1.34.2 → cleepcli-1.35.0}/cleepcli.egg-info/top_level.txt +0 -0
  27. {cleepcli-1.34.2 → cleepcli-1.35.0}/setup.cfg +0 -0
  28. {cleepcli-1.34.2 → cleepcli-1.35.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cleepcli
3
- Version: 1.34.2
3
+ Version: 1.35.0
4
4
  Summary: Cleep-cli helps developers to build great Cleep applications from command line.
5
5
  Home-page: https://github.com/CleepDevice/cleep-cli
6
6
  Author: Tanguy Bonneau
@@ -272,7 +272,8 @@ def get_module_name(param, value):
272
272
  return module_name
273
273
 
274
274
  @mod.command()
275
- def modssync():
275
+ @click.option('--run-scripts', default=False, is_flag=True, help='Also run preinst.sh and postinst.sh scripts')
276
+ def modssync(run_scripts):
276
277
  """
277
278
  Synchronize all mandatory modules (system, network...)
278
279
  """
@@ -283,6 +284,9 @@ def modssync():
283
284
  res = f.module_sync(module)
284
285
  if not res:
285
286
  sys.exit(1)
287
+ res = f.module_run_install_scripts(module)
288
+ if not res:
289
+ sys.exit(1)
286
290
 
287
291
  logging.info('Done')
288
292
 
@@ -272,7 +272,8 @@ def get_module_name(param, value):
272
272
  return module_name
273
273
 
274
274
  @mod.command()
275
- def modssync():
275
+ @click.option('--run-scripts', default=False, is_flag=True, help='Also run preinst.sh and postinst.sh scripts')
276
+ def modssync(run_scripts):
276
277
  """
277
278
  Synchronize all mandatory modules (system, network...)
278
279
  """
@@ -283,6 +284,9 @@ def modssync():
283
284
  res = f.module_sync(module)
284
285
  if not res:
285
286
  sys.exit(1)
287
+ res = f.module_run_install_scripts(module)
288
+ if not res:
289
+ sys.exit(1)
286
290
 
287
291
  logging.info('Done')
288
292
 
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
- import sys
5
4
  import os
6
5
  from .console import Console
7
6
  import logging
@@ -36,7 +35,7 @@ class File():
36
35
  mkdir -p "%(HTML_DST)s/"
37
36
  mkdir -p "%(CORE_DST)s/modules"
38
37
  mkdir -p "%(MEDIA_DST)s/modules"
39
- mdkir -p "%(CONFIG_DIR)s"
38
+ mkdir -p "%(CONFIG_DIR)s"
40
39
  rsync -av "%(REPO_DIR)s/cleep/" "%(CORE_DST)s/" --exclude "/tests/" --exclude "modules" --exclude "*__pycache__*" --delete --exclude "*.pyc" --keep-dirlinks
41
40
  rsync -av "%(REPO_DIR)s/html/" "%(HTML_DST)s/" --delete --exclude "js/modules/" --exclude "*node_modules*"
42
41
  rsync -av "%(REPO_DIR)s/bin/cleep" "%(BIN_DST)s/cleep"
@@ -58,7 +57,8 @@ rsync -av "%(REPO_DIR)s/medias/sounds" "%(MEDIA_DST)s/sounds/" --delete
58
57
  Copy specified module content to valid execution location
59
58
  """
60
59
  if not os.path.exists(os.path.join(config.MODULES_SRC, module_name)):
61
- sys.exit('Module "%s" doesn\'t exist [%s]' % (module_name, os.path.join(config.MODULES_SRC, module_name)))
60
+ self.logger.error('Module "%s" doesn\'t exist [%s]' % (module_name, os.path.join(config.MODULES_SRC, module_name)))
61
+ return False
62
62
 
63
63
  if not os.path.exists(os.path.join(config.MODULES_DST, module_name)):
64
64
  os.makedirs(os.path.join(config.MODULES_DST, module_name))
@@ -101,3 +101,30 @@ fi
101
101
 
102
102
  return True
103
103
 
104
+ def module_run_install_scripts(self, module_name):
105
+ """
106
+ Run module installation scripts
107
+ """
108
+ if not os.path.exists(os.path.join(config.MODULES_SRC, module_name)):
109
+ self.logger.error('Module "%s" doesn\'t exist [%s]' % (module_name, os.path.join(config.MODULES_SRC, module_name)))
110
+ return False
111
+
112
+ preinst_script = os.path.join(config.MODULES_SCRIPTS_DST, module_name, "preinst.sh")
113
+ postinst_script = os.path.join(config.MODULES_SCRIPTS_DST, module_name, "postinst.sh")
114
+ console = Console()
115
+
116
+ if os.path.exists(preinst_script):
117
+ self.logger.info('Running %s scripts', preinst_script)
118
+ resp = console.command(preinst_script, timeout=300)
119
+ if resp["returncode"] != 0:
120
+ self.logger.error('Error running %s [%s]: %s', preinst_script, resp["returncode"], ''.join(resp["stderr"]))
121
+ return False
122
+
123
+ if os.path.exists(postinst_script):
124
+ self.logger.info('Running %s scripts', postinst_script)
125
+ resp = console.command(postinst_script, timeout=300)
126
+ if resp["returncode"] != 0:
127
+ self.logger.error('Error running %s [%s]: %s', postinst_script, resp["returncode"], ''.join(resp["stderr"]))
128
+ return False
129
+
130
+ return True
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
- VERSION = '1.34.2'
4
+ VERSION = '1.35.0'
5
5
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cleepcli
3
- Version: 1.34.2
3
+ Version: 1.35.0
4
4
  Summary: Cleep-cli helps developers to build great Cleep applications from command line.
5
5
  Home-page: https://github.com/CleepDevice/cleep-cli
6
6
  Author: Tanguy Bonneau
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes