Commit Graph

19 Commits

Author SHA1 Message Date
Domenico Iezzi
7f0fad78ef
Added functions to change locale
Locale and Timezone can be changed even during a session, and results
will change accordingly
2018-01-27 19:42:36 +01:00
Domenico Iezzi
a07640b90e
Updated parameters with more up-to-date values 2018-01-26 20:15:54 +01:00
Domenico Iezzi
c4ba7f80b3
Added auth headers
c21ac5eaf5
2018-01-26 19:46:23 +01:00
Domenico Iezzi
23937e6cb8
Improved file delivery + minor changes
* Updated user agent string with data taken from play-store-api
* *download* and *delivery* functions will now return a python generator
rather than raw bytes, to prevent app loading entire files in memory.
This generator can be iterated to get chunk of bytes to write, as
discussed in issue #35.
* as a consequence of the previous point, there is no more progress bar
feature for downloading. It should be implemented by developers using
the API.
2018-01-26 18:24:19 +01:00
Domenico Iezzi
24a3e1a09b
Changed Locale and TimeZone initialization
Before, if locale wasn't specified as a parameter, it was picked from
the system running gpapi. Similar thing happened for timezone, but its
value was hardcoded in config.py.
To avoid problems related to missing or unavailable apps, this commit
enforces users to provide a locale and a timezone value. Without them,
gpapi can't be initialized.
2018-01-25 11:36:25 +01:00
Domenico Iezzi
12109621a6
Tightened locale checks
Consider the case when locale is manually initalized with a non-string
value, and the case when python's getdefaultlocale() returns None
2017-11-14 11:22:19 +01:00
Domenico Iezzi
c61819d00b
Fix #22
Now gpapi checks if the locale retrieved from system or provided by the
user is valid. In case it's invalid, default to en_US.
2017-11-13 11:44:15 +01:00
Domenico Iezzi
e6c69a5552
Updated default values for bacon 2017-11-10 22:12:34 +01:00
Domenico Iezzi
e1acc14424
Dinamically change locale and timezone
During DeviceBuilder initialization, retrieve locale from system using
python `locale` module, and set timezone to `Europe/Berlin`. Added some
helpers to get and set those values at runtime.
2017-10-30 17:30:10 +01:00
Domenico Iezzi
5034244620 Build request params with current device data
Login and Auth parameters are built using device selected in
deviceBuilder object. Also got rid of an unused parameter client_sig.
2017-10-19 17:51:03 +02:00
Domenico Iezzi
9d0d14450b Fix #16
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
2017-10-13 19:12:06 +02:00
Domenico Iezzi
ed2d658f61 Updated UserAgent string with latest gp version
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
2017-10-13 18:17:32 +02:00
Domenico Iezzi
5bbdd195a1 Moved header string preparation to config.py
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
2017-10-12 19:46:20 +02:00
Domenico Iezzi
11de82f91a Added static method for getDeviceReadableNames
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
2017-10-10 19:23:58 +02:00
Domenico Iezzi
2a5be42203 Helper function to retrieve devices real names
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
2017-10-10 19:18:20 +02:00
Domenico Iezzi
3b37b18542 Code style improvements, checked using flake8
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
2017-10-10 18:35:40 +02:00
Matlink
1b47fdbe19 Add ability to fake devices
Signed-off-by: Matlink <matlink@matlink.fr>
2017-10-09 22:18:36 +02:00
Domenico Iezzi
0a5e270049 Improved python2 compatibility
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
2017-10-04 13:42:52 +02:00
Domenico Iezzi
1739425d35 Added setup.py + changes to the lib structure
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
2017-09-21 11:19:48 +02:00