From af10ec649489defd7dbcce7494f57a4c7eb4d283 Mon Sep 17 00:00:00 2001 From: Domenico Iezzi Date: Tue, 22 Jan 2019 22:35:32 +0100 Subject: [PATCH] Enforce same style for every function name --- gpapi/config.py | 4 ++-- gpapi/googleplay.py | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gpapi/config.py b/gpapi/config.py index f31c103..f38457d 100644 --- a/gpapi/config.py +++ b/gpapi/config.py @@ -55,7 +55,7 @@ class DeviceBuilder(object): for (key, value) in config.items(device): self.device[key] = value - def set_locale(self, locale): + def setLocale(self, locale): # test if provided locale is valid if locale is None or type(locale) is not str: raise InvalidLocaleError() @@ -66,7 +66,7 @@ class DeviceBuilder(object): raise InvalidLocaleError() self.locale = locale - def set_timezone(self, timezone): + def setTimezone(self, timezone): if timezone is None or type(timezone) is not str: timezone = self.device.get('timezone') if timezone is None: diff --git a/gpapi/googleplay.py b/gpapi/googleplay.py index a804c42..69f0559 100644 --- a/gpapi/googleplay.py +++ b/gpapi/googleplay.py @@ -68,7 +68,7 @@ class GooglePlayAPI(object): Usual APIs methods are login(), search(), details(), bulkDetails(), download(), browse(), reviews() and list().""" - def __init__(self, locale, timezone, device_codename='bacon', + def __init__(self, locale="en_US", timezone="UTC", device_codename="bacon", proxies_config=None): self.authSubToken = None self.gsfId = None @@ -77,16 +77,16 @@ class GooglePlayAPI(object): self.dfeCookie = None self.proxies_config = proxies_config self.deviceBuilder = config.DeviceBuilder(device_codename) - self.set_locale(locale) - self.set_timezone(timezone) + self.setLocale(locale) + self.setTimezone(timezone) - def set_locale(self, locale): - self.deviceBuilder.set_locale(locale) + def setLocale(self, locale): + self.deviceBuilder.setLocale(locale) - def set_timezone(self, timezone): - self.deviceBuilder.set_timezone(timezone) + def setTimezone(self, timezone): + self.deviceBuilder.setTimezone(timezone) - def encrypt_password(self, login, passwd): + def encryptPassword(self, login, passwd): """Encrypt credentials using the google publickey, with the RSA algorithm""" @@ -211,7 +211,7 @@ class GooglePlayAPI(object): # First time setup, where we obtain an ac2dm token and # upload device information - encryptedPass = self.encrypt_password(email, password).decode('utf-8') + encryptedPass = self.encryptPassword(email, password).decode('utf-8') # AC2DM token params = self.deviceBuilder.getLoginParams(email, encryptedPass) params['service'] = 'ac2dm'