Skip to content

Commit 40ec3a5

Browse files
vvgrem@gmail.comvvgrem@gmail.com
authored andcommitted
SharePoint API: introduced namespace tenant namespace methods & types and etc.
1 parent 3f096c9 commit 40ec3a5

25 files changed

+286
-20
lines changed

README-dev.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ export Office365_Python_Sdk_SecureVars='{username};{password};{client_id};{clien
1717
export COMPANY={your_company}
1818
```
1919

20-
Your password cannot contain ';'!
21-
2220
This file is in .gitignore, so it will never be committed.
2321

2422
```bash
2523
$ . .env # source it to export the variable
2624
$ nose2 ... # run the test(s) you need...
2725
```
26+
27+
# Configure Tenant
28+

generator/metadata/SharePoint.xml

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

office365/sharepoint/clientsidecomponent/__init__.py

Whitespace-only changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from office365.sharepoint.base_entity import BaseEntity
2+
3+
4+
class ListItemVersion(BaseEntity):
5+
pass

office365/sharepoint/lists/list_template.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
from office365.runtime.resource_path_service_operation import ResourcePathServiceOperation
12
from office365.sharepoint.base_entity import BaseEntity
23

34

45
class ListTemplate(BaseEntity):
56

6-
def __init__(self, context):
7+
def __init__(self, context, resource_path=None):
78
"""
89
Represents a list definition or a list template, which defines the fields and views for a list.
910
List definitions are contained in files within
@@ -15,11 +16,19 @@ def __init__(self, context):
1516
list template from the collection.
1617
1718
"""
18-
super().__init__(context)
19+
super().__init__(context, resource_path)
1920

2021
@property
21-
def internalName(self):
22+
def internal_name(self):
2223
"""Gets a value that specifies the identifier for the list template.
2324
:rtype: str or None
2425
"""
2526
return self.properties.get('InternalName', None)
27+
28+
def set_property(self, name, value, persist_changes=True):
29+
super(ListTemplate, self).set_property(name, value, persist_changes)
30+
if self._resource_path is None:
31+
if name == "Name":
32+
self._resource_path = ResourcePathServiceOperation(
33+
"GetByName", [value], self._parent_collection.resource_path)
34+
return self
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from office365.runtime.client_object_collection import ClientObjectCollection
2+
from office365.runtime.resource_path_service_operation import ResourcePathServiceOperation
3+
from office365.sharepoint.lists.list_template import ListTemplate
4+
5+
6+
class ListTemplateCollection(ClientObjectCollection):
7+
8+
def __init__(self, context, resource_path=None):
9+
super(ListTemplateCollection, self).__init__(context, ListTemplate, resource_path)
10+
11+
def get_by_name(self, name):
12+
"""
13+
14+
:param str name:
15+
:return:
16+
"""
17+
return ListTemplate(self.context,
18+
ResourcePathServiceOperation("getByName", [name], self.resource_path))

office365/sharepoint/logger/__init__.py

Whitespace-only changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from office365.runtime.client_result import ClientResult
2+
from office365.runtime.queries.service_operation_query import ServiceOperationQuery
3+
from office365.runtime.resource_path import ResourcePath
4+
from office365.sharepoint.base_entity import BaseEntity
5+
6+
7+
class LogExport(BaseEntity):
8+
9+
def __init__(self, context):
10+
"""This is the primary class that should be instantiated to obtain metadata about the
11+
logs that you can download."""
12+
super().__init__(context, ResourcePath("Microsoft.Online.SharePoint.SPLogger.LogExport"))
13+
14+
def get_files(self, partitionId, logType):
15+
pass
16+
17+
def get_log_types(self):
18+
result = ClientResult(None)
19+
qry = ServiceOperationQuery(self, "GetLogTypes")
20+
self.context.add_query(qry)
21+
return result
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from office365.sharepoint.base_entity import BaseEntity
2+
3+
4+
class LogFileInfo(BaseEntity):
5+
pass

0 commit comments

Comments
 (0)