Skip to content

Commit d77967b

Browse files
committed
fix import circular issue for NavigationNode
1 parent eec8d6a commit d77967b

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

office365/sharepoint/brandcenter/brand_center.py

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def __init__(self, context):
1717
super(BrandCenter, self).__init__(context, ResourcePath("SP.BrandCenter"))
1818

1919
def configuration(self):
20+
""" """
2021
return_type = ClientResult(self.context, BrandCenterConfiguration())
2122
qry = ServiceOperationQuery(
2223
self, "Configuration", None, None, None, return_type
@@ -25,6 +26,7 @@ def configuration(self):
2526
return return_type
2627

2728
def get_site_themes(self):
29+
""" """
2830
return_type = ClientResult(self.context, SiteThemes())
2931
qry = ServiceOperationQuery(
3032
self, "GetSiteThemes", None, None, None, return_type

office365/sharepoint/navigation/node.py

+6-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from office365.runtime.paths.resource_path import ResourcePath
44
from office365.sharepoint.entity import Entity
5-
from office365.sharepoint.navigation.node_collection import NavigationNodeCollection
65
from office365.sharepoint.translation.user_resource import UserResource
76

87

@@ -20,8 +19,12 @@ def __repr__(self):
2019

2120
@property
2221
def children(self):
23-
# type: () -> NavigationNodeCollection
22+
# type: () -> 'NavigationNodeCollection'
2423
"""Gets the collection of child nodes of the navigation node."""
24+
from office365.sharepoint.navigation.node_collection import (
25+
NavigationNodeCollection,
26+
)
27+
2528
return self.properties.get(
2629
"Children",
2730
NavigationNodeCollection(
@@ -66,7 +69,7 @@ def is_external(self):
6669

6770
@property
6871
def parent_collection(self):
69-
# type: () -> NavigationNodeCollection
72+
# type: () -> 'NavigationNodeCollection'
7073
return self._parent_collection
7174

7275
@property
@@ -84,13 +87,3 @@ def get_property(self, name, default_value=None):
8487
property_mapping = {"TitleResource": self.title_resource}
8588
default_value = property_mapping.get(name, None)
8689
return super(NavigationNode, self).get_property(name, default_value)
87-
88-
def set_property(self, name, value, persist_changes=True):
89-
super(NavigationNode, self).set_property(name, value, persist_changes)
90-
# fallback: create a new resource path
91-
if self._resource_path is None:
92-
if name == "Id":
93-
self._resource_path = self.parent_collection.get_by_id(
94-
value
95-
).resource_path
96-
return self

0 commit comments

Comments
 (0)