Skip to content

Commit 1494587

Browse files
committed
linting updates
1 parent 52a09f6 commit 1494587

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

pystac/catalog.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def fn():
492492
setter_funcs.append(fn)
493493

494494
return setter_funcs
495-
495+
496496
# Collect functions that will actually mutate the objects.
497497
# Delay mutation as setting hrefs while walking the catalog
498498
# can result in bad links.
@@ -598,11 +598,11 @@ def save(self, catalog_type=None):
598598

599599
include_self_link = False
600600
# include a self link if this is the root catalog or if ABSOLUTE_PUBLISHED catalog
601-
if ((self.get_self_href() == self.get_root_link().get_absolute_href()
602-
and root.catalog_type != CatalogType.SELF_CONTAINED) or
603-
root.catalog_type == CatalogType.ABSOLUTE_PUBLISHED):
601+
if ((self.get_self_href() == self.get_root_link().get_absolute_href()
602+
and root.catalog_type != CatalogType.SELF_CONTAINED)
603+
or root.catalog_type == CatalogType.ABSOLUTE_PUBLISHED):
604604
include_self_link = True
605-
605+
606606
self.save_object(include_self_link=include_self_link)
607607

608608
self.catalog_type = catalog_type

pystac/link.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from copy import (copy, deepcopy)
2-
from enum import Enum
32

43
from pystac import STACError
54
from pystac.stac_io import STAC_IO
@@ -77,9 +76,9 @@ def get_href(self):
7776
"""Gets the HREF for this link.
7877
7978
Returns:
80-
str: Returns this link's HREF. If there is an owner of the link and
79+
str: Returns this link's HREF. If there is an owner of the link and
8180
the root catalog (if there is one) is of type RELATIVE_PUBLISHED,
82-
then the HREF returned will be relative.
81+
then the HREF returned will be relative.
8382
In all other cases, this method will return an absolute HREF.
8483
"""
8584
href = None

tests/test_catalog.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
from collections import defaultdict
77

88
import pystac
9-
from pystac import (Catalog, Collection, CatalogType, Item, Asset, MediaType, Extensions, HIERARCHICAL_LINKS)
9+
from pystac import (Catalog, Collection, CatalogType,
10+
Item, Asset, MediaType, Extensions, HIERARCHICAL_LINKS)
1011
from pystac.extensions.label import LabelClasses
1112
from pystac.validation import STACValidationError
1213
from pystac.utils import is_absolute_href
@@ -656,8 +657,6 @@ def check_all_relative(cat):
656657
for item in items:
657658
for link in item.links:
658659
if link.rel in HIERARCHICAL_LINKS:
659-
if is_absolute_href(link.get_href()):
660-
import pdb; pdb.set_trace()
661660
self.assertFalse(is_absolute_href(link.get_href()))
662661

663662
def check_all_absolute(cat):

tests/test_writing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def validate_file(self, path, object_type):
3030
d = STAC_IO.read_json(path)
3131
return validate_dict(d, object_type)
3232

33-
def validate_link_types(self, root_href, catalog_type):
33+
def validate_link_types(self, root_href, catalog_type):
3434

3535
def validate_asset_href_type(item, item_href, link_type):
3636
for asset in item.assets.values():

0 commit comments

Comments
 (0)