コード例 #1
0
ファイル: __init__.py プロジェクト: aszeszo/test
def internalizestr(string, basedirs=None, load_data=True):
        """Create an action instance based on a sequence of strings.
        This function also translates external representations of actions with
        payloads (like file and license which can use NOHASH or file paths to
        point to the payload) to an internal representation which sets the
        data field of the action returned.

        In general, each string should be in the form of "key=value". The
        exception is a payload for certain actions which should be the first
        item in the sequence.

        Raises MalformedActionError if the attribute strings are malformed.
        """

        action = fromstr(string)

        if action.name not in ("file", "license") or not load_data:
                return action, None, None

        local_path, used_basedir = set_action_data(action.hash, action,
            basedirs=basedirs)
        return action, local_path, used_basedir
コード例 #2
0
ファイル: __init__.py プロジェクト: fatman2021/pkg5
def internalizestr(string, basedirs=None, load_data=True):
    """Create an action instance based on a sequence of strings.
        This function also translates external representations of actions with
        payloads (like file and license which can use NOHASH or file paths to
        point to the payload) to an internal representation which sets the
        data field of the action returned.

        In general, each string should be in the form of "key=value". The
        exception is a payload for certain actions which should be the first
        item in the sequence.

        Raises MalformedActionError if the attribute strings are malformed.
        """

    action = fromstr(string)

    if action.name not in ("file", "license") or not load_data:
        return action, None, None

    local_path, used_basedir = set_action_data(action.hash,
                                               action,
                                               basedirs=basedirs)
    return action, local_path, used_basedir
コード例 #3
0
ファイル: __init__.py プロジェクト: aszeszo/test
def attrsfromstr(string):
        """Create an attribute dict given a string w/ key=value pairs.

        Raises MalformedActionError if the attributes have syntactic problems.
        """
        return fromstr("unknown %s" % string).attrs
コード例 #4
0
ファイル: __init__.py プロジェクト: fatman2021/pkg5
def attrsfromstr(string):
    """Create an attribute dict given a string w/ key=value pairs.

        Raises MalformedActionError if the attributes have syntactic problems.
        """
    return fromstr("unknown {0}".format(string)).attrs