mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
Fix flake8-docstrings D205 1 blank line required between summary line and description
This commit is contained in:
parent
777bc7e35d
commit
1d7dba8aeb
4 changed files with 24 additions and 11 deletions
|
@ -127,8 +127,10 @@ class NTMRotatingLogHandler(object):
|
||||||
|
|
||||||
def _log_file_name(self, i):
|
def _log_file_name(self, i):
|
||||||
"""
|
"""
|
||||||
Returns a numbered log file name depending on i. If i==0 it just uses logName, if not it appends
|
Returns a numbered log file name depending on i.
|
||||||
it to the extension (blah.log.3 for i == 3)
|
|
||||||
|
If i==0 it just uses logName, if not it appends it to the extension
|
||||||
|
e.g. (blah.log.3 for i == 3)
|
||||||
|
|
||||||
i: Log number to ues
|
i: Log number to ues
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -14,6 +14,8 @@ from core import logger
|
||||||
|
|
||||||
def db_filename(filename='nzbtomedia.db', suffix=None):
|
def db_filename(filename='nzbtomedia.db', suffix=None):
|
||||||
"""
|
"""
|
||||||
|
Return the correct location of the database file.
|
||||||
|
|
||||||
@param filename: The sqlite database filename to use. If not specified,
|
@param filename: The sqlite database filename to use. If not specified,
|
||||||
will be made to be nzbtomedia.db
|
will be made to be nzbtomedia.db
|
||||||
@param suffix: The suffix to append to the filename. A '.' will be added
|
@param suffix: The suffix to append to the filename. A '.' will be added
|
||||||
|
|
|
@ -3,6 +3,8 @@ import re
|
||||||
|
|
||||||
def sanitize_name(name):
|
def sanitize_name(name):
|
||||||
"""
|
"""
|
||||||
|
Remove bad chars from the filename.
|
||||||
|
|
||||||
>>> sanitize_name('a/b/c')
|
>>> sanitize_name('a/b/c')
|
||||||
'a-b-c'
|
'a-b-c'
|
||||||
>>> sanitize_name('abc')
|
>>> sanitize_name('abc')
|
||||||
|
@ -12,7 +14,6 @@ def sanitize_name(name):
|
||||||
>>> sanitize_name('.a.b..')
|
>>> sanitize_name('.a.b..')
|
||||||
'a.b'
|
'a.b'
|
||||||
"""
|
"""
|
||||||
# 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)
|
||||||
|
|
||||||
|
@ -27,8 +28,8 @@ def sanitize_name(name):
|
||||||
|
|
||||||
|
|
||||||
def clean_file_name(filename):
|
def clean_file_name(filename):
|
||||||
"""Cleans up nzb name by removing any . and _
|
"""
|
||||||
characters, along with any trailing hyphens.
|
Cleans up nzb name by removing any . and _ characters and trailing hyphens.
|
||||||
|
|
||||||
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:
|
||||||
|
|
|
@ -239,8 +239,11 @@ class GitUpdateManager(UpdateManager):
|
||||||
|
|
||||||
def _check_github_for_update(self):
|
def _check_github_for_update(self):
|
||||||
"""
|
"""
|
||||||
Uses git commands to check if there is a newer version that the provided
|
Check Github for a new version.
|
||||||
commit hash. If there is a newer version it sets _num_commits_behind.
|
|
||||||
|
Uses git commands to check if there is a newer version than
|
||||||
|
the provided 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
|
||||||
|
@ -318,8 +321,10 @@ class GitUpdateManager(UpdateManager):
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""
|
"""
|
||||||
Calls git pull origin <branch> in order to update Sick Beard. Returns a bool depending
|
Check git for a new version.
|
||||||
on the call's success.
|
|
||||||
|
Calls git pull origin <branch> in order to update Sick Beard.
|
||||||
|
Returns a bool depending 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
|
||||||
|
|
||||||
|
@ -375,8 +380,11 @@ class SourceUpdateManager(UpdateManager):
|
||||||
|
|
||||||
def _check_github_for_update(self):
|
def _check_github_for_update(self):
|
||||||
"""
|
"""
|
||||||
Uses pygithub to ask github if there is a newer version that the provided
|
Check Github for a new version.
|
||||||
commit hash. If there is a newer version it sets Sick Beard's version text.
|
|
||||||
|
Uses pygithub to ask github if there is a newer version than
|
||||||
|
the provided commit hash. If there is a newer version it sets
|
||||||
|
Sick Beard's version text.
|
||||||
|
|
||||||
commit_hash: hash that we're checking against
|
commit_hash: hash that we're checking against
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue