From be34ec23c48d6d5d8fd2ef4491981f6fb4bab8e6 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 16 Nov 2014 20:51:04 +0100 Subject: pep8 linting (blank lines expectations) E301 expected 1 blank line, found 0 E302 expected 2 blank lines, found 1 E303 too many blank lines (n) --- git/objects/submodule/util.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'git/objects/submodule/util.py') diff --git a/git/objects/submodule/util.py b/git/objects/submodule/util.py index 237321e2..47b45109 100644 --- a/git/objects/submodule/util.py +++ b/git/objects/submodule/util.py @@ -9,22 +9,27 @@ __all__ = ( 'sm_section', 'sm_name', 'mkhead', 'unbare_repo', 'find_first_remote #{ Utilities + def sm_section(name): """:return: section title used in .gitmodules configuration file""" return 'submodule "%s"' % name + def sm_name(section): """:return: name of the submodule as parsed from the section name""" section = section.strip() return section[11:-1] + def mkhead(repo, path): """:return: New branch/head instance""" return git.Head(repo, git.Head.to_full_path(path)) + def unbare_repo(func): """Methods with this decorator raise InvalidGitRepositoryError if they encounter a bare repository""" + def wrapper(self, *args, **kwargs): if self.repo.bare: raise InvalidGitRepositoryError("Method '%s' cannot operate on bare repositories" % func.__name__) @@ -34,6 +39,7 @@ def unbare_repo(func): wrapper.__name__ = func.__name__ return wrapper + def find_first_remote_branch(remotes, branch_name): """Find the remote branch matching the name of the given branch or raise InvalidGitRepositoryError""" for remote in remotes: @@ -51,6 +57,7 @@ def find_first_remote_branch(remotes, branch_name): #{ Classes class SubmoduleConfigParser(GitConfigParser): + """ Catches calls to _write, and updates the .gitmodules blob in the index with the new data, if we have written into a stream. Otherwise it will -- cgit v1.2.1