Permalink
Browse files

Update builder/util.py

Remove more functions not used...
  • Loading branch information...
1 parent 9a4177d commit 9b3806701471c20fd86f4b9dab8e4a1a4b235517 Joshua Harlow committed Sep 13, 2012
Showing with 0 additions and 35 deletions.
  1. +0 −35 builder/util.py
View
@@ -216,15 +216,6 @@ def progress_cb(tran_byte_am, chunk):
pbar.finish()
-def system_info():
- return {
- 'platform': platform.platform(),
- 'release': platform.release(),
- 'python': platform.python_version(),
- 'uname': platform.uname(),
- }
-
-
def make_url(scheme, host, port=None,
path='', params='', query='', fragment=''):
@@ -266,14 +257,6 @@ def chdir(ndir):
os.chdir(curr)
-@contextlib.contextmanager
-def umask(n_msk):
- old = os.umask(n_msk)
- try:
- yield old
- finally:
- os.umask(old)
-
@contextlib.contextmanager
def tempdir(**kwargs):
@@ -325,22 +308,6 @@ def pipe_in_out(in_fh, out_fh, chunk_size=1024, chunk_cb=None):
return bytes_piped
-def chownbyid(fname, uid=None, gid=None):
- if uid is None and gid is None:
- return
- os.chown(fname, uid, gid)
-
-
-def chownbyname(fname, user=None, group=None):
- uid = -1
- gid = -1
- if user:
- uid = pwd.getpwnam(user).pw_uid
- if group:
- gid = grp.getgrnam(group).gr_gid
- chownbyid(fname, uid, gid)
-
-
def print_iterable(to_log, header=None, do_color=True):
if not to_log:
return
@@ -358,7 +325,6 @@ def hash_blob(blob, routine, mlen=None):
hasher = hashlib.new(routine)
hasher.update(blob)
digest = hasher.hexdigest()
- # Don't get to long now
if mlen is not None:
return digest[0:mlen]
else:
@@ -378,7 +344,6 @@ def load_yaml(blob, allowed=(dict,)):
blob = str(blob)
converted = yaml.safe_load(blob)
if not isinstance(converted, allowed):
- # Yes this will just be caught, but thats ok for now...
raise TypeError(("Yaml load allows %s root types,"
" but got %s instead") %
(allowed, obj_name(converted)))

0 comments on commit 9b38067

Please sign in to comment.