gam7 7.4.0__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 +60 -10
- {gam7-7.4.0.dist-info → gam7-7.4.2.dist-info}/METADATA +1 -1
- {gam7-7.4.0.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.0.dist-info → gam7-7.4.2.dist-info}/WHEEL +0 -0
- {gam7-7.4.0.dist-info → gam7-7.4.2.dist-info}/entry_points.txt +0 -0
- {gam7-7.4.0.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
|
|
@@ -667,8 +667,10 @@ def accessErrorExitNonDirectory(api, errMsg):
|
|
|
667
667
|
Ent.API, api])+[errMsg],
|
|
668
668
|
''))
|
|
669
669
|
|
|
670
|
-
def ClientAPIAccessDeniedExit():
|
|
670
|
+
def ClientAPIAccessDeniedExit(errMsg=None):
|
|
671
671
|
stderrErrorMsg(Msg.API_ACCESS_DENIED)
|
|
672
|
+
if errMsg:
|
|
673
|
+
stderrErrorMsg(errMsg)
|
|
672
674
|
missingScopes = API.getClientScopesSet(GM.Globals[GM.CURRENT_CLIENT_API])-GM.Globals[GM.CURRENT_CLIENT_API_SCOPES]
|
|
673
675
|
if missingScopes:
|
|
674
676
|
writeStderr(Msg.API_CHECK_CLIENT_AUTHORIZATION.format(GM.Globals[GM.OAUTH2_CLIENT_ID],
|
|
@@ -21225,6 +21227,8 @@ def _getPeopleOtherContacts(people, entityType, user, i=0, count=0):
|
|
|
21225
21227
|
resourceName = contact.pop('resourceName')
|
|
21226
21228
|
otherContacts[resourceName] = contact
|
|
21227
21229
|
return otherContacts
|
|
21230
|
+
except GAPI.permissionDenied as e:
|
|
21231
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
21228
21232
|
except (GAPI.serviceNotAvailable, GAPI.forbidden):
|
|
21229
21233
|
entityUnknownWarning(entityType, user, i, count)
|
|
21230
21234
|
return None
|
|
@@ -21281,6 +21285,8 @@ def queryPeopleContacts(people, contactQuery, fields, sortOrder, entityType, use
|
|
|
21281
21285
|
showMessage = pageMessage.replace(TOTAL_ITEMS_MARKER, str(totalItems))
|
|
21282
21286
|
writeGotMessage(showMessage.replace('{0}', str(Ent.Choose(Ent.PEOPLE_CONTACT, totalItems))))
|
|
21283
21287
|
return entityList
|
|
21288
|
+
except GAPI.permissionDenied as e:
|
|
21289
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
21284
21290
|
except (GAPI.serviceNotAvailable, GAPI.forbidden):
|
|
21285
21291
|
entityUnknownWarning(entityType, user, i, count)
|
|
21286
21292
|
return None
|
|
@@ -21307,6 +21313,8 @@ def queryPeopleOtherContacts(people, contactQuery, fields, entityType, user, i=0
|
|
|
21307
21313
|
showMessage = pageMessage.replace(TOTAL_ITEMS_MARKER, str(totalItems))
|
|
21308
21314
|
writeGotMessage(showMessage.replace('{0}', str(Ent.Choose(Ent.OTHER_CONTACT, totalItems))))
|
|
21309
21315
|
return entityList
|
|
21316
|
+
except GAPI.permissionDenied as e:
|
|
21317
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
21310
21318
|
except (GAPI.serviceNotAvailable, GAPI.forbidden):
|
|
21311
21319
|
entityUnknownWarning(entityType, user, i, count)
|
|
21312
21320
|
return None
|
|
@@ -21327,6 +21335,8 @@ def getPeopleContactGroupsInfo(people, entityType, entityName, i, count):
|
|
|
21327
21335
|
if group['formattedName'] != group['name']:
|
|
21328
21336
|
contactGroupNames.setdefault(group['name'], [])
|
|
21329
21337
|
contactGroupNames[group['name']].append(group['resourceName'])
|
|
21338
|
+
except GAPI.permissionDenied as e:
|
|
21339
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
21330
21340
|
except GAPI.forbidden:
|
|
21331
21341
|
userPeopleServiceNotEnabledWarning(entityName, i, count)
|
|
21332
21342
|
return (contactGroupIDs, False)
|
|
@@ -21425,6 +21435,8 @@ def createUserPeopleContact(users):
|
|
|
21425
21435
|
csvPF.WriteRow(row)
|
|
21426
21436
|
except GAPI.invalidArgument as e:
|
|
21427
21437
|
entityActionFailedWarning([entityType, user, peopleEntityType, None], str(e), i, count)
|
|
21438
|
+
except GAPI.permissionDenied as e:
|
|
21439
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
21428
21440
|
except (GAPI.serviceNotAvailable, GAPI.forbidden):
|
|
21429
21441
|
ClientAPIAccessDeniedExit()
|
|
21430
21442
|
if csvPF:
|
|
@@ -21588,6 +21600,8 @@ def _clearUpdatePeopleContacts(users, updateContacts):
|
|
|
21588
21600
|
entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], str(e), j, jcount)
|
|
21589
21601
|
except (GAPI.notFound, GAPI.internalError):
|
|
21590
21602
|
entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
|
|
21603
|
+
except GAPI.permissionDenied as e:
|
|
21604
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
21591
21605
|
except (GAPI.serviceNotAvailable, GAPI.forbidden):
|
|
21592
21606
|
ClientAPIAccessDeniedExit()
|
|
21593
21607
|
Ind.Decrement()
|
|
@@ -21736,6 +21750,8 @@ def dedupReplaceDomainUserPeopleContacts(users):
|
|
|
21736
21750
|
entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], str(e), j, jcount)
|
|
21737
21751
|
except (GAPI.notFound, GAPI.internalError):
|
|
21738
21752
|
entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
|
|
21753
|
+
except GAPI.permissionDenied as e:
|
|
21754
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
21739
21755
|
except (GAPI.serviceNotAvailable, GAPI.forbidden):
|
|
21740
21756
|
ClientAPIAccessDeniedExit()
|
|
21741
21757
|
Ind.Decrement()
|
|
@@ -21789,6 +21805,8 @@ def deleteUserPeopleContacts(users):
|
|
|
21789
21805
|
entityActionPerformed([entityType, user, peopleEntityType, resourceName], j, jcount)
|
|
21790
21806
|
except (GAPI.notFound, GAPI.internalError):
|
|
21791
21807
|
entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
|
|
21808
|
+
except GAPI.permissionDenied as e:
|
|
21809
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
21792
21810
|
except (GAPI.serviceNotAvailable, GAPI.forbidden):
|
|
21793
21811
|
ClientAPIAccessDeniedExit()
|
|
21794
21812
|
Ind.Decrement()
|
|
@@ -21846,12 +21864,29 @@ def _printPerson(entityTypeName, user, person, csvPF, FJQC, parameters):
|
|
|
21846
21864
|
'JSON': json.dumps(cleanJSON(person),
|
|
21847
21865
|
ensure_ascii=False, sort_keys=True)})
|
|
21848
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
|
+
|
|
21849
21884
|
def _showPerson(userEntityType, user, entityType, person, i, count, FJQC, parameters):
|
|
21850
21885
|
_processPersonMetadata(person, parameters)
|
|
21851
21886
|
if not FJQC.formatJSON:
|
|
21852
21887
|
printEntity([userEntityType, user, entityType, person['resourceName']], i, count)
|
|
21853
21888
|
Ind.Increment()
|
|
21854
|
-
showJSON(None, person)
|
|
21889
|
+
showJSON(None, person, dictObjectsKey=PEOPLE_CONTACT_OBJECT_KEYS)
|
|
21855
21890
|
Ind.Decrement()
|
|
21856
21891
|
else:
|
|
21857
21892
|
printLine(json.dumps(cleanJSON(person), ensure_ascii=False, sort_keys=True))
|
|
@@ -22067,6 +22102,8 @@ def _infoPeople(users, entityType, source):
|
|
|
22067
22102
|
except GAPI.invalidArgument as e:
|
|
22068
22103
|
entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], str(e), j, jcount)
|
|
22069
22104
|
continue
|
|
22105
|
+
except GAPI.permissionDenied as e:
|
|
22106
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
22070
22107
|
except (GAPI.serviceNotAvailable, GAPI.forbidden):
|
|
22071
22108
|
ClientAPIAccessDeniedExit()
|
|
22072
22109
|
if showContactGroups and contactGroupIDs:
|
|
@@ -22245,6 +22282,8 @@ def copyUserPeopleOtherContacts(users):
|
|
|
22245
22282
|
except (GAPI.notFound, GAPI.internalError):
|
|
22246
22283
|
entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
|
|
22247
22284
|
continue
|
|
22285
|
+
except GAPI.permissionDenied as e:
|
|
22286
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
22248
22287
|
except (GAPI.serviceNotAvailable, GAPI.forbidden):
|
|
22249
22288
|
ClientAPIAccessDeniedExit()
|
|
22250
22289
|
Ind.Decrement()
|
|
@@ -22359,7 +22398,9 @@ def processUserPeopleOtherContacts(users):
|
|
|
22359
22398
|
except (GAPI.notFound, GAPI.internalError):
|
|
22360
22399
|
entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount)
|
|
22361
22400
|
continue
|
|
22362
|
-
except
|
|
22401
|
+
except GAPI.permissionDenied as e:
|
|
22402
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
22403
|
+
except (GAPI.serviceNotAvailable, GAPI.forbidden):
|
|
22363
22404
|
ClientAPIAccessDeniedExit()
|
|
22364
22405
|
Ind.Decrement()
|
|
22365
22406
|
|
|
@@ -22476,6 +22517,8 @@ def _printShowPeople(source):
|
|
|
22476
22517
|
pageSize=GC.Values[GC.PEOPLE_MAX_RESULTS],
|
|
22477
22518
|
sources=sources, mergeSources=mergeSources,
|
|
22478
22519
|
readMask=fields, fields='nextPageToken,people', **kwargs)
|
|
22520
|
+
except GAPI.permissionDenied as e:
|
|
22521
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
22479
22522
|
except (GAPI.serviceNotAvailable, GAPI.forbidden):
|
|
22480
22523
|
ClientAPIAccessDeniedExit()
|
|
22481
22524
|
if not countsOnly:
|
|
@@ -22596,6 +22639,8 @@ def printShowUserPeopleProfiles(users):
|
|
|
22596
22639
|
except GAPI.notFound:
|
|
22597
22640
|
entityUnknownWarning(Ent.PEOPLE_PROFILE, user, i, count)
|
|
22598
22641
|
continue
|
|
22642
|
+
except GAPI.permissionDenied as e:
|
|
22643
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
22599
22644
|
except (GAPI.serviceNotAvailable, GAPI.forbidden):
|
|
22600
22645
|
ClientAPIAccessDeniedExit()
|
|
22601
22646
|
if not csvPF:
|
|
@@ -22750,6 +22795,8 @@ def _processPeopleContactPhotos(users, function):
|
|
|
22750
22795
|
entityDoesNotHaveItemWarning([entityType, user, peopleEntityType, resourceName, Ent.PHOTO, filename], j, jcount)
|
|
22751
22796
|
except (GAPI.invalidArgument, OSError, IOError) as e:
|
|
22752
22797
|
entityActionFailedWarning([entityType, user, peopleEntityType, resourceName, Ent.PHOTO, filename], str(e), j, jcount)
|
|
22798
|
+
except GAPI.permissionDenied as e:
|
|
22799
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
22753
22800
|
except (GAPI.serviceNotAvailable, GAPI.forbidden):
|
|
22754
22801
|
ClientAPIAccessDeniedExit()
|
|
22755
22802
|
break
|
|
@@ -22824,7 +22871,7 @@ def createUserPeopleContactGroup(users):
|
|
|
22824
22871
|
if addCSVData:
|
|
22825
22872
|
row.update(addCSVData)
|
|
22826
22873
|
csvPF.WriteRow(row)
|
|
22827
|
-
except GAPI.forbidden:
|
|
22874
|
+
except (GAPI.forbidden, GAPI.permissionDenied):
|
|
22828
22875
|
userPeopleServiceNotEnabledWarning(user, i, count)
|
|
22829
22876
|
except GAPI.serviceNotAvailable:
|
|
22830
22877
|
entityUnknownWarning(entityType, user, i, count)
|
|
@@ -22878,7 +22925,7 @@ def updateUserPeopleContactGroup(users):
|
|
|
22878
22925
|
entityActionPerformed([entityType, user, Ent.CONTACT_GROUP, contactGroup], j, jcount)
|
|
22879
22926
|
except (GAPI.notFound, GAPI.internalError) as e:
|
|
22880
22927
|
entityActionFailedWarning([entityType, user, Ent.CONTACT_GROUP, contactGroup], str(e), j, jcount)
|
|
22881
|
-
except GAPI.forbidden:
|
|
22928
|
+
except (GAPI.forbidden, GAPI.permissionDenied):
|
|
22882
22929
|
userPeopleServiceNotEnabledWarning(user, i, count)
|
|
22883
22930
|
break
|
|
22884
22931
|
except GAPI.serviceNotAvailable:
|
|
@@ -22923,7 +22970,7 @@ def deleteUserPeopleContactGroups(users):
|
|
|
22923
22970
|
entityActionPerformed([entityType, user, Ent.CONTACT_GROUP, contactGroup], j, jcount)
|
|
22924
22971
|
except GAPI.notFound as e:
|
|
22925
22972
|
entityActionFailedWarning([entityType, user, Ent.CONTACT_GROUP, contactGroup], str(e), j, jcount)
|
|
22926
|
-
except GAPI.forbidden:
|
|
22973
|
+
except (GAPI.forbidden, GAPI.permissionDenied):
|
|
22927
22974
|
userPeopleServiceNotEnabledWarning(user, i, count)
|
|
22928
22975
|
break
|
|
22929
22976
|
except GAPI.serviceNotAvailable:
|
|
@@ -23024,7 +23071,7 @@ def infoUserPeopleContactGroups(users):
|
|
|
23024
23071
|
_showContactGroup(entityType, user, Ent.CONTACT_GROUP, group, j, jcount, FJQC)
|
|
23025
23072
|
except GAPI.notFound as e:
|
|
23026
23073
|
entityActionFailedWarning([entityType, user, Ent.CONTACT_GROUP, contactGroup], str(e), j, jcount)
|
|
23027
|
-
except GAPI.forbidden:
|
|
23074
|
+
except (GAPI.forbidden, GAPI.permissionDenied):
|
|
23028
23075
|
userPeopleServiceNotEnabledWarning(user, i, count)
|
|
23029
23076
|
break
|
|
23030
23077
|
except GAPI.serviceNotAvailable:
|
|
@@ -23073,6 +23120,8 @@ def printShowUserPeopleContactGroups(users):
|
|
|
23073
23120
|
throwReasons=GAPI.PEOPLE_ACCESS_THROW_REASONS,
|
|
23074
23121
|
pageSize=GC.Values[GC.PEOPLE_MAX_RESULTS],
|
|
23075
23122
|
groupFields=fields, fields='nextPageToken,contactGroups')
|
|
23123
|
+
except GAPI.permissionDenied as e:
|
|
23124
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
23076
23125
|
except (GAPI.serviceNotAvailable, GAPI.forbidden):
|
|
23077
23126
|
ClientAPIAccessDeniedExit()
|
|
23078
23127
|
_printPersonEntityList(Ent.PEOPLE_CONTACT_GROUP, entityList, entityType, user, i, count, csvPF, FJQC, parameters, None)
|
|
@@ -24143,7 +24192,8 @@ def substituteQueryTimes(queries, queryTimes):
|
|
|
24143
24192
|
for i, query in enumerate(queries):
|
|
24144
24193
|
if query is not None:
|
|
24145
24194
|
for queryTimeName, queryTimeValue in iter(queryTimes.items()):
|
|
24146
|
-
|
|
24195
|
+
query = query.replace(f'#{queryTimeName}#', queryTimeValue)
|
|
24196
|
+
queries[i] = query
|
|
24147
24197
|
|
|
24148
24198
|
# Get CrOS devices from gam.cfg print_cros_ous and print_cros_ous_and_children
|
|
24149
24199
|
def getCfgCrOSEntities():
|
|
@@ -34095,7 +34145,7 @@ def doPrintGroupMembers():
|
|
|
34095
34145
|
for name in info['names']:
|
|
34096
34146
|
if name['metadata']['source']['type'] == sourceType:
|
|
34097
34147
|
return name['displayName']
|
|
34098
|
-
except (GAPI.notFound, GAPI.serviceNotAvailable, GAPI.forbidden):
|
|
34148
|
+
except (GAPI.notFound, GAPI.serviceNotAvailable, GAPI.forbidden, GAPI.permissionDenied):
|
|
34099
34149
|
pass
|
|
34100
34150
|
return unknownName
|
|
34101
34151
|
|
|
@@ -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
|