Exemplo n.º 1
0
    def __check_api_verion(self, value):
        try:
            response = ApiVersion(self.config, value).request()
        except RequestException as err:
            raise ValueError(str(err))

        if not Api.is_minimum_version(response):
            raise ValueError(
                    f"Your wallabag instance is too old. \
                            You need at least version \
                            {MINIMUM_API_VERSION}.")
Exemplo n.º 2
0
    def _run(self):
        if not self.config.is_valid():
            return False, "The config is missing or incomplete."

        try:
            response = ApiVersion(self.config).request()
        except RequestException:
            return False, "The server or the API is not reachable."

        if not Api.is_minimum_version(response):
            return False, "The version of the wallabag instance is too old."

        ApiToken(self.config).request()

        return True, "The config is suitable."
 def __init__(self, config, anno_id):
     Api.__init__(self, config)
     self.anno_id = anno_id
Exemplo n.º 4
0
 def __init__(self, config, url):
     Api.__init__(self, config)
     self.url = url
Exemplo n.º 5
0
 def __init__(self, config, entry_id, tag):
     Api.__init__(self, config)
     self.entry_id = entry_id
     self.tag = tag
Exemplo n.º 6
0
 def __init__(self, config, entry_id):
     Api.__init__(self, config)
     self.entry_id = entry_id
Exemplo n.º 7
0
 def __init__(self, config):
     Api.__init__(self, config)
     self.skip_auth = True
 def __init__(self, config, tag_id):
     Api.__init__(self, config)
     self.tag_id = tag_id
Exemplo n.º 9
0
 def __init__(self, config, tags):
     Api.__init__(self, config)
     self.tags = tags
Exemplo n.º 10
0
 def __init__(self, config, custom_url=None):
     Api.__init__(self, config)
     self.custom_url = custom_url
     self.skip_auth = True
Exemplo n.º 11
0
 def __init__(self, config, params):
     Api.__init__(self, config)
     self.params = params
Exemplo n.º 12
0
 def __init__(self, config, url, params):
     Api.__init__(self, config)
     self.url = url
     self.params = params
Exemplo n.º 13
0
 def __init__(self, config, entry_id, format):
     Api.__init__(self, config)
     self.entry_id = entry_id
     self.format = format
Exemplo n.º 14
0
 def __init__(self, config):
     Api.__init__(self, config)
Exemplo n.º 15
0
 def __init__(self, config, entry_id, params):
     Api.__init__(self, config)
     self.entry_id = entry_id
     self.params = params