Beispiel #1
0
    def __init__(self, value: Any = None, id: Optional[UID] = None):
        if value is None:
            value = ""

        UserString.__init__(self, value)

        self._id: UID = id if id else UID()
Beispiel #2
0
 def __init__(self,
              docstring=DEFAULTS['docstring'],
              options=DEFAULTS['options'],
              default=DEFAULTS['default'],
              optional=DEFAULTS['optional'],
              values=DEFAULTS['values'],
              category=DEFAULTS['category'],
              callback=DEFAULTS['callback'],
              synopsis=DEFAULTS['synopsis'],
              environ=DEFAULTS['environ'],
              registry=DEFAULTS['registry'],
              mandatory=None,
              name=DEFAULTS['name'],
              source=DEFAULTS['source']):
     UserString.__init__(self, '')
     GenericOption.initialize(self, locals())
     self.data = self.data or ''
Beispiel #3
0
    def __init__(self, mimeType):
        UserString.__init__(self, mimeType)
        self._type = None
        self._subtype = None
        self._structure = None

        slashIndex = mimeType.find('/')
        if (-1 < slashIndex):
            self._type = mimeType[:slashIndex]
            mimeType = mimeType[slashIndex + 1:]
            plusIndex = mimeType.find('+')
            if (-1 < plusIndex):
                self._subtype = mimeType[:plusIndex]
                self._structure = mimeType[plusIndex + 1:]
            else:
                self._structure = mimeType
        else:
            self._type = mimeType
Beispiel #4
0
 def __init__(self):
     UserString.__init__(self, '')
Beispiel #5
0
 def __init__(self, value):
     value = value[1::]
     UserString.__init__(self, value)
Beispiel #6
0
 def __init__(self, value):
     UserString.__init__(self, value)
Beispiel #7
0
 def __init__(self, code_str):
     UserString.__init__(self, re.sub(r"(\s|[-_])", "", code_str).upper())
Beispiel #8
0
 def __init__(self, path: str, external: bool = True, protocol: str = ""):
     self.path = path
     self.external = external
     # Strip :// if the user mistakenly included it in the argument
     self.protocol = protocol.rstrip("://")
     UserString.__init__(self, path)
Beispiel #9
0
 def __init__(self, *args, **kwargs):
     self.forced_encoding = kwargs.pop('force_encoding', None)
     UserString.__init__(self, *args, **kwargs)