mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
Fix flake8-docstrings D202 No blank lines allowed after function docstring
This commit is contained in:
parent
4dd58afaf6
commit
777bc7e35d
3 changed files with 0 additions and 11 deletions
|
@ -112,7 +112,6 @@ class NTMRotatingLogHandler(object):
|
||||||
|
|
||||||
def _config_handler(self):
|
def _config_handler(self):
|
||||||
"""Configure a file handler to log at file_name and return it."""
|
"""Configure a file handler to log at file_name and return it."""
|
||||||
|
|
||||||
file_handler = logging.FileHandler(self.log_file_path, encoding='utf-8')
|
file_handler = logging.FileHandler(self.log_file_path, encoding='utf-8')
|
||||||
|
|
||||||
file_handler.setLevel(DB)
|
file_handler.setLevel(DB)
|
||||||
|
@ -133,7 +132,6 @@ class NTMRotatingLogHandler(object):
|
||||||
|
|
||||||
i: Log number to ues
|
i: Log number to ues
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return self.log_file_path + ('.{0}'.format(i) if i else '')
|
return self.log_file_path + ('.{0}'.format(i) if i else '')
|
||||||
|
|
||||||
def _num_logs(self):
|
def _num_logs(self):
|
||||||
|
@ -142,7 +140,6 @@ class NTMRotatingLogHandler(object):
|
||||||
|
|
||||||
Returns: The number of the last used file (eg. mylog.log.3 would return 3). If there are no logs it returns -1
|
Returns: The number of the last used file (eg. mylog.log.3 would return 3). If there are no logs it returns -1
|
||||||
"""
|
"""
|
||||||
|
|
||||||
cur_log = 0
|
cur_log = 0
|
||||||
while os.path.isfile(self._log_file_name(cur_log)):
|
while os.path.isfile(self._log_file_name(cur_log)):
|
||||||
cur_log += 1
|
cur_log += 1
|
||||||
|
|
|
@ -12,7 +12,6 @@ def sanitize_name(name):
|
||||||
>>> sanitize_name('.a.b..')
|
>>> sanitize_name('.a.b..')
|
||||||
'a.b'
|
'a.b'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# remove bad chars from the filename
|
# remove bad chars from the filename
|
||||||
name = re.sub(r'[\\/*]', '-', name)
|
name = re.sub(r'[\\/*]', '-', name)
|
||||||
name = re.sub(r'[:\'<>|?]', '', name)
|
name = re.sub(r'[:\'<>|?]', '', name)
|
||||||
|
@ -34,7 +33,6 @@ def clean_file_name(filename):
|
||||||
Is basically equivalent to replacing all _ and . with a
|
Is basically equivalent to replacing all _ and . with a
|
||||||
space, but handles decimal numbers in string, for example:
|
space, but handles decimal numbers in string, for example:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
filename = re.sub(r'(\D)\.(?!\s)(\D)', r'\1 \2', filename)
|
filename = re.sub(r'(\D)\.(?!\s)(\D)', r'\1 \2', filename)
|
||||||
filename = re.sub(r'(\d)\.(\d{4})', r'\1 \2', filename) # if it ends in a year then don't keep the dot
|
filename = re.sub(r'(\d)\.(\d{4})', r'\1 \2', filename) # if it ends in a year then don't keep the dot
|
||||||
filename = re.sub(r'(\D)\.(?!\s)', r'\1 ', filename)
|
filename = re.sub(r'(\D)\.(?!\s)', r'\1 ', filename)
|
||||||
|
|
|
@ -45,7 +45,6 @@ class CheckVersion(object):
|
||||||
'git': running from source using git
|
'git': running from source using git
|
||||||
'source': running from source without git
|
'source': running from source without git
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# check if we're a windows build
|
# check if we're a windows build
|
||||||
if os.path.isdir(os.path.join(core.APP_ROOT, u'.git')):
|
if os.path.isdir(os.path.join(core.APP_ROOT, u'.git')):
|
||||||
install_type = 'git'
|
install_type = 'git'
|
||||||
|
@ -62,7 +61,6 @@ class CheckVersion(object):
|
||||||
|
|
||||||
force: if true the VERSION_NOTIFY setting will be ignored and a check will be forced
|
force: if true the VERSION_NOTIFY setting will be ignored and a check will be forced
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not core.VERSION_NOTIFY and not force:
|
if not core.VERSION_NOTIFY and not force:
|
||||||
logger.log(u'Version checking is disabled, not checking for the newest version')
|
logger.log(u'Version checking is disabled, not checking for the newest version')
|
||||||
return False
|
return False
|
||||||
|
@ -215,7 +213,6 @@ class GitUpdateManager(UpdateManager):
|
||||||
|
|
||||||
Returns: True for success or False for failure
|
Returns: True for success or False for failure
|
||||||
"""
|
"""
|
||||||
|
|
||||||
output, err, exit_status = self._run_git(self._git_path, 'rev-parse HEAD') # @UnusedVariable
|
output, err, exit_status = self._run_git(self._git_path, 'rev-parse HEAD') # @UnusedVariable
|
||||||
|
|
||||||
if exit_status == 0 and output:
|
if exit_status == 0 and output:
|
||||||
|
@ -245,7 +242,6 @@ class GitUpdateManager(UpdateManager):
|
||||||
Uses git commands to check if there is a newer version that the provided
|
Uses git commands to check if there is a newer version that the provided
|
||||||
commit hash. If there is a newer version it sets _num_commits_behind.
|
commit hash. If there is a newer version it sets _num_commits_behind.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self._newest_commit_hash = None
|
self._newest_commit_hash = None
|
||||||
self._num_commits_behind = 0
|
self._num_commits_behind = 0
|
||||||
self._num_commits_ahead = 0
|
self._num_commits_ahead = 0
|
||||||
|
@ -325,7 +321,6 @@ class GitUpdateManager(UpdateManager):
|
||||||
Calls git pull origin <branch> in order to update Sick Beard. Returns a bool depending
|
Calls git pull origin <branch> in order to update Sick Beard. Returns a bool depending
|
||||||
on the call's success.
|
on the call's success.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
output, err, exit_status = self._run_git(self._git_path, 'pull origin {branch}'.format(branch=self.branch)) # @UnusedVariable
|
output, err, exit_status = self._run_git(self._git_path, 'pull origin {branch}'.format(branch=self.branch)) # @UnusedVariable
|
||||||
|
|
||||||
if exit_status == 0:
|
if exit_status == 0:
|
||||||
|
@ -385,7 +380,6 @@ class SourceUpdateManager(UpdateManager):
|
||||||
|
|
||||||
commit_hash: hash that we're checking against
|
commit_hash: hash that we're checking against
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self._num_commits_behind = 0
|
self._num_commits_behind = 0
|
||||||
self._newest_commit_hash = None
|
self._newest_commit_hash = None
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue