Commits

theoden committed 97069e8

* WebApp became ABC
* exception raising was beautified

  • Participants
  • Parent commits 8fc02b3
  • Branches multiple web-servers

Comments (0)

Files changed (1)

File fab_deploy/apps.py

 # coding: utf-8
 from __future__ import with_statement
 
+from abc import ABCMeta, abstractmethod
+
 from fabric.api import abort, run, env
 from taskset import TaskSet, task_method
 
 
 
 class WebApp(StaticSite):
+    __metaclass__ = ABCMeta
 
     def __init__(self, frontend, backend):
         super(WebApp, self).__init__(frontend)
         super(WebApp, self).update_web_servers()
 
     @task_method
+    @abstractmethod
     def update_config(self, restart=True):
         """ Updates config of the web application. """
-        raise NotImplementedError, 'Must be implemented in successors.'
+        raise NotImplementedError('This method must be implemented in successors.')
 
     @task_method
+    @abstractmethod
     def syncdb(self, params=''):
-        raise NotImplementedError, 'Must be implemented in successors.'
+        raise NotImplementedError('This method must be implemented in successors.')
 
     @task_method
+    @abstractmethod
     def migrate(self, params='', do_backup=True):
-        raise NotImplementedError, 'Must be implemented in successors.'
+        raise NotImplementedError('This method must be implemented in successors.')
 
     @task_method
     @utils.inside_project
+    @abstractmethod
     def test(self, what=''):
         """ Launches tests for the web application. """
-        raise NotImplementedError, 'Must be implemented in successors.'
+        raise NotImplementedError('This method must be implemented in successors.')