mirror of
https://github.com/FliegendeWurst/googleplay-api.git
synced 2024-11-22 04:44:59 +00:00
Enforce same style for every function name
This commit is contained in:
parent
e1d2671caf
commit
af10ec6494
@ -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:
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user