diff --git a/swh/web/api/views/stat.py b/swh/web/api/views/stat.py --- a/swh/web/api/views/stat.py +++ b/swh/web/api/views/stat.py @@ -16,25 +16,33 @@ Get statistics about the content of the archive. - :>json number content: current number of content objects (aka files) in the archive - :>json number directory: current number of directory objects in the archive - :>json number origin: current number of software origins (an origin is a "place" where code - source can be found, e.g. a git repository, a tarball, ...) in the archive - :>json number origin_visit: current number of visits on software origins to fill the archive - :>json number person: current number of persons (code source authors or committers) + :>json number content: current number of content objects (aka files) in the archive - :>json number release: current number of releases objects in the archive - :>json number revision: current number of revision objects (aka commits) in the archive - :>json number skipped_content: current number of content objects (aka files) which where - not inserted in the archive - :>json number snapshot: current number of snapshot objects (aka set of named branches) + :>json number directory: current number of directory objects in the archive + :>json number origin: current number of software origins + (an origin is a "place" where code source can be found, e.g. a git + repository, a tarball, ...) in the archive + :>json number origin_visit: current number of visits on software + origins to fill the archive + :>json number person: current number of persons (code source authors + or committers) in the archive + :>json number release: current number of releases objects in the + archive + :>json number revision: current number of revision objects + (aka commits) in the archive + :>json number skipped_content: current number of content objects + (aka files) which where not inserted in the archive + :>json number snapshot: current number of snapshot objects + (aka set of named branches) in the archive :reqheader Accept: the requested response content type, either ``application/json`` (default) or ``application/yaml`` - :resheader Content-Type: this depends on :http:header:`Accept` header of request + :resheader Content-Type: this depends on + :http:header:`Accept` header of request - **Allowed HTTP Methods:** :http:method:`get`, :http:method:`head`, :http:method:`options` + **Allowed HTTP Methods:** :http:method:`get`, :http:method:`head`, + :http:method:`options` :statuscode 200: no error @@ -43,5 +51,5 @@ .. parsed-literal:: :swh_web_api:`stat/counters/` - """ # noqa + """ return service.stat_counters() diff --git a/swh/web/browse/utils.py b/swh/web/browse/utils.py --- a/swh/web/browse/utils.py +++ b/swh/web/browse/utils.py @@ -286,13 +286,14 @@ Args: snapshot_branches (dict): A dict describing the branches of a snapshot - as returned for instance by :func:`swh.web.common.service.lookup_snapshot` + as returned for instance by + :func:`swh.web.common.service.lookup_snapshot` Returns: tuple: A tuple whose first member is the sorted list of branches targeting revisions and second member the sorted list of branches targeting releases - """ # noqa + """ snapshot_branches = snapshot['branches'] branches = {} branch_aliases = {} @@ -880,7 +881,8 @@ snapshot_id (str): hexadecimal representation of a snapshot identifier, all other parameters will be ignored if it is provided origin_type (str): the origin type (git, svn, deposit, ...) - origin_url (str): the origin_url (e.g. https://github.com/(user)/(repo)/) + origin_url (str): the origin_url + (e.g. https://github.com/(user)/(repo)/) timestamp (str): a datetime string for retrieving the closest visit of the origin visit_id (int): optional visit id for disambiguation in case @@ -904,7 +906,7 @@ Raises: NotFoundExc: if no snapshot is found for the visit of an origin. - """ # noqa + """ origin_info = None visit_info = None url_args = None @@ -1081,20 +1083,22 @@ Args: swh_objects (list): a list of dict with the following keys: - * type: swh object type (content/directory/release/revision/snapshot) + * type: swh object type + (content/directory/release/revision/snapshot) * id: swh object id - snapshot_context (dict): optional parameter describing the snapshot in which - the object has been found + snapshot_context (dict): optional parameter describing the snapshot in + which the object has been found Returns: list: a list of dict with the following keys: - * object_type: the swh object type (content/directory/release/revision/snapshot) + * object_type: the swh object type + (content/directory/release/revision/snapshot) * object_icon: the swh object icon to use in HTML views * swh_id: the computed swh object persistent identifier * swh_id_url: the url resolving the persistent identifier - * show_options: boolean indicating if the persistent id options must - be displayed in persistent ids HTML view - """ # noqa + * show_options: boolean indicating if the persistent id options + must be displayed in persistent ids HTML view + """ swh_ids = [] for swh_object in swh_objects: if not swh_object['id']: diff --git a/swh/web/browse/views/content.py b/swh/web/browse/views/content.py --- a/swh/web/browse/views/content.py +++ b/swh/web/browse/views/content.py @@ -34,8 +34,9 @@ """Django view that produces a raw display of a content identified by its hash value. - The url that points to it is :http:get:`/browse/content/[(algo_hash):](hash)/raw/` - """ # noqa + The url that points to it is + :http:get:`/browse/content/[(algo_hash):](hash)/raw/` + """ try: reencode = bool(strtobool(request.GET.get('reencode', 'false'))) algo, checksum = query.parse_hash(query_string) @@ -170,8 +171,9 @@ """Django view that produces an HTML display of a content identified by its hash value. - The url that points to it is :http:get:`/browse/content/[(algo_hash):](hash)/` - """ # noqa + The url that points to it is + :http:get:`/browse/content/[(algo_hash):](hash)/` + """ try: algo, checksum = query.parse_hash(query_string) checksum = hash_to_hex(checksum) diff --git a/swh/web/browse/views/directory.py b/swh/web/browse/views/directory.py --- a/swh/web/browse/views/directory.py +++ b/swh/web/browse/views/directory.py @@ -31,8 +31,9 @@ """Django view for browsing the content of a directory identified by its sha1_git value. - The url that points to it is :http:get:`/browse/directory/(sha1_git)/[(path)/]` - """ # noqa + The url that points to it is + :http:get:`/browse/directory/(sha1_git)/[(path)/]` + """ root_sha1_git = sha1_git try: if path: