| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ def _init_externals(): | |||
| 20 | 20 | import gitdb | |
| 21 | 21 | except ImportError: | |
| 22 | 22 | raise ImportError("'gitdb' could not be found in your PYTHONPATH") | |
| 23 | - #END verify import | ||
| 23 | + # END verify import | ||
| 24 | 24 | ||
| 25 | 25 | #} END initialization | |
| 26 | 26 | ||
@@ -41,13 +41,13 @@ def _init_externals(): | |||
| 41 | 41 | from git.remote import * | |
| 42 | 42 | from git.index import * | |
| 43 | 43 | from git.util import ( | |
| 44 | - LockFile, | ||
| 45 | - BlockingLockFile, | ||
| 46 | - Stats, | ||
| 47 | - Actor | ||
| 48 | - ) | ||
| 44 | + LockFile, | ||
| 45 | + BlockingLockFile, | ||
| 46 | + Stats, | ||
| 47 | + Actor | ||
| 48 | + ) | ||
| 49 | 49 | ||
| 50 | 50 | #} END imports | |
| 51 | 51 | ||
| 52 | 52 | __all__ = [name for name, obj in locals().items() | |
| 53 | - if not (name.startswith('_') or inspect.ismodule(obj))] | ||
| 53 | + if not (name.startswith('_') or inspect.ismodule(obj))] | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,18 +4,19 @@ | |||
| 4 | 4 | # This module is part of GitPython and is released under | |
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | 6 | ||
| 7 | - import os, sys | ||
| 7 | + import os | ||
| 8 | + import sys | ||
| 8 | 9 | from util import ( | |
| 9 | - LazyMixin, | ||
| 10 | - stream_copy | ||
| 11 | - ) | ||
| 10 | + LazyMixin, | ||
| 11 | + stream_copy | ||
| 12 | + ) | ||
| 12 | 13 | from exc import GitCommandError | |
| 13 | 14 | ||
| 14 | 15 | from subprocess import ( | |
| 15 | - call, | ||
| 16 | - Popen, | ||
| 17 | - PIPE | ||
| 18 | - ) | ||
| 16 | + call, | ||
| 17 | + Popen, | ||
| 18 | + PIPE | ||
| 19 | + ) | ||
| 19 | 20 | ||
| 20 | 21 | execute_kwargs = ('istream', 'with_keep_cwd', 'with_extended_output', | |
| 21 | 22 | 'with_exceptions', 'as_process', | |
@@ -29,6 +30,7 @@ def dashify(string): | |||
| 29 | 30 | ||
| 30 | 31 | ||
| 31 | 32 | class Git(LazyMixin): | |
| 33 | + | ||
| 32 | 34 | """ | |
| 33 | 35 | The Git class manages communication with the Git binary. | |
| 34 | 36 | ||
@@ -246,7 +248,7 @@ def _set_cache_(self, attr): | |||
| 246 | 248 | self._version_info = tuple(int(n) for n in version_numbers.split('.')[:4] if n.isdigit()) | |
| 247 | 249 | else: | |
| 248 | 250 | super(Git, self)._set_cache_(attr) | |
| 249 | - #END handle version info | ||
| 251 | + # END handle version info | ||
| 250 | 252 | ||
| 251 | 253 | @property | |
| 252 | 254 | def working_dir(self): | |
@@ -336,25 +338,25 @@ def execute(self, command, | |||
| 336 | 338 | ||
| 337 | 339 | # Allow the user to have the command executed in their working dir. | |
| 338 | 340 | if with_keep_cwd or self._working_dir is None: | |
| 339 | - cwd = os.getcwd() | ||
| 341 | + cwd = os.getcwd() | ||
| 340 | 342 | else: | |
| 341 | - cwd = self._working_dir | ||
| 343 | + cwd = self._working_dir | ||
| 342 | 344 | ||
| 343 | 345 | # Start the process | |
| 344 | 346 | env = os.environ.copy() | |
| 345 | 347 | env["LC_MESSAGES"] = "C" | |
| 346 | 348 | proc = Popen(command, | |
| 347 | - env=env, | ||
| 348 | - cwd=cwd, | ||
| 349 | - stdin=istream, | ||
| 350 | - stderr=PIPE, | ||
| 351 | - stdout=PIPE, | ||
| 352 | - # Prevent cmd prompt popups on windows by using a shell ... . | ||
| 353 | - # See https://github.com/gitpython-developers/GitPython/pull/126 | ||
| 354 | - shell=sys.platform == 'win32', | ||
| 355 | - close_fds=(os.name == 'posix'), # unsupported on linux | ||
| 356 | - **subprocess_kwargs | ||
| 357 | - ) | ||
| 349 | + env=env, | ||
| 350 | + cwd=cwd, | ||
| 351 | + stdin=istream, | ||
| 352 | + stderr=PIPE, | ||
| 353 | + stdout=PIPE, | ||
| 354 | + # Prevent cmd prompt popups on windows by using a shell ... . | ||
| 355 | + # See https://github.com/gitpython-developers/GitPython/pull/126 | ||
| 356 | + shell=sys.platform == 'win32', | ||
| 357 | + close_fds=(os.name == 'posix'), # unsupported on linux | ||
| 358 | + **subprocess_kwargs | ||
| 359 | + ) | ||
| 358 | 360 | if as_process: | |
| 359 | 361 | return self.AutoInterrupt(proc, command) | |
| 360 | 362 | ||
@@ -508,7 +510,7 @@ def make_call(): | |||
| 508 | 510 | call.extend([dashify(method)]) | |
| 509 | 511 | call.extend(args) | |
| 510 | 512 | return call | |
| 511 | - #END utility to recreate call after changes | ||
| 513 | + # END utility to recreate call after changes | ||
| 512 | 514 | ||
| 513 | 515 | if sys.platform == 'win32': | |
| 514 | 516 | try: | |
@@ -518,7 +520,7 @@ def make_call(): | |||
| 518 | 520 | # did we switch to git.cmd already, or was it changed from default ? permanently fail | |
| 519 | 521 | if self.GIT_PYTHON_GIT_EXECUTABLE != self.git_exec_name: | |
| 520 | 522 | raise | |
| 521 | - #END handle overridden variable | ||
| 523 | + # END handle overridden variable | ||
| 522 | 524 | type(self).GIT_PYTHON_GIT_EXECUTABLE = self.git_exec_name_win | |
| 523 | 525 | call = [self.GIT_PYTHON_GIT_EXECUTABLE] + list(args) | |
| 524 | 526 | ||
@@ -529,14 +531,14 @@ def make_call(): | |||
| 529 | 531 | msg = "WARNING: Automatically switched to use git.cmd as git executable, which reduces performance by ~70%." | |
| 530 | 532 | msg += "Its recommended to put git.exe into the PATH or to set the %s environment variable to the executable's location" % self._git_exec_env_var | |
| 531 | 533 | warnings.warn(msg) | |
| 532 | - #END print of warning | ||
| 533 | - #END catch first failure | ||
| 534 | + # END print of warning | ||
| 535 | + # END catch first failure | ||
| 534 | 536 | except WindowsError: | |
| 535 | 537 | raise WindowsError("The system cannot find or execute the file at %r" % self.GIT_PYTHON_GIT_EXECUTABLE) | |
| 536 | - #END provide better error message | ||
| 538 | + # END provide better error message | ||
| 537 | 539 | else: | |
| 538 | 540 | return self.execute(make_call(), **_kwargs) | |
| 539 | - #END handle windows default installation | ||
| 541 | + # END handle windows default installation | ||
| 540 | 542 | ||
| 541 | 543 | def _parse_object_header(self, header_line): | |
| 542 | 544 | """ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -80,7 +80,7 @@ class SectionConstraint(object): | |||
| 80 | 80 | It supports all ConfigParser methods that operate on an option""" | |
| 81 | 81 | __slots__ = ("_config", "_section_name") | |
| 82 | 82 | _valid_attrs_ = ("get_value", "set_value", "get", "set", "getint", "getfloat", "getboolean", "has_option", | |
| 83 | - "remove_section", "remove_option", "options") | ||
| 83 | + "remove_section", "remove_option", "options") | ||
| 84 | 84 | ||
| 85 | 85 | def __init__(self, config, section): | |
| 86 | 86 | self._config = config | |
@@ -136,7 +136,7 @@ class GitConfigParser(cp.RawConfigParser, object): | |||
| 136 | 136 | # (either : or =), followed | |
| 137 | 137 | # by any # space/tab | |
| 138 | 138 | r'(?P<value>.*)$' # everything up to eol | |
| 139 | - ) | ||
| 139 | + ) | ||
| 140 | 140 | ||
| 141 | 141 | # list of RawConfigParser methods able to change the instance | |
| 142 | 142 | _mutating_methods_ = ("add_section", "remove_section", "remove_option", "set") | |
@@ -165,7 +165,8 @@ def __init__(self, file_or_files, read_only=True): | |||
| 165 | 165 | ||
| 166 | 166 | if not read_only: | |
| 167 | 167 | if isinstance(file_or_files, (tuple, list)): | |
| 168 | - raise ValueError("Write-ConfigParsers can operate on a single file only, multiple files have been passed") | ||
| 168 | + raise ValueError( | ||
| 169 | + "Write-ConfigParsers can operate on a single file only, multiple files have been passed") | ||
| 169 | 170 | # END single file check | |
| 170 | 171 | ||
| 171 | 172 | if not isinstance(file_or_files, basestring): | |
@@ -338,7 +339,7 @@ def write(self): | |||
| 338 | 339 | # make sure we do not overwrite into an existing file | |
| 339 | 340 | if hasattr(fp, 'truncate'): | |
| 340 | 341 | fp.truncate() | |
| 341 | - #END | ||
| 342 | + # END | ||
| 342 | 343 | # END handle stream or file | |
| 343 | 344 | ||
| 344 | 345 | # WRITE DATA | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,25 +1,25 @@ | |||
| 1 | 1 | """Module with our own gitdb implementation - it uses the git command""" | |
| 2 | 2 | from exc import ( | |
| 3 | - GitCommandError, | ||
| 4 | - BadObject | ||
| 5 | - ) | ||
| 3 | + GitCommandError, | ||
| 4 | + BadObject | ||
| 5 | + ) | ||
| 6 | 6 | ||
| 7 | 7 | from gitdb.base import ( | |
| 8 | - OInfo, | ||
| 9 | - OStream | ||
| 10 | - ) | ||
| 8 | + OInfo, | ||
| 9 | + OStream | ||
| 10 | + ) | ||
| 11 | 11 | ||
| 12 | 12 | from gitdb.util import ( | |
| 13 | - bin_to_hex, | ||
| 14 | - hex_to_bin | ||
| 15 | - ) | ||
| 13 | + bin_to_hex, | ||
| 14 | + hex_to_bin | ||
| 15 | + ) | ||
| 16 | 16 | from gitdb.db import GitDB | |
| 17 | 17 | from gitdb.db import LooseObjectDB | |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | __all__ = ('GitCmdObjectDB', 'GitDB') | |
| 21 | 21 | ||
| 22 | - #class GitCmdObjectDB(CompoundDB, ObjectDBW): | ||
| 22 | + # class GitCmdObjectDB(CompoundDB, ObjectDBW): | ||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | 25 | class GitCmdObjectDB(LooseObjectDB): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -308,8 +308,8 @@ def _index_from_patch_format(cls, repo, stream): | |||
| 308 | 308 | new_file, deleted_file = bool(new_file_mode), bool(deleted_file_mode) | |
| 309 | 309 | ||
| 310 | 310 | index.append(Diff(repo, a_path, b_path, a_blob_id, b_blob_id, | |
| 311 | - old_mode or deleted_file_mode, new_mode or new_file_mode or b_mode, | ||
| 312 | - new_file, deleted_file, rename_from, rename_to, diff[header.end():])) | ||
| 311 | + old_mode or deleted_file_mode, new_mode or new_file_mode or b_mode, | ||
| 312 | + new_file, deleted_file, rename_from, rename_to, diff[header.end():])) | ||
| 313 | 313 | ||
| 314 | 314 | return index | |
| 315 | 315 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments