mirror of
https://github.com/powerline/powerline.git
synced 2025-07-05 21:14:55 +02:00
Add replace_item with function, remove os import
This commit is contained in:
parent
26412c3aff
commit
c2ceac093f
@ -1,7 +1,6 @@
|
|||||||
# vim:fileencoding=utf-8:noet
|
# vim:fileencoding=utf-8:noet
|
||||||
import imp
|
import imp
|
||||||
import sys
|
import sys
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
class Pl(object):
|
class Pl(object):
|
||||||
@ -125,6 +124,10 @@ class ItemReplace(object):
|
|||||||
self.d[self.key] = self.old
|
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):
|
def replace_env(key, new, environ=None, **kwargs):
|
||||||
r = kwargs.copy()
|
r = kwargs.copy()
|
||||||
r['environ'] = environ or {}
|
r['environ'] = environ or {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user