Fix PEP8 variable and argument names should be snake_case

This commit is contained in:
Labrys of Knossos 2018-12-26 11:38:01 -05:00 committed by Lizband
parent 985f004e32
commit c2f0f3affc
2 changed files with 7 additions and 7 deletions

View file

@ -26,18 +26,18 @@ class DelugeClient(object):
def _get_local_auth(self):
username = password = ""
if platform.system() in ('Windows', 'Microsoft'):
appDataPath = os.environ.get("APPDATA")
if not appDataPath:
app_data_path = os.environ.get("APPDATA")
if not app_data_path:
from six.moves import winreg
hkey = winreg.OpenKey(
winreg.HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
)
appDataReg = winreg.QueryValueEx(hkey, "AppData")
appDataPath = appDataReg[0]
app_data_reg = winreg.QueryValueEx(hkey, "AppData")
app_data_path = app_data_reg[0]
winreg.CloseKey(hkey)
auth_file = os.path.join(appDataPath, "deluge", "auth")
auth_file = os.path.join(app_data_path, "deluge", "auth")
else:
from xdg.BaseDirectory import save_config_path
try:

View file

@ -23,9 +23,9 @@ class MultiPartForm(object):
self.form_fields.append((name, value))
return
def add_file(self, fieldname, filename, fileHandle, mimetype=None):
def add_file(self, fieldname, filename, file_handle, mimetype=None):
"""Add a file to be uploaded."""
body = fileHandle.read()
body = file_handle.read()
if mimetype is None:
mimetype = mimetypes.guess_type(filename)[0] or 'application/octet-stream'
self.files.append((fieldname, filename, mimetype, body))