summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects/files.py
Commit message (Collapse)AuthorAgeFilesLines
* chore: replace usage of utils._url_encode() with utils.EncodedId()jlvillal/encoded_idJohn L. Villalovos2022-01-131-6/+6
| | | | | | utils.EncodedId() has basically the same functionalityy of using utils._url_encode(). So remove utils._url_encode() as we don't need it.
* fix: use url-encoded ID in all pathsJohn L. Villalovos2022-01-131-1/+1
| | | | | | | | | | | | Make sure all usage of the ID in the URL path is encoded. Normally it isn't an issue as most IDs are integers or strings which don't contain a slash ('/'). But when the ID is a string with a slash character it will break things. Add a test case that shows this fixes wikis issue with subpages which use the slash character. Closes: #1079
* fix: remove custom URL encodingJohn L. Villalovos2022-01-081-7/+8
| | | | | | | | | | We were using `str.replace()` calls to take care of URL encoding issues. Switch them to use our `utils._url_encode()` function which itself uses `urllib.parse.quote()` Closes: #1356
* docs: use annotations for return typesdocs/sphinx-annotationsNejc Habjan2021-12-011-4/+4
|
* docs: only use type annotations for documentationNejc Habjan2021-11-281-19/+19
|
* chore: add type-hints to gitlab/v4/objects/files.pyjlvillal/mypy_epicsJohn L. Villalovos2021-11-211-12/+58
|
* refactor: use new-style formatting for named placeholdersNejc Habjan2021-11-081-1/+1
|
* refactor: use f-strings for string formattingNejc Habjan2021-11-051-5/+5
|
* chore: fix import ordering using isortJohn L. Villalovos2021-05-251-2/+3
| | | | | | Fix the import ordering using isort. https://pycqa.github.io/isort/
* fix(files): do not url-encode file paths twiceNejc Habjan2021-04-261-1/+0
|
* fix: correct ProjectFile.decode() documentationJohn L. Villalovos2021-04-221-2/+2
| | | | | | | | | | | | | | ProjectFile.decode() returns 'bytes' and not 'str'. Update the method's doc-string and add a type-hint. ProjectFile.decode() returns the result of a call to base64.b64decode() The docs for that function state it returns 'bytes': https://docs.python.org/3/library/base64.html#base64.b64decode Fixes: #1403
* chore: have _create_attrs & _update_attrs be a namedtupleJohn L. Villalovos2021-04-171-7/+7
| | | | | | Convert _create_attrs and _update_attrs to use a NamedTuple (RequiredOptional) to help with code readability. Update all code to use the NamedTuple.
* chore: remove usage of 'from ... import *'John L. Villalovos2021-02-231-2/+9
| | | | | | | | | | | | | | | | | | In gitlab/v4/objects/*.py remove usage of: * from gitlab.base import * * from gitlab.mixins import * Change them to: * from gitlab.base import CLASS_NAME * from gitlab.mixins import CLASS_NAME Programmatically update code to explicitly import needed classes only. After the change the output of: $ flake8 gitlab/v4/objects/*py | grep 'REST\|Mixin' Is empty. Before many messages about unable to determine if it was a valid name.
* refactor(api): explicitly export classes for star importsrefactor/split-objectsNejc Habjan2021-02-071-2/+7
|
* refactor(v4): split objects and managers per API resourceNejc Habjan2021-02-071-0/+216