browserfetch 0.3.0__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: browserfetch
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: fetch in Python using your browser!
5
5
  License: GNU General Public License v3 (GPLv3)
6
6
  Project-URL: Homepage, https://github.com/5j9/browserfetch
@@ -63,7 +63,8 @@ Motivations
63
63
 
64
64
  Downsides
65
65
  ---------
66
- * Setting up ``browserfetch`` is a more cumbersome since it requires running a Python server and also injecting a small script into the webpage. Using ``browser_cookie3`` might be a better choice if there are many websites that you need to communicate with.
66
+ * Setting up ``browserfetch`` is more cumbersome since it requires running a Python server and also injecting a small script into the webpage. Using ``browser_cookie3`` might be a better choice if there are many websites that you need to communicate with.
67
+ * To run more than one server at the same time, you have to change the port number in both `start_server(port=)` call and in the corresponding JavaScript for each instance of the program.
67
68
 
68
69
  .. _`browser_cookie3 stopped working on Chrome-based browsers`: https://github.com/borisbabic/browser_cookie3/issues/180
69
70
  .. _tampermonkey: https://github.com/Tampermonkey/tampermonkey
@@ -49,7 +49,8 @@ Motivations
49
49
 
50
50
  Downsides
51
51
  ---------
52
- * Setting up ``browserfetch`` is a more cumbersome since it requires running a Python server and also injecting a small script into the webpage. Using ``browser_cookie3`` might be a better choice if there are many websites that you need to communicate with.
52
+ * Setting up ``browserfetch`` is more cumbersome since it requires running a Python server and also injecting a small script into the webpage. Using ``browser_cookie3`` might be a better choice if there are many websites that you need to communicate with.
53
+ * To run more than one server at the same time, you have to change the port number in both `start_server(port=)` call and in the corresponding JavaScript for each instance of the program.
53
54
 
54
55
  .. _`browser_cookie3 stopped working on Chrome-based browsers`: https://github.com/borisbabic/browser_cookie3/issues/180
55
56
  .. _tampermonkey: https://github.com/Tampermonkey/tampermonkey
@@ -1,4 +1,4 @@
1
- __version__ = '0.3.0'
1
+ __version__ = '0.4.0'
2
2
 
3
3
  import atexit
4
4
  from asyncio import Lock, Queue, gather, get_event_loop, wait_for
@@ -43,7 +43,7 @@ class Response:
43
43
 
44
44
  def json(self, encoding=None, errors='strict'):
45
45
  if encoding is None:
46
- return loads(self.body, errors=errors)
46
+ return loads(self.body)
47
47
  return loads(self.text(encoding=encoding, errors=errors))
48
48
 
49
49
 
@@ -200,13 +200,13 @@ async def post(
200
200
 
201
201
  app = Application()
202
202
  app.add_routes(routes)
203
- # To stop serving await app_runner.cleanup()
204
203
  app_runner = AppRunner(app)
205
204
 
206
205
 
207
206
  @atexit.register
208
207
  def shutdown_server():
209
208
  loop = get_event_loop()
209
+ logger.info('waiting for app_runner.cleanup()')
210
210
  loop.run_until_complete(app_runner.cleanup())
211
211
 
212
212
 
@@ -214,3 +214,4 @@ async def start_server(*, host='127.0.0.1', port=9404):
214
214
  await app_runner.setup()
215
215
  site = TCPSite(app_runner, host, port)
216
216
  await site.start()
217
+ logger.info('server started at http://%s:%s', host, port)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: browserfetch
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: fetch in Python using your browser!
5
5
  License: GNU General Public License v3 (GPLv3)
6
6
  Project-URL: Homepage, https://github.com/5j9/browserfetch
@@ -63,7 +63,8 @@ Motivations
63
63
 
64
64
  Downsides
65
65
  ---------
66
- * Setting up ``browserfetch`` is a more cumbersome since it requires running a Python server and also injecting a small script into the webpage. Using ``browser_cookie3`` might be a better choice if there are many websites that you need to communicate with.
66
+ * Setting up ``browserfetch`` is more cumbersome since it requires running a Python server and also injecting a small script into the webpage. Using ``browser_cookie3`` might be a better choice if there are many websites that you need to communicate with.
67
+ * To run more than one server at the same time, you have to change the port number in both `start_server(port=)` call and in the corresponding JavaScript for each instance of the program.
67
68
 
68
69
  .. _`browser_cookie3 stopped working on Chrome-based browsers`: https://github.com/borisbabic/browser_cookie3/issues/180
69
70
  .. _tampermonkey: https://github.com/Tampermonkey/tampermonkey
File without changes
File without changes