Skip to content

Commit

Permalink
Merge pull request #365 from JrGoodle/sphinx-markdown
Browse files Browse the repository at this point in the history
Update sphinx documentation
  • Loading branch information
JrGoodle committed Oct 31, 2017
2 parents 8fccdd3 + ecc9dfd commit 874af57
Show file tree
Hide file tree
Showing 35 changed files with 355 additions and 709 deletions.
305 changes: 122 additions & 183 deletions clowder/clowder/clowder_controller.py

Large diffs are not rendered by default.

46 changes: 9 additions & 37 deletions clowder/clowder/clowder_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
class ClowderRepo(object):
"""Class encapsulating clowder repo information
Attributes:
root_directory (str): Root directory of clowder projects
default_ref (str): Default ref
remote (str): Remote name
clowder_path (path): Absolute path to clowder repo
:ivar str root_directory: Root directory of clowder projects
:ivar str default_ref: Default ref
:ivar str remote: Remote name
:ivar str clowder_path: Absolute path to clowder repo
"""

def __init__(self, root_directory):
Expand All @@ -46,24 +45,19 @@ def add(self, files):
"""Add files in clowder repo to git index
:param str files: Files to git add
:return:
"""

ProjectRepo(self.clowder_path, self.remote, self.default_ref).add(files)

def branches(self):
"""Print current local branches
:return:
"""
"""Print current local branches"""

ProjectRepo(self.clowder_path, self.remote, self.default_ref).print_branches(local=True, remote=True)

def checkout(self, ref):
"""Checkout ref in clowder repo
:param str ref: Ref to git checkout
:return:
"""

repo = ProjectRepo(self.clowder_path, self.remote, self.default_ref)
Expand All @@ -77,8 +71,6 @@ def clean(self):
"""Discard changes in clowder repo
Equivalent to: ``git clean -ffdx``
:return:
"""

if self.is_dirty():
Expand All @@ -92,7 +84,6 @@ def commit(self, message):
"""Commit current changes in clowder repo
:param str message: Git commit message
:return:
"""

ProjectRepo(self.clowder_path, self.remote, self.default_ref).commit(message)
Expand All @@ -102,7 +93,6 @@ def init(self, url, branch):
:param str url: URL of repo to clone
:param str branch: Branch to checkout
:return:
"""

# Register exit handler to remove files if cloning repo fails
Expand All @@ -112,10 +102,7 @@ def init(self, url, branch):
self.link()

def init_exit_handler(self):
"""Exit handler for deleting files if init fails
:return:
"""
"""Exit handler for deleting files if init fails"""

if os.path.isdir(self.clowder_path):
clowder_yaml = os.path.join(self.root_directory, 'clowder.yaml')
Expand All @@ -136,7 +123,6 @@ def link(self, version=None):
"""Create symlink pointing to clowder.yaml file
:param Optional[str] version: Version name of clowder.yaml to link. Defaults to None for default clowder.yaml
:return:
"""

if version is None:
Expand All @@ -159,7 +145,6 @@ def print_status(self, fetch=False):
"""Print clowder repo status
:param Optional[str] fetch: Fetch before printing status. Defaults to False
:return:
"""

repo_path = os.path.join(self.root_directory, '.clowder')
Expand Down Expand Up @@ -189,26 +174,19 @@ def print_status(self, fetch=False):
print(symlink_output + ' -> ' + path_output + '\n')

def pull(self):
"""Pull clowder repo upstream changes
:return:
"""
"""Pull clowder repo upstream changes"""

ProjectRepo(self.clowder_path, self.remote, self.default_ref).pull()

def push(self):
"""Push clowder repo changes
:return:
"""
"""Push clowder repo changes"""

ProjectRepo(self.clowder_path, self.remote, self.default_ref).push()

def run_command(self, command):
"""Run command in clowder repo
:param str command: Command to run
:return:
"""

print(fmt.command(command))
Expand All @@ -221,17 +199,12 @@ def git_status(self):
"""Print clowder repo git status
Equivalent to: ``git status -vv``
:return:
"""

ProjectRepo(self.clowder_path, self.remote, self.default_ref).status_verbose()

def _validate_groups(self):
"""Validate status of clowder repo
:return:
"""
"""Validate status of clowder repo"""

if not ProjectRepo(self.clowder_path, self.remote, self.default_ref).validate_repo():
ProjectRepo.print_validation(self.clowder_path)
Expand All @@ -244,7 +217,6 @@ def force_symlink(file1, file2):
:param str file1: File to create symlink pointing to
:param str file2: Symlink location
:return:
"""

try:
Expand Down

0 comments on commit 874af57

Please sign in to comment.