]> TLD Linux GIT Repositories - tld-builder.git/blobdiff - TLD_Builder/util.py
- drop util.sendfile, use shutil.copyfileobj instead
[tld-builder.git] / TLD_Builder / util.py
index b6bcc2460ff2053fc5494f72e3c6215b6efcbc78..af6b8f12bd2e8ca3022a2215f4b1cd19bac7e3e2 100644 (file)
@@ -32,15 +32,6 @@ def pkg_name(nvr):
 def msg(m):
     sys.stderr.write(m)
 
-def sendfile(src, dst):
-    cnt = 0
-    while 1:
-        s = src.read(10000)
-        if s == "" or s == b"": break
-        cnt += len(s)
-        dst.write(s)
-    return cnt
-
 def append_to(log, msg):
     f = open(log, "a")
     f.write("%s\n" % msg)
@@ -112,3 +103,6 @@ def to_str(s):
         return s
     else:
         raise TypeError("Expected bytes or string, but got %s." % type(s))
+
+def cmp(a, b):
+    return (a > b) - (a < b)