コード例 #1
0
    def __init__(self, category, document):
        ''' creates a URI

        Args:
            category(URI/str/URIType): The MIMEType of the URI
            document(str): the associated document identifier

        >>> from task_types import TaskTypes as tt
        >>> tt.URI('image/png', '1be6a01e-d133-11e3-ae3c-b8ca3a8b13f6')
        URI(category='image/png', document='1be6a01e-d133-11e3-ae3c-b8ca3a8b13f6')

        '''

        super(URI, self) .__init__()
        if isinstance(category, URIType):
            self.category = mt.get_mimetype(category.category)
        elif isinstance(category, mt.MIMEType):
            self.category = category
        else:
            self.category = mt.get_mimetype(category)
        self.document = document
コード例 #2
0
    def __init__(self, category, document):
        ''' creates a URI

        Args:
            category(URI/str/URIType): The MIMEType of the URI
            document(str): the associated document identifier

        >>> from task_types import TaskTypes as tt
        >>> tt.URI('image/png', '1be6a01e-d133-11e3-ae3c-b8ca3a8b13f6')
        URI(category='image/png', document='1be6a01e-d133-11e3-ae3c-b8ca3a8b13f6')

        '''

        super(URI, self).__init__()
        if isinstance(category, URIType):
            self.category = mt.get_mimetype(category.category)
        elif isinstance(category, mt.MIMEType):
            self.category = category
        else:
            self.category = mt.get_mimetype(category)
        self.document = document
コード例 #3
0
    def __init__(self, category, **kwargs):
        '''Init a URIType

        Args:
            category(URI/str/URIType): The MIMEType of the URI

        >>> from task_types import TaskTypes as tt
        >>> tt.URIType('image/png')
        URIType(category='image/png')

        '''
        self.category = mt.get_mimetype(category)
        super(URIType, self) .__init__(**kwargs)
コード例 #4
0
    def __init__(self, category, **kwargs):
        '''Init a URIType

        Args:
            category(URI/str/URIType): The MIMEType of the URI

        >>> from task_types import TaskTypes as tt
        >>> tt.URIType('image/png')
        URIType(category='image/png')

        '''
        self.category = mt.get_mimetype(category)
        super(URIType, self).__init__(**kwargs)