pycupra 0.1.12__py3-none-any.whl → 0.1.14__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.
- example/PyCupra.py +611 -0
- example/PyCupra_ExportDrivingData.py +113 -0
- pycupra/connection.py +78 -68
- pycupra/dashboard.py +36 -36
- pycupra/firebase.py +11 -8
- pycupra/firebase_messaging/android_checkin_pb2.pyi +257 -257
- pycupra/firebase_messaging/fcmpushclient.py +8 -7
- pycupra/firebase_messaging/fcmregister.py +3 -3
- pycupra/utilities.py +2 -26
- pycupra/vehicle.py +299 -226
- pycupra-0.1.14.dist-info/METADATA +63 -0
- {pycupra-0.1.12.dist-info → pycupra-0.1.14.dist-info}/RECORD +15 -14
- pycupra-0.1.14.dist-info/top_level.txt +3 -0
- pycupra/__version__.py +0 -6
- pycupra-0.1.12.dist-info/METADATA +0 -13
- pycupra-0.1.12.dist-info/top_level.txt +0 -1
- {pycupra-0.1.12.dist-info → pycupra-0.1.14.dist-info}/WHEEL +0 -0
- {pycupra-0.1.12.dist-info → pycupra-0.1.14.dist-info}/licenses/LICENSE +0 -0
@@ -1,257 +1,257 @@
|
|
1
|
-
"""
|
2
|
-
@generated by mypy-protobuf. Do not edit manually!
|
3
|
-
isort:skip_file
|
4
|
-
Copyright 2014 The Chromium Authors. All rights reserved.
|
5
|
-
Use of this source code is governed by a BSD-style license that can be
|
6
|
-
found in the LICENSE file.
|
7
|
-
|
8
|
-
Logging information for Android "checkin" events (automatic, periodic
|
9
|
-
requests made by Android devices to the server).
|
10
|
-
"""
|
11
|
-
|
12
|
-
import builtins
|
13
|
-
import google.protobuf.descriptor
|
14
|
-
import google.protobuf.internal.enum_type_wrapper
|
15
|
-
import google.protobuf.message
|
16
|
-
import sys
|
17
|
-
import typing
|
18
|
-
|
19
|
-
if sys.version_info >= (3, 10):
|
20
|
-
import typing as typing_extensions
|
21
|
-
else:
|
22
|
-
import typing_extensions
|
23
|
-
|
24
|
-
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
25
|
-
|
26
|
-
class _DeviceType:
|
27
|
-
ValueType = typing.NewType("ValueType", builtins.int)
|
28
|
-
V: typing_extensions.TypeAlias = ValueType
|
29
|
-
|
30
|
-
class _DeviceTypeEnumTypeWrapper(
|
31
|
-
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DeviceType.ValueType],
|
32
|
-
builtins.type,
|
33
|
-
):
|
34
|
-
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
35
|
-
DEVICE_ANDROID_OS: _DeviceType.ValueType # 1
|
36
|
-
"""Android Device"""
|
37
|
-
DEVICE_IOS_OS: _DeviceType.ValueType # 2
|
38
|
-
"""Apple IOS device"""
|
39
|
-
DEVICE_CHROME_BROWSER: _DeviceType.ValueType # 3
|
40
|
-
"""Chrome browser - Not Chrome OS. No hardware records."""
|
41
|
-
DEVICE_CHROME_OS: _DeviceType.ValueType # 4
|
42
|
-
"""Chrome OS"""
|
43
|
-
|
44
|
-
class DeviceType(_DeviceType, metaclass=_DeviceTypeEnumTypeWrapper):
|
45
|
-
"""enum values correspond to the type of device.
|
46
|
-
Used in the AndroidCheckinProto and Device proto.
|
47
|
-
"""
|
48
|
-
|
49
|
-
DEVICE_ANDROID_OS: DeviceType.ValueType # 1
|
50
|
-
"""Android Device"""
|
51
|
-
DEVICE_IOS_OS: DeviceType.ValueType # 2
|
52
|
-
"""Apple IOS device"""
|
53
|
-
DEVICE_CHROME_BROWSER: DeviceType.ValueType # 3
|
54
|
-
"""Chrome browser - Not Chrome OS. No hardware records."""
|
55
|
-
DEVICE_CHROME_OS: DeviceType.ValueType # 4
|
56
|
-
"""Chrome OS"""
|
57
|
-
global___DeviceType = DeviceType
|
58
|
-
|
59
|
-
@typing_extensions.final
|
60
|
-
class ChromeBuildProto(google.protobuf.message.Message):
|
61
|
-
"""Build characteristics unique to the Chrome browser, and Chrome OS"""
|
62
|
-
|
63
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
64
|
-
|
65
|
-
class _Platform:
|
66
|
-
ValueType = typing.NewType("ValueType", builtins.int)
|
67
|
-
V: typing_extensions.TypeAlias = ValueType
|
68
|
-
|
69
|
-
class _PlatformEnumTypeWrapper(
|
70
|
-
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
|
71
|
-
ChromeBuildProto._Platform.ValueType
|
72
|
-
],
|
73
|
-
builtins.type,
|
74
|
-
):
|
75
|
-
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
76
|
-
PLATFORM_WIN: ChromeBuildProto._Platform.ValueType # 1
|
77
|
-
PLATFORM_MAC: ChromeBuildProto._Platform.ValueType # 2
|
78
|
-
PLATFORM_LINUX: ChromeBuildProto._Platform.ValueType # 3
|
79
|
-
PLATFORM_CROS: ChromeBuildProto._Platform.ValueType # 4
|
80
|
-
PLATFORM_IOS: ChromeBuildProto._Platform.ValueType # 5
|
81
|
-
PLATFORM_ANDROID: ChromeBuildProto._Platform.ValueType # 6
|
82
|
-
"""Just a placeholder. Likely don't need it due to the presence of the
|
83
|
-
Android GCM on phone/tablet devices.
|
84
|
-
"""
|
85
|
-
|
86
|
-
class Platform(_Platform, metaclass=_PlatformEnumTypeWrapper): ...
|
87
|
-
PLATFORM_WIN: ChromeBuildProto.Platform.ValueType # 1
|
88
|
-
PLATFORM_MAC: ChromeBuildProto.Platform.ValueType # 2
|
89
|
-
PLATFORM_LINUX: ChromeBuildProto.Platform.ValueType # 3
|
90
|
-
PLATFORM_CROS: ChromeBuildProto.Platform.ValueType # 4
|
91
|
-
PLATFORM_IOS: ChromeBuildProto.Platform.ValueType # 5
|
92
|
-
PLATFORM_ANDROID: ChromeBuildProto.Platform.ValueType # 6
|
93
|
-
"""Just a placeholder. Likely don't need it due to the presence of the
|
94
|
-
Android GCM on phone/tablet devices.
|
95
|
-
"""
|
96
|
-
|
97
|
-
class _Channel:
|
98
|
-
ValueType = typing.NewType("ValueType", builtins.int)
|
99
|
-
V: typing_extensions.TypeAlias = ValueType
|
100
|
-
|
101
|
-
class _ChannelEnumTypeWrapper(
|
102
|
-
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
|
103
|
-
ChromeBuildProto._Channel.ValueType
|
104
|
-
],
|
105
|
-
builtins.type,
|
106
|
-
):
|
107
|
-
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
108
|
-
CHANNEL_STABLE: ChromeBuildProto._Channel.ValueType # 1
|
109
|
-
CHANNEL_BETA: ChromeBuildProto._Channel.ValueType # 2
|
110
|
-
CHANNEL_DEV: ChromeBuildProto._Channel.ValueType # 3
|
111
|
-
CHANNEL_CANARY: ChromeBuildProto._Channel.ValueType # 4
|
112
|
-
CHANNEL_UNKNOWN: ChromeBuildProto._Channel.ValueType # 5
|
113
|
-
"""for tip of tree or custom builds"""
|
114
|
-
|
115
|
-
class Channel(_Channel, metaclass=_ChannelEnumTypeWrapper): ...
|
116
|
-
CHANNEL_STABLE: ChromeBuildProto.Channel.ValueType # 1
|
117
|
-
CHANNEL_BETA: ChromeBuildProto.Channel.ValueType # 2
|
118
|
-
CHANNEL_DEV: ChromeBuildProto.Channel.ValueType # 3
|
119
|
-
CHANNEL_CANARY: ChromeBuildProto.Channel.ValueType # 4
|
120
|
-
CHANNEL_UNKNOWN: ChromeBuildProto.Channel.ValueType # 5
|
121
|
-
"""for tip of tree or custom builds"""
|
122
|
-
|
123
|
-
PLATFORM_FIELD_NUMBER: builtins.int
|
124
|
-
CHROME_VERSION_FIELD_NUMBER: builtins.int
|
125
|
-
CHANNEL_FIELD_NUMBER: builtins.int
|
126
|
-
platform: global___ChromeBuildProto.Platform.ValueType
|
127
|
-
"""The platform of the device."""
|
128
|
-
chrome_version: builtins.str
|
129
|
-
"""The Chrome instance's version."""
|
130
|
-
channel: global___ChromeBuildProto.Channel.ValueType
|
131
|
-
"""The Channel (build type) of Chrome."""
|
132
|
-
def __init__(
|
133
|
-
self,
|
134
|
-
*,
|
135
|
-
platform: global___ChromeBuildProto.Platform.ValueType | None = ...,
|
136
|
-
chrome_version: builtins.str | None = ...,
|
137
|
-
channel: global___ChromeBuildProto.Channel.ValueType | None = ...,
|
138
|
-
) -> None: ...
|
139
|
-
def HasField(
|
140
|
-
self,
|
141
|
-
field_name: typing_extensions.Literal[
|
142
|
-
"channel",
|
143
|
-
b"channel",
|
144
|
-
"chrome_version",
|
145
|
-
b"chrome_version",
|
146
|
-
"platform",
|
147
|
-
b"platform",
|
148
|
-
],
|
149
|
-
) -> builtins.bool: ...
|
150
|
-
def ClearField(
|
151
|
-
self,
|
152
|
-
field_name: typing_extensions.Literal[
|
153
|
-
"channel",
|
154
|
-
b"channel",
|
155
|
-
"chrome_version",
|
156
|
-
b"chrome_version",
|
157
|
-
"platform",
|
158
|
-
b"platform",
|
159
|
-
],
|
160
|
-
) -> None: ...
|
161
|
-
|
162
|
-
global___ChromeBuildProto = ChromeBuildProto
|
163
|
-
|
164
|
-
@typing_extensions.final
|
165
|
-
class AndroidCheckinProto(google.protobuf.message.Message):
|
166
|
-
"""Information sent by the device in a "checkin" request."""
|
167
|
-
|
168
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
169
|
-
|
170
|
-
LAST_CHECKIN_MSEC_FIELD_NUMBER: builtins.int
|
171
|
-
CELL_OPERATOR_FIELD_NUMBER: builtins.int
|
172
|
-
SIM_OPERATOR_FIELD_NUMBER: builtins.int
|
173
|
-
ROAMING_FIELD_NUMBER: builtins.int
|
174
|
-
USER_NUMBER_FIELD_NUMBER: builtins.int
|
175
|
-
TYPE_FIELD_NUMBER: builtins.int
|
176
|
-
CHROME_BUILD_FIELD_NUMBER: builtins.int
|
177
|
-
last_checkin_msec: builtins.int
|
178
|
-
"""Miliseconds since the Unix epoch of the device's last successful checkin."""
|
179
|
-
cell_operator: builtins.str
|
180
|
-
"""The current MCC+MNC of the mobile device's current cell."""
|
181
|
-
sim_operator: builtins.str
|
182
|
-
"""The MCC+MNC of the SIM card (different from operator if the
|
183
|
-
device is roaming, for instance).
|
184
|
-
"""
|
185
|
-
roaming: builtins.str
|
186
|
-
"""The device's current roaming state (reported starting in eclair builds).
|
187
|
-
Currently one of "{,not}mobile-{,not}roaming", if it is present at all.
|
188
|
-
"""
|
189
|
-
user_number: builtins.int
|
190
|
-
"""For devices supporting multiple user profiles (which may be
|
191
|
-
supported starting in jellybean), the ordinal number of the
|
192
|
-
profile that is checking in. This is 0 for the primary profile
|
193
|
-
(which can't be changed without wiping the device), and 1,2,3,...
|
194
|
-
for additional profiles (which can be added and deleted freely).
|
195
|
-
"""
|
196
|
-
type: global___DeviceType.ValueType
|
197
|
-
"""Class of device. Indicates the type of build proto
|
198
|
-
(IosBuildProto/ChromeBuildProto/AndroidBuildProto)
|
199
|
-
That is included in this proto
|
200
|
-
"""
|
201
|
-
@property
|
202
|
-
def chrome_build(self) -> global___ChromeBuildProto:
|
203
|
-
"""For devices running MCS on Chrome, build-specific characteristics
|
204
|
-
of the browser. There are no hardware aspects (except for ChromeOS).
|
205
|
-
This will only be populated for Chrome builds/ChromeOS devices
|
206
|
-
"""
|
207
|
-
def __init__(
|
208
|
-
self,
|
209
|
-
*,
|
210
|
-
last_checkin_msec: builtins.int | None = ...,
|
211
|
-
cell_operator: builtins.str | None = ...,
|
212
|
-
sim_operator: builtins.str | None = ...,
|
213
|
-
roaming: builtins.str | None = ...,
|
214
|
-
user_number: builtins.int | None = ...,
|
215
|
-
type: global___DeviceType.ValueType | None = ...,
|
216
|
-
chrome_build: global___ChromeBuildProto | None = ...,
|
217
|
-
) -> None: ...
|
218
|
-
def HasField(
|
219
|
-
self,
|
220
|
-
field_name: typing_extensions.Literal[
|
221
|
-
"cell_operator",
|
222
|
-
b"cell_operator",
|
223
|
-
"chrome_build",
|
224
|
-
b"chrome_build",
|
225
|
-
"last_checkin_msec",
|
226
|
-
b"last_checkin_msec",
|
227
|
-
"roaming",
|
228
|
-
b"roaming",
|
229
|
-
"sim_operator",
|
230
|
-
b"sim_operator",
|
231
|
-
"type",
|
232
|
-
b"type",
|
233
|
-
"user_number",
|
234
|
-
b"user_number",
|
235
|
-
],
|
236
|
-
) -> builtins.bool: ...
|
237
|
-
def ClearField(
|
238
|
-
self,
|
239
|
-
field_name: typing_extensions.Literal[
|
240
|
-
"cell_operator",
|
241
|
-
b"cell_operator",
|
242
|
-
"chrome_build",
|
243
|
-
b"chrome_build",
|
244
|
-
"last_checkin_msec",
|
245
|
-
b"last_checkin_msec",
|
246
|
-
"roaming",
|
247
|
-
b"roaming",
|
248
|
-
"sim_operator",
|
249
|
-
b"sim_operator",
|
250
|
-
"type",
|
251
|
-
b"type",
|
252
|
-
"user_number",
|
253
|
-
b"user_number",
|
254
|
-
],
|
255
|
-
) -> None: ...
|
256
|
-
|
257
|
-
global___AndroidCheckinProto = AndroidCheckinProto
|
1
|
+
"""
|
2
|
+
@generated by mypy-protobuf. Do not edit manually!
|
3
|
+
isort:skip_file
|
4
|
+
Copyright 2014 The Chromium Authors. All rights reserved.
|
5
|
+
Use of this source code is governed by a BSD-style license that can be
|
6
|
+
found in the LICENSE file.
|
7
|
+
|
8
|
+
Logging information for Android "checkin" events (automatic, periodic
|
9
|
+
requests made by Android devices to the server).
|
10
|
+
"""
|
11
|
+
|
12
|
+
import builtins
|
13
|
+
import google.protobuf.descriptor
|
14
|
+
import google.protobuf.internal.enum_type_wrapper
|
15
|
+
import google.protobuf.message
|
16
|
+
import sys
|
17
|
+
import typing
|
18
|
+
|
19
|
+
if sys.version_info >= (3, 10):
|
20
|
+
import typing as typing_extensions
|
21
|
+
else:
|
22
|
+
import typing_extensions
|
23
|
+
|
24
|
+
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
25
|
+
|
26
|
+
class _DeviceType:
|
27
|
+
ValueType = typing.NewType("ValueType", builtins.int)
|
28
|
+
V: typing_extensions.TypeAlias = ValueType
|
29
|
+
|
30
|
+
class _DeviceTypeEnumTypeWrapper(
|
31
|
+
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DeviceType.ValueType],
|
32
|
+
builtins.type,
|
33
|
+
):
|
34
|
+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
35
|
+
DEVICE_ANDROID_OS: _DeviceType.ValueType # 1
|
36
|
+
"""Android Device"""
|
37
|
+
DEVICE_IOS_OS: _DeviceType.ValueType # 2
|
38
|
+
"""Apple IOS device"""
|
39
|
+
DEVICE_CHROME_BROWSER: _DeviceType.ValueType # 3
|
40
|
+
"""Chrome browser - Not Chrome OS. No hardware records."""
|
41
|
+
DEVICE_CHROME_OS: _DeviceType.ValueType # 4
|
42
|
+
"""Chrome OS"""
|
43
|
+
|
44
|
+
class DeviceType(_DeviceType, metaclass=_DeviceTypeEnumTypeWrapper):
|
45
|
+
"""enum values correspond to the type of device.
|
46
|
+
Used in the AndroidCheckinProto and Device proto.
|
47
|
+
"""
|
48
|
+
|
49
|
+
DEVICE_ANDROID_OS: DeviceType.ValueType # 1
|
50
|
+
"""Android Device"""
|
51
|
+
DEVICE_IOS_OS: DeviceType.ValueType # 2
|
52
|
+
"""Apple IOS device"""
|
53
|
+
DEVICE_CHROME_BROWSER: DeviceType.ValueType # 3
|
54
|
+
"""Chrome browser - Not Chrome OS. No hardware records."""
|
55
|
+
DEVICE_CHROME_OS: DeviceType.ValueType # 4
|
56
|
+
"""Chrome OS"""
|
57
|
+
global___DeviceType = DeviceType
|
58
|
+
|
59
|
+
@typing_extensions.final
|
60
|
+
class ChromeBuildProto(google.protobuf.message.Message):
|
61
|
+
"""Build characteristics unique to the Chrome browser, and Chrome OS"""
|
62
|
+
|
63
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
64
|
+
|
65
|
+
class _Platform:
|
66
|
+
ValueType = typing.NewType("ValueType", builtins.int)
|
67
|
+
V: typing_extensions.TypeAlias = ValueType
|
68
|
+
|
69
|
+
class _PlatformEnumTypeWrapper(
|
70
|
+
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
|
71
|
+
ChromeBuildProto._Platform.ValueType
|
72
|
+
],
|
73
|
+
builtins.type,
|
74
|
+
):
|
75
|
+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
76
|
+
PLATFORM_WIN: ChromeBuildProto._Platform.ValueType # 1
|
77
|
+
PLATFORM_MAC: ChromeBuildProto._Platform.ValueType # 2
|
78
|
+
PLATFORM_LINUX: ChromeBuildProto._Platform.ValueType # 3
|
79
|
+
PLATFORM_CROS: ChromeBuildProto._Platform.ValueType # 4
|
80
|
+
PLATFORM_IOS: ChromeBuildProto._Platform.ValueType # 5
|
81
|
+
PLATFORM_ANDROID: ChromeBuildProto._Platform.ValueType # 6
|
82
|
+
"""Just a placeholder. Likely don't need it due to the presence of the
|
83
|
+
Android GCM on phone/tablet devices.
|
84
|
+
"""
|
85
|
+
|
86
|
+
class Platform(_Platform, metaclass=_PlatformEnumTypeWrapper): ...
|
87
|
+
PLATFORM_WIN: ChromeBuildProto.Platform.ValueType # 1
|
88
|
+
PLATFORM_MAC: ChromeBuildProto.Platform.ValueType # 2
|
89
|
+
PLATFORM_LINUX: ChromeBuildProto.Platform.ValueType # 3
|
90
|
+
PLATFORM_CROS: ChromeBuildProto.Platform.ValueType # 4
|
91
|
+
PLATFORM_IOS: ChromeBuildProto.Platform.ValueType # 5
|
92
|
+
PLATFORM_ANDROID: ChromeBuildProto.Platform.ValueType # 6
|
93
|
+
"""Just a placeholder. Likely don't need it due to the presence of the
|
94
|
+
Android GCM on phone/tablet devices.
|
95
|
+
"""
|
96
|
+
|
97
|
+
class _Channel:
|
98
|
+
ValueType = typing.NewType("ValueType", builtins.int)
|
99
|
+
V: typing_extensions.TypeAlias = ValueType
|
100
|
+
|
101
|
+
class _ChannelEnumTypeWrapper(
|
102
|
+
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
|
103
|
+
ChromeBuildProto._Channel.ValueType
|
104
|
+
],
|
105
|
+
builtins.type,
|
106
|
+
):
|
107
|
+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
108
|
+
CHANNEL_STABLE: ChromeBuildProto._Channel.ValueType # 1
|
109
|
+
CHANNEL_BETA: ChromeBuildProto._Channel.ValueType # 2
|
110
|
+
CHANNEL_DEV: ChromeBuildProto._Channel.ValueType # 3
|
111
|
+
CHANNEL_CANARY: ChromeBuildProto._Channel.ValueType # 4
|
112
|
+
CHANNEL_UNKNOWN: ChromeBuildProto._Channel.ValueType # 5
|
113
|
+
"""for tip of tree or custom builds"""
|
114
|
+
|
115
|
+
class Channel(_Channel, metaclass=_ChannelEnumTypeWrapper): ...
|
116
|
+
CHANNEL_STABLE: ChromeBuildProto.Channel.ValueType # 1
|
117
|
+
CHANNEL_BETA: ChromeBuildProto.Channel.ValueType # 2
|
118
|
+
CHANNEL_DEV: ChromeBuildProto.Channel.ValueType # 3
|
119
|
+
CHANNEL_CANARY: ChromeBuildProto.Channel.ValueType # 4
|
120
|
+
CHANNEL_UNKNOWN: ChromeBuildProto.Channel.ValueType # 5
|
121
|
+
"""for tip of tree or custom builds"""
|
122
|
+
|
123
|
+
PLATFORM_FIELD_NUMBER: builtins.int
|
124
|
+
CHROME_VERSION_FIELD_NUMBER: builtins.int
|
125
|
+
CHANNEL_FIELD_NUMBER: builtins.int
|
126
|
+
platform: global___ChromeBuildProto.Platform.ValueType
|
127
|
+
"""The platform of the device."""
|
128
|
+
chrome_version: builtins.str
|
129
|
+
"""The Chrome instance's version."""
|
130
|
+
channel: global___ChromeBuildProto.Channel.ValueType
|
131
|
+
"""The Channel (build type) of Chrome."""
|
132
|
+
def __init__(
|
133
|
+
self,
|
134
|
+
*,
|
135
|
+
platform: global___ChromeBuildProto.Platform.ValueType | None = ...,
|
136
|
+
chrome_version: builtins.str | None = ...,
|
137
|
+
channel: global___ChromeBuildProto.Channel.ValueType | None = ...,
|
138
|
+
) -> None: ...
|
139
|
+
def HasField(
|
140
|
+
self,
|
141
|
+
field_name: typing_extensions.Literal[
|
142
|
+
"channel",
|
143
|
+
b"channel",
|
144
|
+
"chrome_version",
|
145
|
+
b"chrome_version",
|
146
|
+
"platform",
|
147
|
+
b"platform",
|
148
|
+
],
|
149
|
+
) -> builtins.bool: ...
|
150
|
+
def ClearField(
|
151
|
+
self,
|
152
|
+
field_name: typing_extensions.Literal[
|
153
|
+
"channel",
|
154
|
+
b"channel",
|
155
|
+
"chrome_version",
|
156
|
+
b"chrome_version",
|
157
|
+
"platform",
|
158
|
+
b"platform",
|
159
|
+
],
|
160
|
+
) -> None: ...
|
161
|
+
|
162
|
+
global___ChromeBuildProto = ChromeBuildProto
|
163
|
+
|
164
|
+
@typing_extensions.final
|
165
|
+
class AndroidCheckinProto(google.protobuf.message.Message):
|
166
|
+
"""Information sent by the device in a "checkin" request."""
|
167
|
+
|
168
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
169
|
+
|
170
|
+
LAST_CHECKIN_MSEC_FIELD_NUMBER: builtins.int
|
171
|
+
CELL_OPERATOR_FIELD_NUMBER: builtins.int
|
172
|
+
SIM_OPERATOR_FIELD_NUMBER: builtins.int
|
173
|
+
ROAMING_FIELD_NUMBER: builtins.int
|
174
|
+
USER_NUMBER_FIELD_NUMBER: builtins.int
|
175
|
+
TYPE_FIELD_NUMBER: builtins.int
|
176
|
+
CHROME_BUILD_FIELD_NUMBER: builtins.int
|
177
|
+
last_checkin_msec: builtins.int
|
178
|
+
"""Miliseconds since the Unix epoch of the device's last successful checkin."""
|
179
|
+
cell_operator: builtins.str
|
180
|
+
"""The current MCC+MNC of the mobile device's current cell."""
|
181
|
+
sim_operator: builtins.str
|
182
|
+
"""The MCC+MNC of the SIM card (different from operator if the
|
183
|
+
device is roaming, for instance).
|
184
|
+
"""
|
185
|
+
roaming: builtins.str
|
186
|
+
"""The device's current roaming state (reported starting in eclair builds).
|
187
|
+
Currently one of "{,not}mobile-{,not}roaming", if it is present at all.
|
188
|
+
"""
|
189
|
+
user_number: builtins.int
|
190
|
+
"""For devices supporting multiple user profiles (which may be
|
191
|
+
supported starting in jellybean), the ordinal number of the
|
192
|
+
profile that is checking in. This is 0 for the primary profile
|
193
|
+
(which can't be changed without wiping the device), and 1,2,3,...
|
194
|
+
for additional profiles (which can be added and deleted freely).
|
195
|
+
"""
|
196
|
+
type: global___DeviceType.ValueType
|
197
|
+
"""Class of device. Indicates the type of build proto
|
198
|
+
(IosBuildProto/ChromeBuildProto/AndroidBuildProto)
|
199
|
+
That is included in this proto
|
200
|
+
"""
|
201
|
+
@property
|
202
|
+
def chrome_build(self) -> global___ChromeBuildProto:
|
203
|
+
"""For devices running MCS on Chrome, build-specific characteristics
|
204
|
+
of the browser. There are no hardware aspects (except for ChromeOS).
|
205
|
+
This will only be populated for Chrome builds/ChromeOS devices
|
206
|
+
"""
|
207
|
+
def __init__(
|
208
|
+
self,
|
209
|
+
*,
|
210
|
+
last_checkin_msec: builtins.int | None = ...,
|
211
|
+
cell_operator: builtins.str | None = ...,
|
212
|
+
sim_operator: builtins.str | None = ...,
|
213
|
+
roaming: builtins.str | None = ...,
|
214
|
+
user_number: builtins.int | None = ...,
|
215
|
+
type: global___DeviceType.ValueType | None = ...,
|
216
|
+
chrome_build: global___ChromeBuildProto | None = ...,
|
217
|
+
) -> None: ...
|
218
|
+
def HasField(
|
219
|
+
self,
|
220
|
+
field_name: typing_extensions.Literal[
|
221
|
+
"cell_operator",
|
222
|
+
b"cell_operator",
|
223
|
+
"chrome_build",
|
224
|
+
b"chrome_build",
|
225
|
+
"last_checkin_msec",
|
226
|
+
b"last_checkin_msec",
|
227
|
+
"roaming",
|
228
|
+
b"roaming",
|
229
|
+
"sim_operator",
|
230
|
+
b"sim_operator",
|
231
|
+
"type",
|
232
|
+
b"type",
|
233
|
+
"user_number",
|
234
|
+
b"user_number",
|
235
|
+
],
|
236
|
+
) -> builtins.bool: ...
|
237
|
+
def ClearField(
|
238
|
+
self,
|
239
|
+
field_name: typing_extensions.Literal[
|
240
|
+
"cell_operator",
|
241
|
+
b"cell_operator",
|
242
|
+
"chrome_build",
|
243
|
+
b"chrome_build",
|
244
|
+
"last_checkin_msec",
|
245
|
+
b"last_checkin_msec",
|
246
|
+
"roaming",
|
247
|
+
b"roaming",
|
248
|
+
"sim_operator",
|
249
|
+
b"sim_operator",
|
250
|
+
"type",
|
251
|
+
b"type",
|
252
|
+
"user_number",
|
253
|
+
b"user_number",
|
254
|
+
],
|
255
|
+
) -> None: ...
|
256
|
+
|
257
|
+
global___AndroidCheckinProto = AndroidCheckinProto
|
@@ -45,8 +45,8 @@ from .mcs_pb2 import ( # pylint: disable=no-name-in-module
|
|
45
45
|
|
46
46
|
_logger = logging.getLogger(__name__)
|
47
47
|
|
48
|
-
OnNotificationCallable = Callable[[
|
49
|
-
CredentialsUpdatedCallable = Callable[[dict[str, Any]], None]
|
48
|
+
OnNotificationCallable = Callable[[Any, str, Any], None]
|
49
|
+
CredentialsUpdatedCallable = Callable[[dict[str, Any], str], None]
|
50
50
|
|
51
51
|
# MCS Message Types and Tags
|
52
52
|
MCS_MESSAGE_TAG = {
|
@@ -144,10 +144,10 @@ class FcmPushClient: # pylint:disable=too-many-instance-attributes
|
|
144
144
|
|
145
145
|
def __init__(
|
146
146
|
self,
|
147
|
-
callback:
|
147
|
+
callback: OnNotificationCallable,
|
148
148
|
fcm_config: FcmRegisterConfig,
|
149
|
-
credentials: dict
|
150
|
-
credentials_updated_callback
|
149
|
+
credentials: dict,
|
150
|
+
credentials_updated_callback, #: CredentialsUpdatedCallable,
|
151
151
|
*,
|
152
152
|
callback_context: object | None = None,
|
153
153
|
received_persistent_ids: list[str] | None = None,
|
@@ -451,7 +451,8 @@ class FcmPushClient: # pylint:disable=too-many-instance-attributes
|
|
451
451
|
"Decrypted data for message %s is: %s", msg.persistent_id, ret_val
|
452
452
|
)
|
453
453
|
try:
|
454
|
-
|
454
|
+
if True: #self.callback!= None:
|
455
|
+
await self.callback(ret_val, msg.persistent_id, self.callback_context)
|
455
456
|
self._reset_error_count(ErrorType.NOTIFY)
|
456
457
|
except Exception:
|
457
458
|
_logger.exception("Unexpected exception calling notification callback\n")
|
@@ -611,7 +612,7 @@ class FcmPushClient: # pylint:disable=too-many-instance-attributes
|
|
611
612
|
self._send_selective_ack(msg.persistent_id),
|
612
613
|
return_exceptions=True
|
613
614
|
)
|
614
|
-
self.persistent_ids.append(msg.persistent_id)
|
615
|
+
self.persistent_ids.append(msg.persistent_id)
|
615
616
|
else:
|
616
617
|
await self._handle_data_message(msg)
|
617
618
|
self.persistent_ids.append(msg.persistent_id)
|
@@ -63,8 +63,8 @@ class FcmRegister:
|
|
63
63
|
def __init__(
|
64
64
|
self,
|
65
65
|
config: FcmRegisterConfig,
|
66
|
-
credentials: dict
|
67
|
-
credentials_updated_callback
|
66
|
+
credentials: dict,
|
67
|
+
credentials_updated_callback, #: Callable[[dict[str, Any], str], None] ,
|
68
68
|
*,
|
69
69
|
http_client_session: ClientSession | None = None,
|
70
70
|
log_debug_verbose: bool = False,
|
@@ -456,7 +456,7 @@ class FcmRegister:
|
|
456
456
|
return self.credentials
|
457
457
|
|
458
458
|
self.credentials = await self.register()
|
459
|
-
if self.credentials_updated_callback:
|
459
|
+
if True: #self.credentials_updated_callback != None:
|
460
460
|
await self.credentials_updated_callback(self.credentials, fcmCredentialsFileName)
|
461
461
|
|
462
462
|
return self.credentials
|
pycupra/utilities.py
CHANGED
@@ -12,30 +12,6 @@ import re
|
|
12
12
|
_LOGGER = logging.getLogger(__name__)
|
13
13
|
|
14
14
|
|
15
|
-
def read_config():
|
16
|
-
"""Read config from file."""
|
17
|
-
for directory, filename in product(
|
18
|
-
[
|
19
|
-
dirname(argv[0]),
|
20
|
-
expanduser("~"),
|
21
|
-
env.get("XDG_CONFIG_HOME", join(expanduser("~"), ".config")),
|
22
|
-
],
|
23
|
-
["seat.conf", ".seat.conf"],
|
24
|
-
):
|
25
|
-
try:
|
26
|
-
config = join(directory, filename)
|
27
|
-
_LOGGER.debug("checking for config file %s", config)
|
28
|
-
with open(config) as config:
|
29
|
-
return dict(
|
30
|
-
x.split(": ")
|
31
|
-
for x in config.read().strip().splitlines()
|
32
|
-
if not x.startswith("#")
|
33
|
-
)
|
34
|
-
except (IOError, OSError):
|
35
|
-
continue
|
36
|
-
return {}
|
37
|
-
|
38
|
-
|
39
15
|
def json_loads(s):
|
40
16
|
return json.loads(s, object_hook=obj_parser)
|
41
17
|
|
@@ -86,7 +62,7 @@ def find_path(src, path):
|
|
86
62
|
return find_path(src[path[0]], path[1:])
|
87
63
|
|
88
64
|
|
89
|
-
def is_valid_path(src, path):
|
65
|
+
def is_valid_path(src, path) -> bool:
|
90
66
|
"""
|
91
67
|
>>> is_valid_path(dict(a=1), 'a')
|
92
68
|
True
|
@@ -107,7 +83,7 @@ def is_valid_path(src, path):
|
|
107
83
|
return False
|
108
84
|
|
109
85
|
|
110
|
-
def camel2slug(s):
|
86
|
+
def camel2slug(s) -> str:
|
111
87
|
"""Convert camelCase to camel_case.
|
112
88
|
|
113
89
|
>>> camel2slug('fooBar')
|