mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-04 04:41:35 +00:00
Team Drive Theme support
This commit is contained in:
26
src/gam.py
26
src/gam.py
@@ -3791,6 +3791,18 @@ def printDriveSettings(users):
|
|||||||
csvRows.append(row)
|
csvRows.append(row)
|
||||||
writeCSVfile(csvRows, titles, u'User Drive Settings', todrive)
|
writeCSVfile(csvRows, titles, u'User Drive Settings', todrive)
|
||||||
|
|
||||||
|
def getTeamDriveThemes(users):
|
||||||
|
for user in users:
|
||||||
|
user, drive = buildDrive3GAPIObject(user)
|
||||||
|
if not drive:
|
||||||
|
continue
|
||||||
|
themes = callGAPI(drive.about(), u'get', fields=u'teamDriveThemes', soft_errors=True)
|
||||||
|
if themes is None or u'teamDriveThemes' not in themes:
|
||||||
|
continue
|
||||||
|
print u'theme'
|
||||||
|
for theme in themes[u'teamDriveThemes']:
|
||||||
|
print theme[u'id']
|
||||||
|
|
||||||
def printDriveActivity(users):
|
def printDriveActivity(users):
|
||||||
drive_ancestorId = u'root'
|
drive_ancestorId = u'root'
|
||||||
drive_fileId = None
|
drive_fileId = None
|
||||||
@@ -7283,6 +7295,15 @@ and accept the Terms of Service (ToS). As soon as you've accepted the ToS popup,
|
|||||||
|
|
||||||
def doCreateTeamDrive(users):
|
def doCreateTeamDrive(users):
|
||||||
body = {u'name': sys.argv[5]}
|
body = {u'name': sys.argv[5]}
|
||||||
|
i = 6
|
||||||
|
while i < len(sys.argv):
|
||||||
|
if sys.argv[i].lower() == u'theme':
|
||||||
|
body[u'themeId'] = sys.argv[i+1]
|
||||||
|
i += 2
|
||||||
|
else:
|
||||||
|
print u'ERROR: %s is not a valid argument to "gam <users> create teamdrive"' % sys.argv[i]
|
||||||
|
print sys.argv
|
||||||
|
sys.exit(3)
|
||||||
for user in users:
|
for user in users:
|
||||||
drive = buildGAPIServiceObject(u'drive3', user)
|
drive = buildGAPIServiceObject(u'drive3', user)
|
||||||
requestId = unicode(uuid.uuid4())
|
requestId = unicode(uuid.uuid4())
|
||||||
@@ -7297,6 +7318,9 @@ def doUpdateTeamDrive(users):
|
|||||||
if sys.argv[i].lower() == u'name':
|
if sys.argv[i].lower() == u'name':
|
||||||
body[u'name'] = sys.argv[i+1]
|
body[u'name'] = sys.argv[i+1]
|
||||||
i += 2
|
i += 2
|
||||||
|
elif sys.argv[i].lower() == u'theme':
|
||||||
|
body[u'themeId'] = sys.argv[i+1]
|
||||||
|
i += 2
|
||||||
else:
|
else:
|
||||||
print u'ERROR: %s is not a valid argument for "gam <users> update drivefile"'
|
print u'ERROR: %s is not a valid argument for "gam <users> update drivefile"'
|
||||||
sys.exit(3)
|
sys.exit(3)
|
||||||
@@ -12069,6 +12093,8 @@ def ProcessGAMCommand(args):
|
|||||||
showCalSettings(users)
|
showCalSettings(users)
|
||||||
elif showWhat == u'drivesettings':
|
elif showWhat == u'drivesettings':
|
||||||
printDriveSettings(users)
|
printDriveSettings(users)
|
||||||
|
elif showWhat == u'teamdrivethemes':
|
||||||
|
getTeamDriveThemes(users)
|
||||||
elif showWhat == u'drivefileacl':
|
elif showWhat == u'drivefileacl':
|
||||||
showDriveFileACL(users)
|
showDriveFileACL(users)
|
||||||
elif showWhat == u'filelist':
|
elif showWhat == u'filelist':
|
||||||
|
|||||||
Reference in New Issue
Block a user