Add replace_item with function, remove os import

This commit is contained in:
ZyX 2013-03-31 00:02:53 +04:00
parent 26412c3aff
commit c2ceac093f
1 changed files with 4 additions and 1 deletions

View File

@ -1,7 +1,6 @@
# vim:fileencoding=utf-8:noet
import imp
import sys
import os
class Pl(object):
@ -125,6 +124,10 @@ class ItemReplace(object):
self.d[self.key] = self.old
def replace_item(d, key, new):
return ItemReplace(d, key, new, d)
def replace_env(key, new, environ=None, **kwargs):
r = kwargs.copy()
r['environ'] = environ or {}