AllenYkl commited on
Commit
0057566
1 Parent(s): 96acdb9

Upload shared.py

Browse files
Files changed (1) hide show
  1. bin_public/utils/shared.py +24 -0
bin_public/utils/shared.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from bin_public.config.presets import API_URL
2
+
3
+ class State:
4
+ interrupted = False
5
+ api_url = API_URL
6
+
7
+ def interrupt(self):
8
+ self.interrupted = True
9
+
10
+ def recover(self):
11
+ self.interrupted = False
12
+
13
+ def set_api_url(self, api_url):
14
+ self.api_url = api_url
15
+
16
+ def reset_api_url(self):
17
+ self.api_url = API_URL
18
+ return self.api_url
19
+
20
+ def reset_all(self):
21
+ self.interrupted = False
22
+ self.api_url = API_URL
23
+
24
+ state = State()