Bläddra i källkod

auto commit

master
jfinn 2 år sedan
förälder
incheckning
7b0fb6b2db
1 ändrade filer med 23 tillägg och 4 borttagningar
  1. 23
    4
      wsps/tasks_loop.py

+ 23
- 4
wsps/tasks_loop.py Visa fil

106
 	async def ws_conn0(self):
106
 	async def ws_conn0(self):
107
 		glob_cl.run_persistent_loop(self)
107
 		glob_cl.run_persistent_loop(self)
108
 		print("++++++++++++++++++++++++++")
108
 		print("++++++++++++++++++++++++++")
109
-		# oinfo(glob_cl)
110
 	async def ws_conn_once(self,*a,**kw):
109
 	async def ws_conn_once(self,*a,**kw):
111
 		print("\t\tws_conn_once:","AclTaskMixin")
110
 		print("\t\tws_conn_once:","AclTaskMixin")
112
 
111
 
200
 class RldMan():
199
 class RldMan():
201
 	def __init__(self,*a,**kw):
200
 	def __init__(self,*a,**kw):
202
 		self.files = {}
201
 		self.files = {}
202
+		z="ABC"
203
+		self.scopes = {
204
+		"dflt_scope":{"globals":globals(),"locals":locals()}
205
+		"dflt_scope_zloc":{"globals":globals(),"locals":{}}
206
+		"dflt_scope_gscope":{"globals":globals(),"locals":{}}
207
+		"dflt_scope_copy": {"globals":copy.copy(globals()),"locals":copy.copy(locals())}
208
+		# "dflt_scope":{"globals":globals(),"locals":{}}
209
+		}
210
+		self.scopes['current_scope'] = self.scopes['dflt_scope_zloc']
211
+		self.scope_opt = ""
203
 		self.print_tb = 0
212
 		self.print_tb = 0
204
-		self.dflt_scope = {"globals":globals(),"locals":locals()}
205
-		self.dflt_scope2 = {"globals":copy.copy(globals()),"locals":copy.copy(locals())}
213
+		# self.dflt_scope = {"globals":globals(),"locals":locals()}
214
+		# self.dflt_scope2 = {"globals":copy.copy(globals()),"locals":copy.copy(locals())}
206
 
215
 
207
 		base_path = "/usr/games/repos/ign4/py_rld/djc/rdir1/"
216
 		base_path = "/usr/games/repos/ign4/py_rld/djc/rdir1/"
208
 
217
 
241
 				p("add files???",file)
250
 				p("add files???",file)
242
 	def add_file(self,file_name,fnx={}):
251
 	def add_file(self,file_name,fnx={}):
243
 		self.files[file_name] = {"ftxt":"",**fnx}
252
 		self.files[file_name] = {"ftxt":"",**fnx}
253
+	def get_scope(self,rfile_obj,file_name):
254
+		return {
255
+		"scope":self.scopes["current_scope"],
256
+		}
257
+
258
+
259
+		# rfile_obj.get("scope")
260
+		# if 
244
 	def rld_file(self,file_name,ret= {"errs":{},"all":{},"alle":{},},**kw):
261
 	def rld_file(self,file_name,ret= {"errs":{},"all":{},"alle":{},},**kw):
245
 		if file_name in self.files:
262
 		if file_name in self.files:
246
 			rfile_obj = self.files[file_name]
263
 			rfile_obj = self.files[file_name]
255
 				try:
272
 				try:
256
 					f = open(file_name,"r")
273
 					f = open(file_name,"r")
257
 					ftxt = f.read()
274
 					ftxt = f.read()
258
-					scope_key = rfile_obj.get("scope")
275
+					# scope_key = rfile_obj.get("scope")
259
 					p(scope_key,rfile_obj)
276
 					p(scope_key,rfile_obj)
260
 					f.close()
277
 					f.close()
278
+					scope_obj = self.get_scope(file_name,rfile_obj)
279
+					if self.scope_opt
261
 					exec(ftxt)
280
 					exec(ftxt)
262
 
281
 
263
 				except Exception as e:
282
 				except Exception as e:

Laddar…
Avbryt
Spara