-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChanges.py
More file actions
279 lines (190 loc) · 5.49 KB
/
Copy pathChanges.py
File metadata and controls
279 lines (190 loc) · 5.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# Any module which is supposed to be called from this module
# needs to implement call functions for specific types they are working on
from typing import Any
_shooters_subscribers = []
_disciplines_subscribers = []
_programs_subscribers = []
_targets_subscribers = []
_competitions_subscribers = []
_reminders_subscribers = []
_date_subscribers = []
_weapons_subscribers = []
_air_cylinders_subscribers = []
_shooters = False
_disciplines = False
_programs = False
_targets = False
_competitions = False
_reminders = False
_date = False
_weapons = False
_air_cylinders = False
def subscribe_to_air_cylinders(_object: Any):
_air_cylinders_subscribers.append(_object)
def subscribe_to_date(_object: Any):
_date_subscribers.append(_object)
def subscribe_to_reminders(_object: Any):
_reminders_subscribers.append(_object)
def subscribe_to_targets(_object: Any):
_targets_subscribers.append(_object)
def subscribe_to_programs(_object: Any):
_programs_subscribers.append(_object)
def subscribe_to_disciplines(_object: Any):
_disciplines_subscribers.append(_object)
def subscribe_to_shooters(_object: Any):
_shooters_subscribers.append(_object)
def subscribe_to_competitions(_object: Any):
_competitions_subscribers.append(_object)
def subscribe_to_weapons(_object: Any):
_weapons_subscribers.append(_object)
def _unsubscribe_from_air_cylinders(_object: Any):
try:
_air_cylinders_subscribers.remove(_object)
except ValueError:
pass
def _unsubscribe_from_weapons(_object: Any):
try:
_weapons_subscribers.remove(_object)
except ValueError:
pass
def _unsubscribe_from_date(_object: Any):
try:
_date_subscribers.remove(_object)
except ValueError:
pass
def _unsubscribe_from_reminders(_object: Any):
try:
_reminders_subscribers.remove(_object)
except ValueError:
pass
def unsubscribe_to_shooters(_object: Any):
try:
_shooters_subscribers.remove(_object)
except ValueError:
pass
def unsubscribe_to_programs(_object: Any):
try:
_programs_subscribers.remove(_object)
except ValueError:
pass
def unsubscribe_to_disciplines(_object: Any):
try:
_disciplines_subscribers.remove(_object)
except ValueError:
pass
def unsubscibe_to_targets(_object: Any):
try:
_targets_subscribers.remove(_object)
except ValueError:
pass
def unsubscribe_to_competitions(_object: Any):
try:
_competitions_subscribers.remove(_object)
except ValueError:
pass
def call_refresh_air_cylinders():
for o in _air_cylinders_subscribers:
try:
o.update_air_cylinders()
except Exception:
pass
def call_refresh_date():
for o in _date_subscribers:
try:
o.update_date()
except Exception:
pass
def call_refresh_reminders():
for o in _reminders_subscribers:
try:
o.update_reminders()
except Exception:
pass
def call_refresh_shooters():
for o in _shooters_subscribers:
try:
o.update_shooters()
except Exception:
pass
def call_refresh_programs():
for o in _programs_subscribers:
try:
o.update_programs()
except Exception:
pass
def call_refresh_disciplines():
for o in _disciplines_subscribers:
try:
o.update_disciplines()
except Exception:
pass
def call_refresh_targets():
for o in _targets_subscribers:
try:
o.update_targets()
except Exception:
pass
def call_refresh_competitions():
for o in _competitions_subscribers:
try:
o.update_competitions()
except Exception:
pass
def call_refresh_weapons():
for o in _weapons_subscribers:
try:
o.update_weapons()
except Exception:
pass
def set_air_cylinders(updated: bool = True):
if isinstance(updated, bool):
global _air_cylinders
_air_cylinders = updated
def set_date(updated: bool = True):
if isinstance(updated, bool):
global _date
_date = updated
def set_reminders(updated: bool = True):
if isinstance(updated, bool):
global _reminders
_reminders = updated
def set_shooters(updated: bool = True):
if isinstance(updated, bool):
global _shooters
_shooters = updated
def set_programs(updated: bool = True):
if isinstance(updated, bool):
global _programs
_programs = updated
def set_disciplines(updated: bool = True):
if isinstance(updated, bool):
global _disciplines
_disciplines = updated
def set_targets(updated: bool = True):
if isinstance(updated, bool):
global _targets
_targets = updated
def set_competitions(updated: bool = True):
if isinstance(updated, bool):
global _competitions
_competitions = updated
def set_weapons(updated: bool = True):
if isinstance(updated, bool):
global _weapons
_weapons = updated
def get_air_cylinders_update():
return _air_cylinders
def get_weapons_update():
return _weapons
def get_date_update():
return _date
def get_shooters_update():
return _shooters
def get_targets_update():
return _targets
def get_programs_update():
return _programs
def get_disciplines_update():
return _disciplines
def get_competitions_update():
return _competitions