]> git.ipfire.org Git - pakfire.git/blobdiff - pakfire/util.py
Try to design a better API.
[pakfire.git] / pakfire / util.py
index 220558724f7b49c676d3563c2c941d1dd0db111d..5f52697825632fc4b7cd9027e5fcc30f8809a30d 100644 (file)
@@ -28,6 +28,14 @@ def cli_is_interactive():
 
        return False
 
+def random_string(length=20):
+       s = ""
+
+       for i in range(length):
+               s += random.choice(string.letters)
+
+       return s
+
 def make_progress(message, maxval):
        # Return nothing if stdout is not a terminal.
        if not sys.stdout.isatty():