Browse Source

Added dvcs publisher

main
Lakshmi Vyasarajan 13 years ago
parent
commit
76de9b4649
1 changed files with 44 additions and 0 deletions
  1. +44
    -0
      hyde/ext/publishers/dvcs.py

+ 44
- 0
hyde/ext/publishers/dvcs.py View File

@@ -0,0 +1,44 @@
import sys
import abc

from hyde.loader import load_python_object

class DVCS(object):
__metaclass__ = abc.ABCMeta

def __init__(self, path, settings):
self.path = path
self.url = settings.url
self.branch = settings.branch
self.switch(self.branch)
self.settings = settings

@abc.abstractmethod
def save_draft(self, message=None): pass

@abc.abstractmethod
def publish(self): pass

@abc.abstractmethod
def pull(self): pass

@abc.abstractmethod
def push(self, branch): pass

@abc.abstractmethod
def commit(self, message): pass

@abc.abstractmethod
def switch(self, branch): pass

@abc.abstractmethod
def add_file(self, path, message=None): pass

@abc.abstractmethod
def merge(self, branch): pass

@staticmethod
def load_dvcs(path, settings):
repo_class = load_python_object(settings['type'])
return repo_class(path, repo)


Loading…
Cancel
Save