Skip to content

Commit c1f3f44

Browse files
authored
Merge pull request #199 from Preetwinder/PY3-documentation
PY3 Documentation changes
2 parents 2ceb88f + 313f3ec commit c1f3f44

File tree

9 files changed

+16
-6
lines changed

9 files changed

+16
-6
lines changed

AUTHORS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ Here is the list of the primary authors & contributors:
22

33
* Javier Casas
44
* Alexander Sibiryakov
5-
* Joris Rau
5+
* Joris Rau
6+
* Preetwinder Singh

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ the crawler to decide which pages to visit next, and capable of doing it in dist
1919
- Revisiting logic with RDBMS.
2020
- Optional use of Scrapy for fetching and parsing.
2121
- 3-clause BSD license, allowing to use in any commercial product.
22+
- Python 3 support.
2223

2324
## Installation
2425

docs/source/topics/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Installation Guide
44

55
The installation steps assume that you have the following requirements installed:
66

7-
* `Python`_ 2.7
7+
* `Python`_ 2.7+ or 3.4+
88

99
* `pip`_ and `setuptools`_ Python packages. Nowadays `pip`_ requires and
1010
installs `setuptools`_ if not installed.

docs/source/topics/overview.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ downloading them from the web. Main features of Frontera are:
1616
:doc:`Graph Manager <graph-manager>`.
1717
* transparent transport layer concept (:term:`message bus`) and communication protocol,
1818
* pure Python implementation.
19+
* Python 3 support.
1920

2021

2122
.. _use-cases:

docs/source/topics/quick-start-distributed.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Prerequisites
1313

1414
Here is what services needs to be installed and configured before running Frontera:
1515

16-
- Python 2.7+
16+
- Python 2.7+ or 3.4+
1717
- Scrapy
1818

1919
Frontera installation

frontera/contrib/middlewares/domain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class DomainMiddleware(Middleware):
1515
:attr:`Response.meta <frontera.core.models.Response.meta>` if is activated.
1616
1717
18-
``domain`` object will contains the following fields:
18+
``domain`` object will contain the following fields, with both keys and values as bytes:
1919
2020
- **netloc**: URL netloc according to `RFC 1808`_ syntax specifications
2121
- **name**: Domain name

frontera/contrib/middlewares/fingerprint.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class UrlFingerprintMiddleware(BaseFingerprintMiddleware):
5454
Fingerprint will be calculated from object ``URL``, using the function defined in
5555
:setting:`URL_FINGERPRINT_FUNCTION` setting.
5656
You can write your own fingerprint calculation function and use by changing this setting.
57+
The fingerprint must be bytes.
5758
5859
An example for a :class:`Request <frontera.core.models.Request>` object::
5960
@@ -87,6 +88,7 @@ class DomainFingerprintMiddleware(BaseFingerprintMiddleware):
8788
Fingerprint will be calculated from object ``URL``, using the function defined in
8889
:setting:`DOMAIN_FINGERPRINT_FUNCTION` setting.
8990
You can write your own fingerprint calculation function and use by changing this setting.
91+
The fingerprint must be bytes
9092
9193
An example for a :class:`Request <frontera.core.models.Request>` object::
9294

frontera/core/models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def __init__(self, url, method=b'GET', headers=None, cookies=None, meta=None, bo
2222
:param string method: HTTP method to use.
2323
:param dict headers: dictionary of headers to send.
2424
:param dict cookies: dictionary of cookies to attach to this request.
25-
:param dict meta: dictionary that contains arbitrary metadata for this request.
25+
:param dict meta: dictionary that contains arbitrary metadata for this request, the keys must be bytes and \
26+
the values must be either bytes or serializable objects such as lists, tuples, dictionaries with byte type items.
2627
"""
2728
self._url = to_native_str(url)
2829
self._method = to_bytes((method or b'GET').upper())
@@ -65,7 +66,8 @@ def meta(self):
6566
"""
6667
A dict that contains arbitrary metadata for this request. This dict is empty for new Requests, and is usually
6768
populated by different Frontera components (middlewares, etc). So the data contained in this dict depends
68-
on the components you have enabled.
69+
on the components you have enabled. The keys are bytes and the values are either bytes or serializable objects \
70+
such as lists, tuples, dictionaries with byte type items.
6971
"""
7072
return self._meta
7173

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
'Programming Language :: Python',
3232
'Programming Language :: Python :: 2',
3333
'Programming Language :: Python :: 2.7',
34+
'Programming Language :: Python :: 3',
35+
'Programming Language :: Python :: 3.4',
36+
'Programming Language :: Python :: 3.5',
3437
'Topic :: Internet :: WWW/HTTP',
3538
'Topic :: Software Development :: Libraries :: Application Frameworks',
3639
'Topic :: Software Development :: Libraries :: Python Modules',

0 commit comments

Comments
 (0)