Skip to content

Commit 5a20bde

Browse files
Merge pull request #31 from MuckRock/docs_cleanup
Cleanup docs
2 parents 13c30b3 + a43f1ba commit 5a20bde

File tree

11 files changed

+28
-798
lines changed

11 files changed

+28
-798
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
16+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1717
steps:
1818
- name: Check out code
1919
uses: actions/checkout@v2
@@ -53,4 +53,4 @@ jobs:
5353
5454
- name: Run pylint and black on ./documentcloud and ./tests
5555
run: |
56-
pylint ./documentcloud ./tests; black ./documentcloud ./tests
56+
pylint ./documentcloud ./tests; black --check ./documentcloud ./tests

.pylintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ good-names=i,x1,x2,y1,y2,id
44

55
[MESSAGES CONTROL]
66
disable=missing-docstring,too-many-ancestors,too-few-public-methods,no-else-return,no-member,attribute-defined-outside-init,similarities,import-outside-toplevel,cyclic-import,no-member,no-else-raise,too-many-instance-attributes,too-many-arguments,ungrouped-imports,useless-object-inheritance,no-else-continue
7+
8+
[DESIGN]
9+
max-positional-arguments=10

.travis.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

docs/changelog.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Changelog
22
---------
33

4+
4.4.0
5+
~~~~~
6+
* Removes support for Python 3.7.
7+
48
4.3.0
59
~~~~~
610
* Uses python-squarelet to client handle authentication.

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
"index",
207207
"python-documentcloud.tex",
208208
"python-documentcloud Documentation",
209-
"Los Angeles Times Data Desk",
209+
"MuckRock Foundation",
210210
"manual",
211211
),
212212
]
@@ -241,7 +241,7 @@
241241
"index",
242242
"python-documentcloud",
243243
"python-documentcloud Documentation",
244-
["Los Angeles Times Data Desk"],
244+
["MuckRock Foundation"],
245245
1,
246246
)
247247
]
@@ -260,7 +260,7 @@
260260
"index",
261261
"python-documentcloud",
262262
"python-documentcloud Documentation",
263-
"Los Angeles Times Data Desk",
263+
"MuckRock Foundation",
264264
"python-documentcloud",
265265
"One line description of project.",
266266
"Miscellaneous",

docs/credits.rst

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
Credits
22
-------
33

4-
The lead developer of this project is `Ben Welsh <http://palewi.re/who-is-ben-welsh/>`_.
5-
6-
But it would not be possible without:
7-
8-
* `The DocumentCloud team <https://www.documentcloud.org/about>`_.
9-
* `Chris Amico <https://github.com/eyeseast>`_, `Christopher Groskopf <https://github.com/onyxfish/>`_ and `Mitchell Kotler <http://www.muckrock.com/blog/using-the-documentcloud-api/>`_, who broke ground with code that I've adapted.
10-
* Fixes from friendly people like `Joe Germuska <https://github.com/JoeGermuska>`_, `Shane Shifflet <https://twitter.com/#!/shaneshifflett>`_ and `Adi Eyal <https://github.com/adieyal>`_.
4+
This project would not be possible without:
115

6+
* `The MuckRock technology team <https://www.muckrock.com/staff/>`_,
7+
* `Ben Welsh <https://palewi.re/who-is-ben-welsh />`_,
8+
* Fixes from `Joe Germuska <https://github.com/JoeGermuska>`_, `Shane Shifflet`_,and `Adi Eyal <https://github.com/adieyal>`_.

documentcloud/client.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414

1515
logger = logging.getLogger("documentcloud")
1616

17+
1718
class DocumentCloud(SquareletClient):
1819
"""
1920
The public interface for the DocumentCloud API, now integrated with SquareletClient
2021
"""
21-
# pylint:disable=too-many-positional-arguments
22+
2223
def __init__(
2324
self,
2425
username=None,
@@ -30,15 +31,15 @@ def __init__(
3031
rate_limit=True,
3132
rate_limit_sleep=True,
3233
):
33-
# Initialize SquareletClient for authentication and request handling
34+
# Initialize SquareletClient for authentication and request handling
3435
super().__init__(
3536
base_uri=base_uri,
3637
username=username,
3738
password=password,
3839
auth_uri=auth_uri,
3940
timeout=timeout,
4041
rate_limit=rate_limit,
41-
rate_limit_sleep=rate_limit_sleep
42+
rate_limit_sleep=rate_limit_sleep,
4243
)
4344

4445
# Set up logging
@@ -55,8 +56,3 @@ def __init__(
5556
self.projects = ProjectClient(self)
5657
self.users = UserClient(self)
5758
self.organizations = OrganizationClient(self)
58-
59-
"""def _request(self, method, url, raise_error=True, **kwargs):
60-
Delegates request to the SquareletClient's _request method
61-
return self.squarelet_client.request(method, url, raise_error, **kwargs)
62-
"""

documentcloud/documents.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,7 @@ def upload_directory(self, path, handle_errors=False, extensions=".pdf", **kwarg
404404
path_list = self._collect_files(path, extensions)
405405

406406
logger.info(
407-
"Upload directory on %s: Found %d files to upload",
408-
path,
409-
len(path_list)
407+
"Upload directory on %s: Found %d files to upload", path, len(path_list)
410408
)
411409

412410
# Upload all the files using the bulk API to reduce the number
@@ -444,7 +442,7 @@ def upload_directory(self, path, handle_errors=False, extensions=".pdf", **kwarg
444442
logger.info(
445443
"Error creating the following documents: %s\n%s",
446444
exc,
447-
"\n".join(file_paths)
445+
"\n".join(file_paths),
448446
)
449447
continue
450448
else:
@@ -465,7 +463,7 @@ def upload_directory(self, path, handle_errors=False, extensions=".pdf", **kwarg
465463
logger.info(
466464
"Error uploading the following document: %s %s",
467465
exc,
468-
file_path
466+
file_path,
469467
)
470468
continue
471469
else:
@@ -481,7 +479,7 @@ def upload_directory(self, path, handle_errors=False, extensions=".pdf", **kwarg
481479
logger.info(
482480
"Error creating the following documents: %s\n%s",
483481
exc,
484-
"\n".join(file_paths)
482+
"\n".join(file_paths),
485483
)
486484
continue
487485
else:
@@ -504,11 +502,7 @@ def upload_urls(self, url_list, handle_errors=False, **kwargs):
504502
# Grouper will put None's on the end of the last group
505503
url_group = [url for url in url_group if url is not None]
506504

507-
logger.info(
508-
"Uploading group %d: %s",
509-
i + 1,
510-
"\n".join(url_group)
511-
)
505+
logger.info("Uploading group %d: %s", i + 1, "\n".join(url_group))
512506

513507
# Create the documents
514508
logger.info("Creating the documents...")
@@ -531,7 +525,7 @@ def upload_urls(self, url_list, handle_errors=False, **kwargs):
531525
logger.info(
532526
"Error creating the following documents: %s\n%s",
533527
str(exc),
534-
"\n".join(url_group)
528+
"\n".join(url_group),
535529
)
536530
continue
537531
else:

0 commit comments

Comments
 (0)