Commit e8e9a565 authored by Jason R. Coombs's avatar Jason R. Coombs

More succinctly implement declare_state.

parent 69eb2865
...@@ -90,10 +90,8 @@ def _bypass_ensure_directory(name, mode=0x1FF): # 0777 ...@@ -90,10 +90,8 @@ def _bypass_ensure_directory(name, mode=0x1FF): # 0777
_state_vars = {} _state_vars = {}
def _declare_state(vartype, **kw): def _declare_state(vartype, **kw):
g = globals() globals().update(kw)
for name, val in kw.items(): _state_vars.update(dict.from_keys(kw, vartype))
g[name] = val
_state_vars[name] = vartype
def __getstate__(): def __getstate__():
state = {} state = {}
...@@ -2339,6 +2337,8 @@ class Distribution(object): ...@@ -2339,6 +2337,8 @@ class Distribution(object):
def insert_on(self, path, loc = None): def insert_on(self, path, loc = None):
"""Insert self.location in path before its nearest parent directory""" """Insert self.location in path before its nearest parent directory"""
if 'foo' in path:
import pdb; pdb.set_trace()
loc = loc or self.location loc = loc or self.location
if not loc: if not loc:
return return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment