gam7 7.4.1__py3-none-any.whl → 7.4.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gam7 might be problematic. Click here for more details.
- gam/__init__.py +19 -2
- {gam7-7.4.1.dist-info → gam7-7.4.2.dist-info}/METADATA +1 -1
- {gam7-7.4.1.dist-info → gam7-7.4.2.dist-info}/RECORD +6 -8
- gam/gdata/apps/sites/__init__.py +0 -283
- gam/gdata/apps/sites/service.py +0 -246
- {gam7-7.4.1.dist-info → gam7-7.4.2.dist-info}/WHEEL +0 -0
- {gam7-7.4.1.dist-info → gam7-7.4.2.dist-info}/entry_points.txt +0 -0
- {gam7-7.4.1.dist-info → gam7-7.4.2.dist-info}/licenses/LICENSE +0 -0
gam/__init__.py
CHANGED
|
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
27
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
|
28
|
-
__version__ = '7.04.
|
|
28
|
+
__version__ = '7.04.02'
|
|
29
29
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
|
30
30
|
|
|
31
31
|
#pylint: disable=wrong-import-position
|
|
@@ -21864,12 +21864,29 @@ def _printPerson(entityTypeName, user, person, csvPF, FJQC, parameters):
|
|
|
21864
21864
|
'JSON': json.dumps(cleanJSON(person),
|
|
21865
21865
|
ensure_ascii=False, sort_keys=True)})
|
|
21866
21866
|
|
|
21867
|
+
PEOPLE_CONTACT_OBJECT_KEYS = {
|
|
21868
|
+
'addresses': 'type',
|
|
21869
|
+
'calendarUrls': 'type',
|
|
21870
|
+
'emailAddresses': 'type',
|
|
21871
|
+
'events': 'type',
|
|
21872
|
+
'externalIds': 'type',
|
|
21873
|
+
'genders': 'value',
|
|
21874
|
+
'imClients': 'type',
|
|
21875
|
+
'locations': 'type',
|
|
21876
|
+
'miscKeywords': 'type',
|
|
21877
|
+
'nicknames': 'type',
|
|
21878
|
+
'organizations': 'type',
|
|
21879
|
+
'relations': 'type',
|
|
21880
|
+
'urls': 'type',
|
|
21881
|
+
'userDefined': 'key',
|
|
21882
|
+
}
|
|
21883
|
+
|
|
21867
21884
|
def _showPerson(userEntityType, user, entityType, person, i, count, FJQC, parameters):
|
|
21868
21885
|
_processPersonMetadata(person, parameters)
|
|
21869
21886
|
if not FJQC.formatJSON:
|
|
21870
21887
|
printEntity([userEntityType, user, entityType, person['resourceName']], i, count)
|
|
21871
21888
|
Ind.Increment()
|
|
21872
|
-
showJSON(None, person)
|
|
21889
|
+
showJSON(None, person, dictObjectsKey=PEOPLE_CONTACT_OBJECT_KEYS)
|
|
21873
21890
|
Ind.Decrement()
|
|
21874
21891
|
else:
|
|
21875
21892
|
printLine(json.dumps(cleanJSON(person), ensure_ascii=False, sort_keys=True))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
gam/__init__.py,sha256=
|
|
1
|
+
gam/__init__.py,sha256=0-69X7wt4mnJtfX0SDbm9HPU4ugW2QHWecPyhFqFyGg,3471920
|
|
2
2
|
gam/__main__.py,sha256=amz0-959ph6zkZKqjaar4n60yho-T37w6qWI36qx0CA,1049
|
|
3
3
|
gam/cacerts.pem,sha256=nJuWha0xm5dHw_5ptGphwRoO-r36Ccpqiww9pCEDbSc,67484
|
|
4
4
|
gam/cbcm-v1.1beta1.json,sha256=xO5XloCQQULmPbFBx5bckdqmbLFQ7sJ2TImhE1ysDIY,19439
|
|
@@ -47,8 +47,6 @@ gam/gdata/apps/audit/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrK
|
|
|
47
47
|
gam/gdata/apps/audit/service.py,sha256=Z1eueThcNeVUMWP1DRWc_DGHrJCiJI8W_xj6L-cqu-Q,9658
|
|
48
48
|
gam/gdata/apps/contacts/__init__.py,sha256=Um6zgIkiahZns7yAEuC3pxHSMD8iciZ_EoynSLoYPfU,30463
|
|
49
49
|
gam/gdata/apps/contacts/service.py,sha256=5lNb-Ii1Gyek6ePFji3kyoYtCBc8CuJTwagx2BL2o14,15684
|
|
50
|
-
gam/gdata/apps/sites/__init__.py,sha256=9LWLa1iSTBLxTOF7O5MKwET-ETkSHQjb0LUwXwpAL9A,9530
|
|
51
|
-
gam/gdata/apps/sites/service.py,sha256=I5cSpGP88_LQNJERXVC0sUwLFNkaubnWguTq-PPhQfg,10101
|
|
52
50
|
gam/googleapiclient/__init__.py,sha256=kFWxKShJalbnrCuV0klL7mjZaiXfPpjlqmyKyI8yfTU,904
|
|
53
51
|
gam/googleapiclient/_auth.py,sha256=QttUwhmp7BmhW5CReaAOVGH6kEtITYmEHhVCVmsnDPs,5736
|
|
54
52
|
gam/googleapiclient/_helpers.py,sha256=iNxILG6iNNFukr7lhaYfVqX4oFM5SERvcsU3JxeOo6I,6723
|
|
@@ -66,8 +64,8 @@ gam/googleapiclient/discovery_cache/base.py,sha256=yCDPtxnbNN-p5_9fzBacC6P3wcUPl
|
|
|
66
64
|
gam/googleapiclient/discovery_cache/file_cache.py,sha256=sim3Mg4HgRYo3vX75jvcKy_aV568EvIrtBfvfbw-044,4774
|
|
67
65
|
gam/iso8601/__init__.py,sha256=Z2PsYbXgAH5a5xzUvgczCboPzqWpm65kRcIngCnhViU,1218
|
|
68
66
|
gam/iso8601/iso8601.py,sha256=Li2FHZ4sBTWuthuQhyCvmvj0j6At8JbGzkSv2fc2RHU,4384
|
|
69
|
-
gam7-7.4.
|
|
70
|
-
gam7-7.4.
|
|
71
|
-
gam7-7.4.
|
|
72
|
-
gam7-7.4.
|
|
73
|
-
gam7-7.4.
|
|
67
|
+
gam7-7.4.2.dist-info/METADATA,sha256=pDnMzhndgCUK35bIltpRKbxPYToT5IP4jxf15NzD2Bg,2888
|
|
68
|
+
gam7-7.4.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
69
|
+
gam7-7.4.2.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
|
|
70
|
+
gam7-7.4.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
71
|
+
gam7-7.4.2.dist-info/RECORD,,
|
gam/gdata/apps/sites/__init__.py
DELETED
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
#
|
|
3
|
-
# Copyright 2009 Google Inc. All Rights Reserved.
|
|
4
|
-
#
|
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
# you may not use this file except in compliance with the License.
|
|
7
|
-
# You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
# See the License for the specific language governing permissions and
|
|
15
|
-
# limitations under the License.
|
|
16
|
-
|
|
17
|
-
"""Data model classes for parsing and generating XML for the Sites Data API."""
|
|
18
|
-
|
|
19
|
-
import atom
|
|
20
|
-
import gdata
|
|
21
|
-
|
|
22
|
-
# XML Namespaces used in Google Sites entities.
|
|
23
|
-
SITES_NAMESPACE = 'http://schemas.google.com/sites/2008'
|
|
24
|
-
SITES_TEMPLATE = '{http://schemas.google.com/sites/2008}%s'
|
|
25
|
-
SPREADSHEETS_NAMESPACE = 'http://schemas.google.com/spreadsheets/2006'
|
|
26
|
-
SPREADSHEETS_TEMPLATE = '{http://schemas.google.com/spreadsheets/2006}%s'
|
|
27
|
-
GACL_NAMESPACE = 'http://schemas.google.com/acl/2007'
|
|
28
|
-
GACL_TEMPLATE = '{http://schemas.google.com/acl/2007}%s'
|
|
29
|
-
DC_TERMS_TEMPLATE = '{http://purl.org/dc/terms}%s'
|
|
30
|
-
THR_TERMS_TEMPLATE = '{http://purl.org/syndication/thread/1.0}%s'
|
|
31
|
-
XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'
|
|
32
|
-
XHTML_TEMPLATE = '{http://www.w3.org/1999/xhtml}%s'
|
|
33
|
-
|
|
34
|
-
SITES_INVITE_LINK_REL = SITES_NAMESPACE + '#invite'
|
|
35
|
-
SITES_PARENT_LINK_REL = SITES_NAMESPACE + '#parent'
|
|
36
|
-
SITES_REVISION_LINK_REL = SITES_NAMESPACE + '#revision'
|
|
37
|
-
SITES_SOURCE_LINK_REL = SITES_NAMESPACE + '#source'
|
|
38
|
-
SITES_TEMPLATE_LINK_REL = SITES_NAMESPACE + '#template'
|
|
39
|
-
|
|
40
|
-
ALTERNATE_REL = 'alternate'
|
|
41
|
-
WEB_ADDRESS_MAPPING_REL = 'webAddressMapping'
|
|
42
|
-
|
|
43
|
-
SITES_KIND_SCHEME = 'http://schemas.google.com/g/2005#kind'
|
|
44
|
-
ANNOUNCEMENT_KIND_TERM = SITES_NAMESPACE + '#announcement'
|
|
45
|
-
ANNOUNCEMENT_PAGE_KIND_TERM = SITES_NAMESPACE + '#announcementspage'
|
|
46
|
-
ATTACHMENT_KIND_TERM = SITES_NAMESPACE + '#attachment'
|
|
47
|
-
COMMENT_KIND_TERM = SITES_NAMESPACE + '#comment'
|
|
48
|
-
FILECABINET_KIND_TERM = SITES_NAMESPACE + '#filecabinet'
|
|
49
|
-
LISTITEM_KIND_TERM = SITES_NAMESPACE + '#listitem'
|
|
50
|
-
LISTPAGE_KIND_TERM = SITES_NAMESPACE + '#listpage'
|
|
51
|
-
WEBPAGE_KIND_TERM = SITES_NAMESPACE + '#webpage'
|
|
52
|
-
WEBATTACHMENT_KIND_TERM = SITES_NAMESPACE + '#webattachment'
|
|
53
|
-
FOLDER_KIND_TERM = SITES_NAMESPACE + '#folder'
|
|
54
|
-
TAG_KIND_TERM = SITES_NAMESPACE + '#tag'
|
|
55
|
-
|
|
56
|
-
SUPPORT_KINDS = [
|
|
57
|
-
'announcement', 'announcementspage', 'attachment', 'comment', 'filecabinet',
|
|
58
|
-
'listitem', 'listpage', 'webpage', 'webattachment', 'tag'
|
|
59
|
-
]
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
class GDataBase(atom.AtomBase):
|
|
63
|
-
"""The Google Sites intermediate class from atom.AtomBase."""
|
|
64
|
-
_namespace = gdata.GDATA_NAMESPACE
|
|
65
|
-
_children = atom.AtomBase._children.copy()
|
|
66
|
-
_attributes = atom.AtomBase._attributes.copy()
|
|
67
|
-
|
|
68
|
-
def __init__(self, text=None):
|
|
69
|
-
atom.AtomBase.__init__(self, text=text)
|
|
70
|
-
|
|
71
|
-
class SitesBase(GDataBase):
|
|
72
|
-
_namespace = SITES_NAMESPACE
|
|
73
|
-
|
|
74
|
-
class SiteName(SitesBase):
|
|
75
|
-
"""Google Sites <sites:siteName>."""
|
|
76
|
-
_tag = 'siteName'
|
|
77
|
-
|
|
78
|
-
class Theme(SitesBase):
|
|
79
|
-
"""Google Sites <sites:theme>."""
|
|
80
|
-
_tag = 'theme'
|
|
81
|
-
|
|
82
|
-
class SiteEntry(gdata.BatchEntry):
|
|
83
|
-
"""Google Sites Site Feed Entry."""
|
|
84
|
-
_tag = 'entry'
|
|
85
|
-
_namespace = atom.ATOM_NAMESPACE
|
|
86
|
-
_children = gdata.BatchEntry._children.copy()
|
|
87
|
-
|
|
88
|
-
_children['{%s}siteName' % SITES_NAMESPACE] = ('siteName', SiteName)
|
|
89
|
-
_children['{%s}theme' % SITES_NAMESPACE] = ('theme', Theme)
|
|
90
|
-
_attributes = gdata.BatchEntry._attributes.copy()
|
|
91
|
-
_attributes['{%s}etag' % gdata.GDATA_NAMESPACE] = 'etag'
|
|
92
|
-
|
|
93
|
-
def __init__(self, siteName=None, title=None, summary=None, theme=None, sourceSite=None, category=None, etag=None):
|
|
94
|
-
gdata.BatchEntry.__init__(self, category=category)
|
|
95
|
-
self.siteName = siteName
|
|
96
|
-
self.title = title
|
|
97
|
-
self.summary = summary
|
|
98
|
-
self.theme = theme
|
|
99
|
-
if sourceSite is not None:
|
|
100
|
-
sourceLink = atom.Link(href=sourceSite, rel=SITES_SOURCE_LINK_REL, link_type='application/atom+xml')
|
|
101
|
-
self.link.append(sourceLink)
|
|
102
|
-
self.etag = etag
|
|
103
|
-
|
|
104
|
-
def find_alternate_link(self):
|
|
105
|
-
for link in self.link:
|
|
106
|
-
if link.rel == ALTERNATE_REL and link.href:
|
|
107
|
-
return link.href
|
|
108
|
-
return None
|
|
109
|
-
|
|
110
|
-
FindAlternateLink = find_alternate_link
|
|
111
|
-
|
|
112
|
-
def find_source_link(self):
|
|
113
|
-
for link in self.link:
|
|
114
|
-
if link.rel == SITES_SOURCE_LINK_REL and link.href:
|
|
115
|
-
return link.href
|
|
116
|
-
return None
|
|
117
|
-
|
|
118
|
-
FindSourceLink = find_source_link
|
|
119
|
-
|
|
120
|
-
def find_webaddress_mappings(self):
|
|
121
|
-
mappingLinks = []
|
|
122
|
-
for link in self.link:
|
|
123
|
-
if link.rel == WEB_ADDRESS_MAPPING_REL and link.href:
|
|
124
|
-
mappingLinks.append(link.href)
|
|
125
|
-
return mappingLinks
|
|
126
|
-
|
|
127
|
-
FindWebAddressMappings = find_webaddress_mappings
|
|
128
|
-
|
|
129
|
-
def SiteEntryFromString(xml_string):
|
|
130
|
-
return atom.CreateClassFromXMLString(SiteEntry, xml_string)
|
|
131
|
-
|
|
132
|
-
class SiteFeed(gdata.BatchFeed, gdata.LinkFinder):
|
|
133
|
-
"""A Google Sites feed flavor of an Atom Feed."""
|
|
134
|
-
_tag = 'feed'
|
|
135
|
-
_namespace = atom.ATOM_NAMESPACE
|
|
136
|
-
_children = gdata.BatchFeed._children.copy()
|
|
137
|
-
_children['{%s}entry' % atom.ATOM_NAMESPACE] = ('entry', [SiteEntry])
|
|
138
|
-
|
|
139
|
-
def __init__(self):
|
|
140
|
-
gdata.BatchFeed.__init__(self)
|
|
141
|
-
|
|
142
|
-
def SiteFeedFromString(xml_string):
|
|
143
|
-
return atom.CreateClassFromXMLString(SiteFeed, xml_string)
|
|
144
|
-
|
|
145
|
-
class AclBase(GDataBase):
|
|
146
|
-
_namespace = GACL_NAMESPACE
|
|
147
|
-
|
|
148
|
-
class AclRole(AclBase):
|
|
149
|
-
"""Describes the role of an entry in an access control list."""
|
|
150
|
-
_tag = 'role'
|
|
151
|
-
_children = AclBase._children.copy()
|
|
152
|
-
_attributes = AclBase._attributes.copy()
|
|
153
|
-
_attributes['value'] = 'value'
|
|
154
|
-
|
|
155
|
-
def __init__(self, value=None):
|
|
156
|
-
AclBase.__init__(self)
|
|
157
|
-
self.value = value
|
|
158
|
-
|
|
159
|
-
class AclAdditionalRole(AclBase):
|
|
160
|
-
"""Describes an additionalRole element."""
|
|
161
|
-
_tag = 'additionalRole'
|
|
162
|
-
_children = AclBase._children.copy()
|
|
163
|
-
_attributes = AclBase._attributes.copy()
|
|
164
|
-
_attributes['value'] = 'value'
|
|
165
|
-
|
|
166
|
-
def __init__(self, value=None):
|
|
167
|
-
AclBase.__init__(self)
|
|
168
|
-
self.value = value
|
|
169
|
-
|
|
170
|
-
class AclScope(AclBase):
|
|
171
|
-
"""Describes the scope of an entry in an access control list."""
|
|
172
|
-
_tag = 'scope'
|
|
173
|
-
_children = AclBase._children.copy()
|
|
174
|
-
_attributes = AclBase._attributes.copy()
|
|
175
|
-
_attributes['type'] = 'type'
|
|
176
|
-
_attributes['value'] = 'value'
|
|
177
|
-
|
|
178
|
-
def __init__(self, stype=None, value=None):
|
|
179
|
-
AclBase.__init__(self)
|
|
180
|
-
self.type = stype
|
|
181
|
-
self.value = value
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
class AclWithKey(AclBase):
|
|
185
|
-
"""Describes a key that can be used to access a document."""
|
|
186
|
-
_tag = 'withKey'
|
|
187
|
-
_children = AclBase._children.copy()
|
|
188
|
-
_children['{%s}role' % GACL_NAMESPACE] = ('role', AclRole)
|
|
189
|
-
_children['{%s}additionalRole' % GACL_NAMESPACE] = ('additionalRole', AclAdditionalRole)
|
|
190
|
-
_attributes = AclBase._attributes.copy()
|
|
191
|
-
_attributes['key'] = 'key'
|
|
192
|
-
|
|
193
|
-
def __init__(self, key=None, role=None, additionalRole=None):
|
|
194
|
-
AclBase.__init__(self)
|
|
195
|
-
self.key = key
|
|
196
|
-
self.role = role
|
|
197
|
-
self.additionalRole = additionalRole
|
|
198
|
-
|
|
199
|
-
class AclEntry(gdata.BatchEntry):
|
|
200
|
-
"""Describes an entry in a feed of an access control list (ACL)."""
|
|
201
|
-
_tag = 'entry'
|
|
202
|
-
_namespace = atom.ATOM_NAMESPACE
|
|
203
|
-
_children = gdata.BatchEntry._children.copy()
|
|
204
|
-
|
|
205
|
-
_children['{%s}role' % GACL_NAMESPACE] = ('role', AclRole)
|
|
206
|
-
_children['{%s}additionalRole' % GACL_NAMESPACE] = ('additionalRole', AclAdditionalRole)
|
|
207
|
-
_children['{%s}scope' % GACL_NAMESPACE] = ('scope', AclScope)
|
|
208
|
-
_children['{%s}withKey' % GACL_NAMESPACE] = ('withKey', AclWithKey)
|
|
209
|
-
_attributes = gdata.BatchEntry._attributes.copy()
|
|
210
|
-
_attributes['{%s}etag' % gdata.GDATA_NAMESPACE] = 'etag'
|
|
211
|
-
|
|
212
|
-
def __init__(self, role=None, additionalRole=None, scope=None, withKey=None, etag=None):
|
|
213
|
-
gdata.BatchEntry.__init__(self)
|
|
214
|
-
self.role = role
|
|
215
|
-
self.additionalRole = additionalRole
|
|
216
|
-
self.scope = scope
|
|
217
|
-
self.withKey = withKey
|
|
218
|
-
self.etag = etag
|
|
219
|
-
|
|
220
|
-
def find_invite_link(self):
|
|
221
|
-
for link in self.link:
|
|
222
|
-
if link.rel == SITES_INVITE_LINK_REL and link.href:
|
|
223
|
-
return link.href
|
|
224
|
-
return None
|
|
225
|
-
|
|
226
|
-
FindInviteLink = find_invite_link
|
|
227
|
-
|
|
228
|
-
def AclEntryFromString(xml_string):
|
|
229
|
-
return atom.CreateClassFromXMLString(AclEntry, xml_string)
|
|
230
|
-
|
|
231
|
-
class AclFeed(gdata.BatchFeed, gdata.LinkFinder):
|
|
232
|
-
"""Describes a feed of an access control list (ACL)."""
|
|
233
|
-
_tag = 'feed'
|
|
234
|
-
_namespace = atom.ATOM_NAMESPACE
|
|
235
|
-
_children = gdata.BatchFeed._children.copy()
|
|
236
|
-
_children['{%s}entry' % atom.ATOM_NAMESPACE] = ('entry', [AclEntry])
|
|
237
|
-
|
|
238
|
-
def __init__(self):
|
|
239
|
-
gdata.BatchFeed.__init__(self)
|
|
240
|
-
|
|
241
|
-
def AclFeedFromString(xml_string):
|
|
242
|
-
return atom.CreateClassFromXMLString(AclFeed, xml_string)
|
|
243
|
-
|
|
244
|
-
class ActivityEntry(gdata.BatchEntry):
|
|
245
|
-
"""Describes an entry in a feed of site activity (changes)."""
|
|
246
|
-
_tag = 'entry'
|
|
247
|
-
_namespace = atom.ATOM_NAMESPACE
|
|
248
|
-
_children = gdata.BatchEntry._children.copy()
|
|
249
|
-
_attributes = gdata.BatchEntry._attributes.copy()
|
|
250
|
-
|
|
251
|
-
def __init__(self):
|
|
252
|
-
gdata.BatchEntry.__init__(self)
|
|
253
|
-
|
|
254
|
-
def __find_category_scheme(self, scheme):
|
|
255
|
-
for category in self.category:
|
|
256
|
-
if category.scheme == scheme:
|
|
257
|
-
return category
|
|
258
|
-
return None
|
|
259
|
-
|
|
260
|
-
def kind(self):
|
|
261
|
-
kind = self.__find_category_scheme(SITES_KIND_SCHEME)
|
|
262
|
-
if kind is not None:
|
|
263
|
-
return kind.term[len(SITES_NAMESPACE) + 1:]
|
|
264
|
-
else:
|
|
265
|
-
return None
|
|
266
|
-
|
|
267
|
-
Kind = kind
|
|
268
|
-
|
|
269
|
-
def ActivityEntryFromString(xml_string):
|
|
270
|
-
return atom.CreateClassFromXMLString(ActivityEntry, xml_string)
|
|
271
|
-
|
|
272
|
-
class ActivityFeed(gdata.BatchFeed, gdata.LinkFinder):
|
|
273
|
-
"""Describes a feed of site activity (changes)."""
|
|
274
|
-
_tag = 'feed'
|
|
275
|
-
_namespace = atom.ATOM_NAMESPACE
|
|
276
|
-
_children = gdata.BatchFeed._children.copy()
|
|
277
|
-
_children['{%s}entry' % atom.ATOM_NAMESPACE] = ('entry', [ActivityEntry])
|
|
278
|
-
|
|
279
|
-
def __init__(self):
|
|
280
|
-
gdata.BatchFeed.__init__(self)
|
|
281
|
-
|
|
282
|
-
def ActivityFeedFromString(xml_string):
|
|
283
|
-
return atom.CreateClassFromXMLString(ActivityFeed, xml_string)
|
gam/gdata/apps/sites/service.py
DELETED
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/python
|
|
2
|
-
#
|
|
3
|
-
# Copyright 2009 Google Inc. All Rights Reserved.
|
|
4
|
-
#
|
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
# you may not use this file except in compliance with the License.
|
|
7
|
-
# You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
# See the License for the specific language governing permissions and
|
|
15
|
-
# limitations under the License.
|
|
16
|
-
|
|
17
|
-
"""SitesService extends the GDataService for Google Sites API calls."""
|
|
18
|
-
|
|
19
|
-
import gdata.apps
|
|
20
|
-
import gdata.apps.service
|
|
21
|
-
import gdata.service
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
# Feed URI templates
|
|
25
|
-
CONTENT_FEED_TEMPLATE = '/feeds/content/%s/%s/'
|
|
26
|
-
REVISION_FEED_TEMPLATE = '/feeds/revision/%s/%s/'
|
|
27
|
-
ACTIVITY_FEED_TEMPLATE = '/feeds/activity/%s/%s/'
|
|
28
|
-
ACTIVITY_ENTRY_TEMPLATE = '/feeds/activity/%s/%s/%s'
|
|
29
|
-
SITE_FEED_TEMPLATE = '/feeds/site/%s/'
|
|
30
|
-
ACL_FEED_TEMPLATE = '/feeds/acl/site/%s/%s'
|
|
31
|
-
ACL_ENTRY_TEMPLATE = '/feeds/acl/site/%s/%s/%s'
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
class SitesService(gdata.service.GDataService):
|
|
35
|
-
"""Client extension for the Google Sites API service."""
|
|
36
|
-
|
|
37
|
-
def __init__(self,
|
|
38
|
-
source=None, server='sites.google.com', additional_headers=None,
|
|
39
|
-
**kwargs):
|
|
40
|
-
"""Constructs a new client for the Sites API.
|
|
41
|
-
|
|
42
|
-
Args:
|
|
43
|
-
site: string (optional) Name (webspace) of the Google Site
|
|
44
|
-
domain: string (optional) Domain of the (Google Apps hosted) Site.
|
|
45
|
-
If no domain is given, the Site is assumed to be a consumer Google
|
|
46
|
-
Site, in which case the value 'site' is used.
|
|
47
|
-
source: string (optional) The name of the user's application.
|
|
48
|
-
server: string (optional) The name of the server to which a connection
|
|
49
|
-
will be opened. Default value: 'sites..google.com'.
|
|
50
|
-
**kwargs: The other parameters to pass to gdata.service.GDataService
|
|
51
|
-
constructor.
|
|
52
|
-
"""
|
|
53
|
-
if additional_headers == None:
|
|
54
|
-
additional_headers = {}
|
|
55
|
-
additional_headers['GData-Version'] = '1.4'
|
|
56
|
-
gdata.service.GDataService.__init__(self,
|
|
57
|
-
source=source, server=server, additional_headers=additional_headers,
|
|
58
|
-
**kwargs)
|
|
59
|
-
self.ssl = True
|
|
60
|
-
self.port = 443
|
|
61
|
-
|
|
62
|
-
def make_site_feed_uri(self, domain=None, site=None):
|
|
63
|
-
if not domain:
|
|
64
|
-
domain = 'site'
|
|
65
|
-
if not site:
|
|
66
|
-
return SITE_FEED_TEMPLATE % domain
|
|
67
|
-
return (SITE_FEED_TEMPLATE % domain) + site
|
|
68
|
-
|
|
69
|
-
MakeSiteFeedUri = make_site_feed_uri
|
|
70
|
-
|
|
71
|
-
def get_site_feed(self, uri=None, domain=None, site=None,
|
|
72
|
-
extra_headers=None, url_params=None, escape_params=True):
|
|
73
|
-
|
|
74
|
-
uri = uri or self.make_site_feed_uri(domain=domain, site=site)
|
|
75
|
-
try:
|
|
76
|
-
return self.Get(uri,
|
|
77
|
-
url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
|
|
78
|
-
converter=gdata.apps.sites.SiteFeedFromString)
|
|
79
|
-
except gdata.service.RequestError as e:
|
|
80
|
-
raise gdata.apps.service.AppsForYourDomainException(e.args[0])
|
|
81
|
-
|
|
82
|
-
GetSiteFeed = get_site_feed
|
|
83
|
-
|
|
84
|
-
def create_site(self, siteentry=None, uri=None, domain=None, site=None,
|
|
85
|
-
extra_headers=None, url_params=None, escape_params=True):
|
|
86
|
-
|
|
87
|
-
if uri is None:
|
|
88
|
-
uri = self.make_site_feed_uri(domain=domain, site=site)
|
|
89
|
-
try:
|
|
90
|
-
return self.Post(siteentry, uri,
|
|
91
|
-
url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
|
|
92
|
-
converter=gdata.apps.sites.SiteEntryFromString)
|
|
93
|
-
except gdata.service.RequestError as e:
|
|
94
|
-
raise gdata.apps.service.AppsForYourDomainException(e.args[0])
|
|
95
|
-
|
|
96
|
-
CreateSite = create_site
|
|
97
|
-
|
|
98
|
-
def get_site(self, uri=None, domain=None, site=None,
|
|
99
|
-
extra_headers=None, url_params=None, escape_params=True):
|
|
100
|
-
|
|
101
|
-
uri = uri or self.make_site_feed_uri(domain=domain, site=site)
|
|
102
|
-
try:
|
|
103
|
-
return self.Get(uri,
|
|
104
|
-
url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
|
|
105
|
-
converter=gdata.apps.sites.SiteEntryFromString)
|
|
106
|
-
except gdata.service.RequestError as e:
|
|
107
|
-
raise gdata.apps.service.AppsForYourDomainException(e.args[0])
|
|
108
|
-
|
|
109
|
-
GetSite = get_site
|
|
110
|
-
|
|
111
|
-
def update_site(self, siteentry=None, uri=None, domain=None, site=None,
|
|
112
|
-
extra_headers=None, url_params=None, escape_params=True):
|
|
113
|
-
|
|
114
|
-
uri = uri or self.make_site_feed_uri(domain=domain, site=site)
|
|
115
|
-
try:
|
|
116
|
-
return self.Put(siteentry, uri,
|
|
117
|
-
url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
|
|
118
|
-
converter=gdata.apps.sites.SiteEntryFromString)
|
|
119
|
-
except gdata.service.RequestError as e:
|
|
120
|
-
raise gdata.apps.service.AppsForYourDomainException(e.args[0])
|
|
121
|
-
|
|
122
|
-
UpdateSite = update_site
|
|
123
|
-
|
|
124
|
-
def make_acl_feed_uri(self, domain=None, site=None):
|
|
125
|
-
return ACL_FEED_TEMPLATE % (domain, site)
|
|
126
|
-
|
|
127
|
-
MakeAclFeedUri = make_acl_feed_uri
|
|
128
|
-
|
|
129
|
-
def get_acl_feed(self, uri=None, domain=None, site=None,
|
|
130
|
-
extra_headers=None, url_params=None, escape_params=True):
|
|
131
|
-
|
|
132
|
-
uri = uri or self.make_acl_feed_uri(domain=domain, site=site)
|
|
133
|
-
try:
|
|
134
|
-
return self.Get(uri,
|
|
135
|
-
url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
|
|
136
|
-
converter=gdata.apps.sites.AclFeedFromString)
|
|
137
|
-
except gdata.service.RequestError as e:
|
|
138
|
-
raise gdata.apps.service.AppsForYourDomainException(e.args[0])
|
|
139
|
-
|
|
140
|
-
GetAclFeed = get_acl_feed
|
|
141
|
-
|
|
142
|
-
def make_acl_entry_uri(self, domain=None, site=None, ruleId=None):
|
|
143
|
-
return ACL_ENTRY_TEMPLATE % (domain, site, ruleId)
|
|
144
|
-
|
|
145
|
-
MakeAclEntryUri = make_acl_entry_uri
|
|
146
|
-
|
|
147
|
-
def create_acl_entry(self, aclentry=None, uri=None, domain=None, site=None,
|
|
148
|
-
extra_headers=None, url_params=None, escape_params=True):
|
|
149
|
-
|
|
150
|
-
uri = uri or self.make_acl_feed_uri(domain=domain, site=site)
|
|
151
|
-
try:
|
|
152
|
-
return self.Post(aclentry, uri,
|
|
153
|
-
url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
|
|
154
|
-
converter=gdata.apps.sites.AclEntryFromString)
|
|
155
|
-
except gdata.service.RequestError as e:
|
|
156
|
-
raise gdata.apps.service.AppsForYourDomainException(e.args[0])
|
|
157
|
-
|
|
158
|
-
CreateAclEntry = create_acl_entry
|
|
159
|
-
|
|
160
|
-
def get_acl_entry(self, uri=None, domain=None, site=None, ruleId=None,
|
|
161
|
-
extra_headers=None, url_params=None, escape_params=True):
|
|
162
|
-
|
|
163
|
-
uri = uri or self.make_acl_entry_uri(domain=domain, site=site, ruleId=ruleId)
|
|
164
|
-
try:
|
|
165
|
-
return self.Get(uri,
|
|
166
|
-
url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
|
|
167
|
-
converter=gdata.apps.sites.AclEntryFromString)
|
|
168
|
-
except gdata.service.RequestError as e:
|
|
169
|
-
raise gdata.apps.service.AppsForYourDomainException(e.args[0])
|
|
170
|
-
|
|
171
|
-
GetAclEntry = get_acl_entry
|
|
172
|
-
|
|
173
|
-
def update_acl_entry(self, aclentry=None, uri=None, domain=None, site=None, ruleId=None,
|
|
174
|
-
extra_headers=None, url_params=None, escape_params=True):
|
|
175
|
-
|
|
176
|
-
uri = uri or self.make_acl_entry_uri(domain=domain, site=site, ruleId=ruleId)
|
|
177
|
-
try:
|
|
178
|
-
return self.Put(aclentry, uri,
|
|
179
|
-
url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
|
|
180
|
-
converter=gdata.apps.sites.AclEntryFromString)
|
|
181
|
-
except gdata.service.RequestError as e:
|
|
182
|
-
raise gdata.apps.service.AppsForYourDomainException(e.args[0])
|
|
183
|
-
|
|
184
|
-
UpdateAclEntry = update_acl_entry
|
|
185
|
-
|
|
186
|
-
def delete_acl_entry(self, uri=None, domain=None, site=None, ruleId=None,
|
|
187
|
-
extra_headers=None, url_params=None, escape_params=True):
|
|
188
|
-
|
|
189
|
-
uri = uri or self.make_acl_entry_uri(domain=domain, site=site, ruleId=ruleId)
|
|
190
|
-
try:
|
|
191
|
-
return self.Delete(uri,
|
|
192
|
-
url_params=url_params, escape_params=escape_params, extra_headers=extra_headers)
|
|
193
|
-
except gdata.service.RequestError as e:
|
|
194
|
-
raise gdata.apps.service.AppsForYourDomainException(e.args[0])
|
|
195
|
-
|
|
196
|
-
DeleteAclEntry = delete_acl_entry
|
|
197
|
-
|
|
198
|
-
def make_activity_feed_uri(self, domain=None, site=None):
|
|
199
|
-
return ACTIVITY_FEED_TEMPLATE % (domain, site)
|
|
200
|
-
|
|
201
|
-
MakeActivityFeedUri = make_activity_feed_uri
|
|
202
|
-
|
|
203
|
-
def get_activity_feed(self, uri=None, domain=None, site=None,
|
|
204
|
-
extra_headers=None, url_params=None, escape_params=True):
|
|
205
|
-
|
|
206
|
-
uri = uri or self.make_activity_feed_uri(domain=domain, site=site)
|
|
207
|
-
try:
|
|
208
|
-
return self.Get(uri,
|
|
209
|
-
url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
|
|
210
|
-
converter=gdata.apps.sites.ActivityFeedFromString)
|
|
211
|
-
except gdata.service.RequestError as e:
|
|
212
|
-
raise gdata.apps.service.AppsForYourDomainException(e.args[0])
|
|
213
|
-
|
|
214
|
-
GetActivityFeed = get_activity_feed
|
|
215
|
-
|
|
216
|
-
def make_activity_entry_uri(self, domain=None, site=None, activityId=None):
|
|
217
|
-
return ACTIVITY_ENTRY_TEMPLATE % (domain, site, activityId)
|
|
218
|
-
|
|
219
|
-
MakeActivityEntryUri = make_activity_entry_uri
|
|
220
|
-
|
|
221
|
-
def get_activity_entry(self, uri=None, domain=None, site=None, activityId=None,
|
|
222
|
-
extra_headers=None, url_params=None, escape_params=True):
|
|
223
|
-
|
|
224
|
-
uri = uri or self.make_activity_entry_uri(domain=domain, site=site, activityId=activityId)
|
|
225
|
-
try:
|
|
226
|
-
return self.Get(uri,
|
|
227
|
-
url_params=url_params, extra_headers=extra_headers, escape_params=escape_params,
|
|
228
|
-
converter=gdata.apps.sites.ActivityEntryFromString)
|
|
229
|
-
except gdata.service.RequestError as e:
|
|
230
|
-
raise gdata.apps.service.AppsForYourDomainException(e.args[0])
|
|
231
|
-
|
|
232
|
-
GetActivityEntry = get_activity_entry
|
|
233
|
-
|
|
234
|
-
class SitesQuery(gdata.service.Query):
|
|
235
|
-
|
|
236
|
-
def make_site_feed_uri(self, domain=None, site=None):
|
|
237
|
-
if not domain:
|
|
238
|
-
domain = 'site'
|
|
239
|
-
if not site:
|
|
240
|
-
return SITE_FEED_TEMPLATE % domain
|
|
241
|
-
return (SITE_FEED_TEMPLATE % domain) + site
|
|
242
|
-
|
|
243
|
-
def __init__(self, feed=None, domain=None, site=None, params=None):
|
|
244
|
-
self.feed = feed or self.make_site_feed_uri(domain=domain, site=site)
|
|
245
|
-
gdata.service.Query.__init__(self, feed=self.feed, params=params)
|
|
246
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|