コード例 #1
0
ファイル: skel.py プロジェクト: geaaru/molecule-core
 def _command_splitter(self, string):
     """
     Split a command string into list using shlex.
     """
     x_str = string
     if not is_python3():
         x_str = convert_to_rawstring(x_str)
     return [convert_to_unicode(y) for y in shlex.split(x_str)]
コード例 #2
0
ファイル: skel.py プロジェクト: Sabayon-Labs/molecule-core
 def _command_splitter(self, string):
     """
     Split a command string into list using shlex.
     """
     x_str = string
     if not is_python3():
         x_str = convert_to_rawstring(x_str)
     return [convert_to_unicode(y) for y in shlex.split(x_str)]
コード例 #3
0
ファイル: utils.py プロジェクト: Sabayon-Labs/molecule-core
def md5sum(filepath):
    """
    Calcuate md5 hash of given file path.
    """
    import hashlib
    m = hashlib.md5()
    readfile = open(filepath, "rb")
    block = readfile.read(1024)
    while block:
        m.update(convert_to_rawstring(block))
        block = readfile.read(1024)
    readfile.close()
    return m.hexdigest()
コード例 #4
0
def md5sum(filepath):
    """
    Calcuate md5 hash of given file path.
    """
    import hashlib
    m = hashlib.md5()
    readfile = open(filepath, "rb")
    block = readfile.read(1024)
    while block:
        m.update(convert_to_rawstring(block))
        block = readfile.read(1024)
    readfile.close()
    return m.hexdigest()