gam7 7.3.4__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 +77555 -0
- gam/__main__.py +40 -0
- gam/atom/__init__.py +1460 -0
- gam/atom/auth.py +41 -0
- gam/atom/client.py +214 -0
- gam/atom/core.py +535 -0
- gam/atom/data.py +327 -0
- gam/atom/http.py +354 -0
- gam/atom/http_core.py +599 -0
- gam/atom/http_interface.py +144 -0
- gam/atom/mock_http.py +123 -0
- gam/atom/mock_http_core.py +313 -0
- gam/atom/mock_service.py +235 -0
- gam/atom/service.py +723 -0
- gam/atom/token_store.py +105 -0
- gam/atom/url.py +130 -0
- gam/cacerts.pem +1130 -0
- gam/cbcm-v1.1beta1.json +593 -0
- gam/contactdelegation-v1.json +249 -0
- gam/datastudio-v1.json +486 -0
- gam/gamlib/__init__.py +17 -0
- gam/gamlib/glaction.py +308 -0
- gam/gamlib/glapi.py +837 -0
- gam/gamlib/glcfg.py +616 -0
- gam/gamlib/glclargs.py +1184 -0
- gam/gamlib/glentity.py +831 -0
- gam/gamlib/glgapi.py +817 -0
- gam/gamlib/glgdata.py +98 -0
- gam/gamlib/glglobals.py +307 -0
- gam/gamlib/glindent.py +46 -0
- gam/gamlib/glmsgs.py +547 -0
- gam/gamlib/glskus.py +246 -0
- gam/gamlib/gluprop.py +279 -0
- gam/gamlib/glverlibs.py +33 -0
- gam/gamlib/yubikey.py +202 -0
- gam/gdata/__init__.py +825 -0
- gam/gdata/alt/__init__.py +20 -0
- gam/gdata/alt/app_engine.py +101 -0
- gam/gdata/alt/appengine.py +321 -0
- gam/gdata/apps/__init__.py +526 -0
- gam/gdata/apps/audit/__init__.py +1 -0
- gam/gdata/apps/audit/service.py +278 -0
- gam/gdata/apps/contacts/__init__.py +874 -0
- gam/gdata/apps/contacts/service.py +355 -0
- gam/gdata/apps/service.py +544 -0
- gam/gdata/apps/sites/__init__.py +283 -0
- gam/gdata/apps/sites/service.py +246 -0
- gam/gdata/service.py +1714 -0
- gam/gdata/urlfetch.py +247 -0
- gam/googleapiclient/__init__.py +27 -0
- gam/googleapiclient/_auth.py +167 -0
- gam/googleapiclient/_helpers.py +207 -0
- gam/googleapiclient/channel.py +315 -0
- gam/googleapiclient/discovery.py +1662 -0
- gam/googleapiclient/discovery_cache/__init__.py +78 -0
- gam/googleapiclient/discovery_cache/appengine_memcache.py +55 -0
- gam/googleapiclient/discovery_cache/base.py +46 -0
- gam/googleapiclient/discovery_cache/file_cache.py +145 -0
- gam/googleapiclient/errors.py +197 -0
- gam/googleapiclient/http.py +1962 -0
- gam/googleapiclient/mimeparse.py +183 -0
- gam/googleapiclient/model.py +429 -0
- gam/googleapiclient/schema.py +317 -0
- gam/googleapiclient/version.py +15 -0
- gam/iso8601/__init__.py +28 -0
- gam/iso8601/iso8601.py +160 -0
- gam/serviceaccountlookup-v1.json +141 -0
- gam/six.py +982 -0
- gam7-7.3.4.dist-info/METADATA +69 -0
- gam7-7.3.4.dist-info/RECORD +72 -0
- gam7-7.3.4.dist-info/WHEEL +4 -0
- gam7-7.3.4.dist-info/licenses/LICENSE +201 -0
gam/gamlib/glgdata.py
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
# Copyright (C) 2023 Ross Scroggs All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# All Rights Reserved.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
8
|
+
# not use this file except in compliance with the License. You may obtain
|
|
9
|
+
# a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
16
|
+
# License for the specific language governing permissions and limitations
|
|
17
|
+
# under the License.
|
|
18
|
+
|
|
19
|
+
"""GAM GData resources
|
|
20
|
+
|
|
21
|
+
"""
|
|
22
|
+
API_DEPRECATED_MSG = 'Contacts API is being deprecated.'
|
|
23
|
+
|
|
24
|
+
# callGData throw errors
|
|
25
|
+
API_DEPRECATED = 612
|
|
26
|
+
BAD_GATEWAY = 601
|
|
27
|
+
BAD_REQUEST = 602
|
|
28
|
+
DOES_NOT_EXIST = 1301
|
|
29
|
+
ENTITY_EXISTS = 1300
|
|
30
|
+
FORBIDDEN = 603
|
|
31
|
+
GATEWAY_TIMEOUT = 612
|
|
32
|
+
INSUFFICIENT_PERMISSIONS = 604
|
|
33
|
+
INTERNAL_SERVER_ERROR = 1000
|
|
34
|
+
INVALID_DOMAIN = 605
|
|
35
|
+
INVALID_INPUT = 1317
|
|
36
|
+
INVALID_VALUE = 1801
|
|
37
|
+
NAME_NOT_VALID = 1303
|
|
38
|
+
NOT_FOUND = 606
|
|
39
|
+
NOT_IMPLEMENTED = 607
|
|
40
|
+
PRECONDITION_FAILED = 608
|
|
41
|
+
QUOTA_EXCEEDED = 609
|
|
42
|
+
SERVICE_NOT_APPLICABLE = 1410
|
|
43
|
+
SERVICE_UNAVAILABLE = 610
|
|
44
|
+
TOKEN_EXPIRED = 611
|
|
45
|
+
TOKEN_INVALID = 403
|
|
46
|
+
UNKNOWN_ERROR = 600
|
|
47
|
+
#
|
|
48
|
+
NON_TERMINATING_ERRORS = [API_DEPRECATED, BAD_GATEWAY, GATEWAY_TIMEOUT, QUOTA_EXCEEDED, SERVICE_UNAVAILABLE, TOKEN_EXPIRED]
|
|
49
|
+
EMAILSETTINGS_THROW_LIST = [INVALID_DOMAIN, DOES_NOT_EXIST, SERVICE_NOT_APPLICABLE, BAD_REQUEST, NAME_NOT_VALID, INTERNAL_SERVER_ERROR, INVALID_VALUE]
|
|
50
|
+
#
|
|
51
|
+
class apiDeprecated(Exception):
|
|
52
|
+
pass
|
|
53
|
+
class badRequest(Exception):
|
|
54
|
+
pass
|
|
55
|
+
class doesNotExist(Exception):
|
|
56
|
+
pass
|
|
57
|
+
class entityExists(Exception):
|
|
58
|
+
pass
|
|
59
|
+
class forbidden(Exception):
|
|
60
|
+
pass
|
|
61
|
+
class insufficientPermissions(Exception):
|
|
62
|
+
pass
|
|
63
|
+
class internalServerError(Exception):
|
|
64
|
+
pass
|
|
65
|
+
class invalidDomain(Exception):
|
|
66
|
+
pass
|
|
67
|
+
class invalidInput(Exception):
|
|
68
|
+
pass
|
|
69
|
+
class invalidValue(Exception):
|
|
70
|
+
pass
|
|
71
|
+
class nameNotValid(Exception):
|
|
72
|
+
pass
|
|
73
|
+
class notFound(Exception):
|
|
74
|
+
pass
|
|
75
|
+
class notImplemented(Exception):
|
|
76
|
+
pass
|
|
77
|
+
class preconditionFailed(Exception):
|
|
78
|
+
pass
|
|
79
|
+
class serviceNotApplicable(Exception):
|
|
80
|
+
pass
|
|
81
|
+
|
|
82
|
+
ERROR_CODE_EXCEPTION_MAP = {
|
|
83
|
+
API_DEPRECATED: apiDeprecated,
|
|
84
|
+
BAD_REQUEST: badRequest,
|
|
85
|
+
DOES_NOT_EXIST: doesNotExist,
|
|
86
|
+
ENTITY_EXISTS: entityExists,
|
|
87
|
+
FORBIDDEN: forbidden,
|
|
88
|
+
INSUFFICIENT_PERMISSIONS: insufficientPermissions,
|
|
89
|
+
INTERNAL_SERVER_ERROR: internalServerError,
|
|
90
|
+
INVALID_DOMAIN: invalidDomain,
|
|
91
|
+
INVALID_INPUT: invalidInput,
|
|
92
|
+
INVALID_VALUE: invalidValue,
|
|
93
|
+
NAME_NOT_VALID: nameNotValid,
|
|
94
|
+
NOT_FOUND: notFound,
|
|
95
|
+
NOT_IMPLEMENTED: notImplemented,
|
|
96
|
+
PRECONDITION_FAILED: preconditionFailed,
|
|
97
|
+
SERVICE_NOT_APPLICABLE: serviceNotApplicable,
|
|
98
|
+
}
|
gam/gamlib/glglobals.py
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
# Copyright (C) 2023 Ross Scroggs All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# All Rights Reserved.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
8
|
+
# not use this file except in compliance with the License. You may obtain
|
|
9
|
+
# a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
16
|
+
# License for the specific language governing permissions and limitations
|
|
17
|
+
# under the License.
|
|
18
|
+
|
|
19
|
+
"""GAM global variables
|
|
20
|
+
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
# The following GM_XXX constants are arbitrary but must be unique
|
|
24
|
+
# Most errors print a message and bail out with a return code
|
|
25
|
+
# Some commands want to set a non-zero return code but not bail
|
|
26
|
+
# GAM admin user
|
|
27
|
+
ADMIN = 'admin'
|
|
28
|
+
# Number/length of API call retries
|
|
29
|
+
API_CALLS_RETRY_DATA = 'rtry'
|
|
30
|
+
# GAM cache directory. If no_cache is True, this variable will be set to None
|
|
31
|
+
CACHE_DIR = 'gacd'
|
|
32
|
+
# Reset GAM cache directory after discovery
|
|
33
|
+
CACHE_DISCOVERY_ONLY = 'gcdo'
|
|
34
|
+
# Classroom service not available
|
|
35
|
+
CLASSROOM_SERVICE_NOT_AVAILABLE = 'csna'
|
|
36
|
+
# Command logging
|
|
37
|
+
CMDLOG_HANDLER = 'clha'
|
|
38
|
+
CMDLOG_LOGGER = 'cllo'
|
|
39
|
+
# Convert to local time
|
|
40
|
+
CONVERT_TO_LOCAL_TIME = 'ctlt'
|
|
41
|
+
# Credentials scopes
|
|
42
|
+
CREDENTIALS_SCOPES = 'crsc'
|
|
43
|
+
# csvfile keyfield <FieldName> [delimiter <Character>] (matchfield <FieldName> <MatchPattern>)* [datafield <FieldName>(:<FieldName>*) [delimiter <String>]]
|
|
44
|
+
CSVFILE = 'csvf'
|
|
45
|
+
# { key: [datafieldvalues]}
|
|
46
|
+
CSV_DATA_DICT = 'csdd'
|
|
47
|
+
CSV_KEY_FIELD = 'cskf'
|
|
48
|
+
CSV_SUBKEY_FIELD = 'cssk'
|
|
49
|
+
CSV_DATA_FIELD = 'csdf'
|
|
50
|
+
# Filter for input column drop values
|
|
51
|
+
CSV_INPUT_ROW_DROP_FILTER = 'cird'
|
|
52
|
+
# Mode (and|or) for input column drop values
|
|
53
|
+
CSV_INPUT_ROW_DROP_FILTER_MODE = 'cidm'
|
|
54
|
+
# Filter for input column values
|
|
55
|
+
CSV_INPUT_ROW_FILTER = 'cirf'
|
|
56
|
+
# Mode (and|or) for input column values
|
|
57
|
+
CSV_INPUT_ROW_FILTER_MODE = 'cirm'
|
|
58
|
+
# Limit number of input rows
|
|
59
|
+
CSV_INPUT_ROW_LIMIT = 'cirl'
|
|
60
|
+
# Column delimiter in CSV output file
|
|
61
|
+
CSV_OUTPUT_COLUMN_DELIMITER = 'codl'
|
|
62
|
+
# Filter for output column headers to drop
|
|
63
|
+
CSV_OUTPUT_HEADER_DROP_FILTER = 'cohd'
|
|
64
|
+
# Filter for output column headers
|
|
65
|
+
CSV_OUTPUT_HEADER_FILTER = 'cohf'
|
|
66
|
+
# Force output column headers
|
|
67
|
+
CSV_OUTPUT_HEADER_FORCE = 'cofh'
|
|
68
|
+
# Order output column headers
|
|
69
|
+
CSV_OUTPUT_HEADER_ORDER = 'coho'
|
|
70
|
+
# No escape character in CSV output file
|
|
71
|
+
CSV_OUTPUT_NO_ESCAPE_CHAR = 'cone'
|
|
72
|
+
# Quote character in CSV output file
|
|
73
|
+
CSV_OUTPUT_QUOTE_CHAR = 'coqc'
|
|
74
|
+
# Filter for output column drop values
|
|
75
|
+
CSV_OUTPUT_ROW_DROP_FILTER = 'cord'
|
|
76
|
+
# Mode (and|or) for output column drop values
|
|
77
|
+
CSV_OUTPUT_ROW_DROP_FILTER_MODE = 'codm'
|
|
78
|
+
# Filter for output column values
|
|
79
|
+
CSV_OUTPUT_ROW_FILTER = 'corf'
|
|
80
|
+
# Mode (and|or) for output column values
|
|
81
|
+
CSV_OUTPUT_ROW_FILTER_MODE = 'corm'
|
|
82
|
+
# Limit number of output rows
|
|
83
|
+
CSV_OUTPUT_ROW_LIMIT = 'corl'
|
|
84
|
+
# Add timestamp column to CSV output file
|
|
85
|
+
CSV_OUTPUT_TIMESTAMP_COLUMN = 'cotc'
|
|
86
|
+
# Output sort headers
|
|
87
|
+
CSV_OUTPUT_SORT_HEADERS = 'cosh'
|
|
88
|
+
# CSV todrive options
|
|
89
|
+
CSV_TODRIVE = 'todr'
|
|
90
|
+
# Current API services
|
|
91
|
+
CURRENT_API_SERVICES = 'caps'
|
|
92
|
+
# Current Client API
|
|
93
|
+
CURRENT_CLIENT_API = 'ccap'
|
|
94
|
+
# Current Client API scopes
|
|
95
|
+
CURRENT_CLIENT_API_SCOPES = 'ccas'
|
|
96
|
+
# Current Service Account API
|
|
97
|
+
CURRENT_SVCACCT_API = 'csap'
|
|
98
|
+
# Current Service Account API scopes
|
|
99
|
+
CURRENT_SVCACCT_API_SCOPES = 'csas'
|
|
100
|
+
# Current Service Account user
|
|
101
|
+
CURRENT_SVCACCT_USER = 'csa'
|
|
102
|
+
# datetime.datetime.now
|
|
103
|
+
DATETIME_NOW = 'dtno'
|
|
104
|
+
# If debug_level > 0: extra_args['prettyPrint'] = True, httplib2.debuglevel = gam_debug_level, appsObj.debug = True
|
|
105
|
+
DEBUG_LEVEL = 'dbgl'
|
|
106
|
+
# Decoded ID token
|
|
107
|
+
DECODED_ID_TOKEN = 'didt'
|
|
108
|
+
# Index of start of <UserTypeEntity> in command line
|
|
109
|
+
ENTITY_CL_DELAY_START = 'ecld'
|
|
110
|
+
ENTITY_CL_START = 'ecls'
|
|
111
|
+
# Extra arguments to pass to GAPI functions
|
|
112
|
+
EXTRA_ARGS_LIST = 'exad'
|
|
113
|
+
# gam.cfg file
|
|
114
|
+
GAM_CFG_FILE = 'gcfi'
|
|
115
|
+
GAM_CFG_PATH = 'gcpa'
|
|
116
|
+
GAM_CFG_SECTION = 'gcse'
|
|
117
|
+
GAM_CFG_SECTION_NAME = 'gcsn'
|
|
118
|
+
# Path to gam
|
|
119
|
+
GAM_PATH = 'gpth'
|
|
120
|
+
# Python source, PyInstaller or StaticX?
|
|
121
|
+
GAM_TYPE = 'gtyp'
|
|
122
|
+
# Length of last Got message
|
|
123
|
+
LAST_GOT_MSG_LEN = 'lgml'
|
|
124
|
+
# License SKUs
|
|
125
|
+
LICENSE_SKUS = 'lsku'
|
|
126
|
+
# Make Building ID/Name map
|
|
127
|
+
MAKE_BUILDING_ID_NAME_MAP = 'mkbm'
|
|
128
|
+
# Dictionary mapping Building ID to Name
|
|
129
|
+
MAP_BUILDING_ID_TO_NAME = 'bi2n'
|
|
130
|
+
# Dictionary mapping Building Name to ID
|
|
131
|
+
MAP_BUILDING_NAME_TO_ID = 'bn2i'
|
|
132
|
+
# Dictionary mapping OrgUnit ID to Name
|
|
133
|
+
MAP_ORGUNIT_ID_TO_NAME = 'oi2n'
|
|
134
|
+
# Dictionary mapping Shared Drive ID to Name
|
|
135
|
+
MAP_SHAREDDRIVE_ID_TO_NAME = 'si2n'
|
|
136
|
+
# Make Role ID/Name map
|
|
137
|
+
MAKE_ROLE_ID_NAME_MAP = 'mkrm'
|
|
138
|
+
# Dictionary mapping Role ID to Name
|
|
139
|
+
MAP_ROLE_ID_TO_NAME = 'ri2n'
|
|
140
|
+
# Dictionary mapping Role Name to ID
|
|
141
|
+
MAP_ROLE_NAME_TO_ID = 'rn2i'
|
|
142
|
+
# Dictionary mapping User ID to Name
|
|
143
|
+
MAP_USER_ID_TO_NAME = 'ui2n'
|
|
144
|
+
# Multiprocess exit condition
|
|
145
|
+
MULTIPROCESS_EXIT_CONDITION = 'mpec'
|
|
146
|
+
# Multiprocess exit processing
|
|
147
|
+
MULTIPROCESS_EXIT_PROCESSING = 'mpep'
|
|
148
|
+
# Number of batch items
|
|
149
|
+
NUM_BATCH_ITEMS = 'nbat'
|
|
150
|
+
# Values retrieved from oauth2service.json
|
|
151
|
+
OAUTH2SERVICE_CLIENT_ID = 'osci'
|
|
152
|
+
OAUTH2SERVICE_JSON_DATA = 'osjd'
|
|
153
|
+
# Values retrieved from oauth2.txt
|
|
154
|
+
OAUTH2_CLIENT_ID = 'oaci'
|
|
155
|
+
# oauth2.txt lock file
|
|
156
|
+
OAUTH2_TXT_LOCK = 'oatl'
|
|
157
|
+
# Output date format, empty defalts to ISOFormat
|
|
158
|
+
OUTPUT_DATEFORMAT = 'oudf'
|
|
159
|
+
# Output time format, empty defalts to ISOFormat
|
|
160
|
+
OUTPUT_TIMEFORMAT = 'outf'
|
|
161
|
+
# gam.cfg parser
|
|
162
|
+
PARSER = 'pars'
|
|
163
|
+
# Process ID
|
|
164
|
+
PID = 'pid '
|
|
165
|
+
# Domains for print alises|groups|users
|
|
166
|
+
PRINT_AGU_DOMAINS = 'pagu'
|
|
167
|
+
# OrgUnits for print cros
|
|
168
|
+
PRINT_CROS_OUS = 'pcou'
|
|
169
|
+
# OrgUnits and children for print cros
|
|
170
|
+
PRINT_CROS_OUS_AND_CHILDREN = 'pcoc'
|
|
171
|
+
# Check API calls rate
|
|
172
|
+
RATE_CHECK_COUNT = 'rccn'
|
|
173
|
+
RATE_CHECK_START = 'rcst'
|
|
174
|
+
# Section name from outer gam, passed to inner gams
|
|
175
|
+
SECTION = 'sect'
|
|
176
|
+
# Enable/disable "Getting ... " messages
|
|
177
|
+
SHOW_GETTINGS = 'shog'
|
|
178
|
+
# Enable/disable NL at end of "Got ..." messages
|
|
179
|
+
SHOW_GETTINGS_GOT_NL = 'shgn'
|
|
180
|
+
# redirected files
|
|
181
|
+
SAVED_STDOUT = 'svso'
|
|
182
|
+
STDERR = 'stde'
|
|
183
|
+
STDOUT = 'stdo'
|
|
184
|
+
# Scopes values retrieved from oauth2service.json
|
|
185
|
+
SVCACCT_SCOPES = 'sasc'
|
|
186
|
+
# Were scopes values retrieved from oauth2service.json
|
|
187
|
+
SVCACCT_SCOPES_DEFINED = 'sasd'
|
|
188
|
+
# Most errors print a message and bail out with a return code
|
|
189
|
+
# Some commands want to set a non-zero return code but not bail
|
|
190
|
+
SYSEXITRC = 'sxrc'
|
|
191
|
+
# Encodings
|
|
192
|
+
SYS_ENCODING = 'syen'
|
|
193
|
+
# Shared by threadBatchWorker and threadBatchGAMCommands
|
|
194
|
+
TBATCH_QUEUE = 'batq'
|
|
195
|
+
# redirected file fields: name, mode, encoding, write header, multiproces, queue
|
|
196
|
+
REDIRECT_NAME = 'rdfn'
|
|
197
|
+
REDIRECT_MODE = 'rdmo'
|
|
198
|
+
REDIRECT_FD = 'rdfd'
|
|
199
|
+
REDIRECT_MULTI_FD = 'rdmf'
|
|
200
|
+
REDIRECT_STD = 'rdst'
|
|
201
|
+
REDIRECT_ENCODING = 'rden'
|
|
202
|
+
REDIRECT_WRITE_HEADER = 'rdwh'
|
|
203
|
+
REDIRECT_MULTIPROCESS = 'rdmp'
|
|
204
|
+
REDIRECT_QUEUE = 'rdq'
|
|
205
|
+
REDIRECT_QUEUE_NAME = 'name'
|
|
206
|
+
REDIRECT_QUEUE_TODRIVE = 'todrive'
|
|
207
|
+
REDIRECT_QUEUE_CSVPF = 'csvpf'
|
|
208
|
+
REDIRECT_QUEUE_DATA = 'rows'
|
|
209
|
+
REDIRECT_QUEUE_ARGS = 'args'
|
|
210
|
+
REDIRECT_QUEUE_GLOBALS = 'globals'
|
|
211
|
+
REDIRECT_QUEUE_VALUES = 'values'
|
|
212
|
+
REDIRECT_QUEUE_START = 'start'
|
|
213
|
+
REDIRECT_QUEUE_END = 'end'
|
|
214
|
+
REDIRECT_QUEUE_EOF = 'eof'
|
|
215
|
+
#
|
|
216
|
+
Globals = {
|
|
217
|
+
ADMIN: None,
|
|
218
|
+
API_CALLS_RETRY_DATA: {},
|
|
219
|
+
CACHE_DIR: None,
|
|
220
|
+
CACHE_DISCOVERY_ONLY: True,
|
|
221
|
+
CLASSROOM_SERVICE_NOT_AVAILABLE: False,
|
|
222
|
+
CMDLOG_HANDLER: None,
|
|
223
|
+
CMDLOG_LOGGER: None,
|
|
224
|
+
CONVERT_TO_LOCAL_TIME: False,
|
|
225
|
+
CREDENTIALS_SCOPES: set(),
|
|
226
|
+
CSVFILE: {},
|
|
227
|
+
CSV_DATA_DICT: {},
|
|
228
|
+
CSV_KEY_FIELD: None,
|
|
229
|
+
CSV_SUBKEY_FIELD: None,
|
|
230
|
+
CSV_DATA_FIELD: None,
|
|
231
|
+
CSV_INPUT_ROW_DROP_FILTER: [],
|
|
232
|
+
CSV_INPUT_ROW_DROP_FILTER_MODE: False,
|
|
233
|
+
CSV_INPUT_ROW_FILTER: [],
|
|
234
|
+
CSV_INPUT_ROW_FILTER_MODE: True,
|
|
235
|
+
CSV_INPUT_ROW_LIMIT: 0,
|
|
236
|
+
CSV_OUTPUT_COLUMN_DELIMITER: None,
|
|
237
|
+
CSV_OUTPUT_HEADER_DROP_FILTER: [],
|
|
238
|
+
CSV_OUTPUT_HEADER_FILTER: [],
|
|
239
|
+
CSV_OUTPUT_HEADER_FORCE: [],
|
|
240
|
+
CSV_OUTPUT_HEADER_ORDER: [],
|
|
241
|
+
CSV_OUTPUT_NO_ESCAPE_CHAR: None,
|
|
242
|
+
CSV_OUTPUT_QUOTE_CHAR: None,
|
|
243
|
+
CSV_OUTPUT_ROW_DROP_FILTER: [],
|
|
244
|
+
CSV_OUTPUT_ROW_DROP_FILTER_MODE: False,
|
|
245
|
+
CSV_OUTPUT_ROW_FILTER: [],
|
|
246
|
+
CSV_OUTPUT_ROW_FILTER_MODE: True,
|
|
247
|
+
CSV_OUTPUT_ROW_LIMIT: 0,
|
|
248
|
+
CSV_OUTPUT_SORT_HEADERS: [],
|
|
249
|
+
CSV_OUTPUT_TIMESTAMP_COLUMN: None,
|
|
250
|
+
CSV_TODRIVE: {},
|
|
251
|
+
CURRENT_API_SERVICES: {},
|
|
252
|
+
CURRENT_CLIENT_API: None,
|
|
253
|
+
CURRENT_CLIENT_API_SCOPES: set(),
|
|
254
|
+
CURRENT_SVCACCT_API: None,
|
|
255
|
+
CURRENT_SVCACCT_API_SCOPES: set(),
|
|
256
|
+
CURRENT_SVCACCT_USER: None,
|
|
257
|
+
DATETIME_NOW: None,
|
|
258
|
+
DEBUG_LEVEL: 0,
|
|
259
|
+
DECODED_ID_TOKEN: None,
|
|
260
|
+
ENTITY_CL_DELAY_START: 1,
|
|
261
|
+
ENTITY_CL_START: 1,
|
|
262
|
+
EXTRA_ARGS_LIST: [],
|
|
263
|
+
GAM_CFG_FILE: '',
|
|
264
|
+
GAM_CFG_PATH: '',
|
|
265
|
+
GAM_CFG_SECTION: '',
|
|
266
|
+
GAM_CFG_SECTION_NAME: '',
|
|
267
|
+
GAM_PATH: '.',
|
|
268
|
+
GAM_TYPE: '',
|
|
269
|
+
LAST_GOT_MSG_LEN: 0,
|
|
270
|
+
LICENSE_SKUS: [],
|
|
271
|
+
MAKE_BUILDING_ID_NAME_MAP: True,
|
|
272
|
+
MAKE_ROLE_ID_NAME_MAP: True,
|
|
273
|
+
MAP_BUILDING_ID_TO_NAME: {},
|
|
274
|
+
MAP_BUILDING_NAME_TO_ID: {},
|
|
275
|
+
MAP_ORGUNIT_ID_TO_NAME: {},
|
|
276
|
+
MAP_SHAREDDRIVE_ID_TO_NAME: {},
|
|
277
|
+
MAP_ROLE_ID_TO_NAME: {},
|
|
278
|
+
MAP_ROLE_NAME_TO_ID: {},
|
|
279
|
+
MAP_USER_ID_TO_NAME: {},
|
|
280
|
+
MULTIPROCESS_EXIT_CONDITION: None,
|
|
281
|
+
MULTIPROCESS_EXIT_PROCESSING: False,
|
|
282
|
+
NUM_BATCH_ITEMS: 0,
|
|
283
|
+
OAUTH2SERVICE_CLIENT_ID: None,
|
|
284
|
+
OAUTH2SERVICE_JSON_DATA: {},
|
|
285
|
+
OAUTH2_CLIENT_ID: None,
|
|
286
|
+
OAUTH2_TXT_LOCK: None,
|
|
287
|
+
OUTPUT_DATEFORMAT: '',
|
|
288
|
+
OUTPUT_TIMEFORMAT: '',
|
|
289
|
+
PARSER: None,
|
|
290
|
+
PID: 0,
|
|
291
|
+
PRINT_AGU_DOMAINS: '',
|
|
292
|
+
PRINT_CROS_OUS: '',
|
|
293
|
+
PRINT_CROS_OUS_AND_CHILDREN: '',
|
|
294
|
+
RATE_CHECK_COUNT: 0,
|
|
295
|
+
RATE_CHECK_START: 0,
|
|
296
|
+
SECTION: None,
|
|
297
|
+
SHOW_GETTINGS: True,
|
|
298
|
+
SHOW_GETTINGS_GOT_NL: False,
|
|
299
|
+
SAVED_STDOUT: None,
|
|
300
|
+
STDERR: {},
|
|
301
|
+
STDOUT: {},
|
|
302
|
+
SVCACCT_SCOPES: {},
|
|
303
|
+
SVCACCT_SCOPES_DEFINED: False,
|
|
304
|
+
SYSEXITRC: 0,
|
|
305
|
+
SYS_ENCODING: 'utf-8',
|
|
306
|
+
TBATCH_QUEUE: None
|
|
307
|
+
}
|
gam/gamlib/glindent.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
# Copyright (C) 2023 Ross Scroggs All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# All Rights Reserved.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
8
|
+
# not use this file except in compliance with the License. You may obtain
|
|
9
|
+
# a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
16
|
+
# License for the specific language governing permissions and limitations
|
|
17
|
+
# under the License.
|
|
18
|
+
|
|
19
|
+
"""GAM indent processing
|
|
20
|
+
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
class GamIndent():
|
|
24
|
+
|
|
25
|
+
INDENT_SPACES_PER_LEVEL = ' '
|
|
26
|
+
|
|
27
|
+
def __init__(self):
|
|
28
|
+
self.indent = 0
|
|
29
|
+
|
|
30
|
+
def Reset(self):
|
|
31
|
+
self.indent = 0
|
|
32
|
+
|
|
33
|
+
def Increment(self):
|
|
34
|
+
self.indent += 1
|
|
35
|
+
|
|
36
|
+
def Decrement(self):
|
|
37
|
+
self.indent -= 1
|
|
38
|
+
|
|
39
|
+
def Spaces(self):
|
|
40
|
+
return self.INDENT_SPACES_PER_LEVEL*self.indent
|
|
41
|
+
|
|
42
|
+
def SpacesSub1(self):
|
|
43
|
+
return self.INDENT_SPACES_PER_LEVEL*(self.indent-1)
|
|
44
|
+
|
|
45
|
+
def MultiLineText(self, message, n=0):
|
|
46
|
+
return message.replace('\n', f'\n{self.INDENT_SPACES_PER_LEVEL*(self.indent+n)}').rstrip()
|