theoden avatar theoden committed 2d9d9cb

bringing env.conf.APPS out of pip module

Comments (0)

Files changed (2)

fab_deploy/pip.py

 
 @task
 @utils.inside_src
-def install_r(what=None, options='', restart=True):
+def install_r(what=None, options=''):
     """ Installs pip requirements listed in ``<PIP_REQUIREMENTS_PATH>/<file>.txt`` file. """
     what = utils._pip_req_path(what or env.conf.PIP_REQUIREMENTS_ACTIVE)
     run('pip install %s -r %s' % (options, what))
-    if restart:
-        for app in env.conf.APPS:
-            app.restart()
 
 @task
 @utils.inside_src
-def update_r(what=None, options='', restart=True):
+def update_r(what=None, options=''):
     """ Updates pip requirements listed in ``<PIP_REQUIREMENTS_PATH>/<file>.txt`` file. """
     what = utils._pip_req_path(what or env.conf.PIP_REQUIREMENTS_ACTIVE)
     run('pip install %s -U -r %s' % (options, what))
-    if restart:
-        for app in env.conf.APPS:
-            app.restart()
 
 @task
 def setup_conf(username=None):

fab_deploy/project.py

         database.install()
 
     @task_method
+    def install_r(self, what=None, options='', restart=True):
+        """
+        Installs pip requirements listed in ``<PIP_REQUIREMENTS_PATH>/<file>.txt`` file
+        and reloads all apps of the project, if specified.
+        """
+        pip.install_r(what, options)
+        if restart:
+            for app in env.conf.APPS:
+                app.restart()
+
+    @task_method
+    def update_r(self, what=None, options='', restart=True):
+        """
+        Updates pip requirements listed in ``<PIP_REQUIREMENTS_PATH>/<file>.txt`` file
+        and reloads all apps of the project, if specified.
+        """
+        pip.update_r(what, options)
+        if restart:
+            for app in env.conf.APPS:
+                app.restart()
+
+    @task_method
     def deploy(self):
         pip.virtualenv_create()
         self._make_clone()
-        pip.install_r(env.conf.PIP_REQUIREMENTS, restart=False)
+        self.install_r(env.conf.PIP_REQUIREMENTS, restart=False)
         for app in env.conf.APPS:
             app.deploy()
 
             vcs.up()
     
         if 'pip_update' in args:
-            pip.update_r(restart=False)
+            self.update_r(restart=False)
         for app in env.conf.APPS:
             if 'syncdb' in args:
                 app.syncdb()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.