Add qubes.utils.random_string()

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-07-12 18:42:06 +02:00
父節點 c559ffdeab
當前提交 f90d86fe13
沒有發現已知的金鑰在資料庫的簽署中
GPG Key ID: 96ED3C3BA19C3DEE

查看文件

@ -25,6 +25,8 @@
#
import hashlib
import random
import string
import os
import re
import subprocess
@ -158,3 +160,9 @@ def get_entry_point_one(group, name):
', '.join('{}.{}'.format(ep.module_name, '.'.join(ep.attrs))
for ep in epoints)))
return epoints[0].load()
def random_string(length=5):
''' Return random string consisting of ascii_leters and digits '''
return ''.join(random.choice(string.ascii_letters + string.digits)
for _ in range(length))