Esempio 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}.")
Esempio 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
Esempio n. 4
0
 def __init__(self, config, url):
     Api.__init__(self, config)
     self.url = url
Esempio n. 5
0
 def __init__(self, config, entry_id, tag):
     Api.__init__(self, config)
     self.entry_id = entry_id
     self.tag = tag
 def __init__(self, config, entry_id):
     Api.__init__(self, config)
     self.entry_id = entry_id
Esempio 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
Esempio n. 9
0
 def __init__(self, config, tags):
     Api.__init__(self, config)
     self.tags = tags
Esempio n. 10
0
 def __init__(self, config, custom_url=None):
     Api.__init__(self, config)
     self.custom_url = custom_url
     self.skip_auth = True
 def __init__(self, config, params):
     Api.__init__(self, config)
     self.params = params
Esempio n. 12
0
 def __init__(self, config, url, params):
     Api.__init__(self, config)
     self.url = url
     self.params = params
Esempio n. 13
0
 def __init__(self, config, entry_id, format):
     Api.__init__(self, config)
     self.entry_id = entry_id
     self.format = format
Esempio n. 14
0
 def __init__(self, config):
     Api.__init__(self, config)
Esempio n. 15
0
 def __init__(self, config, entry_id, params):
     Api.__init__(self, config)
     self.entry_id = entry_id
     self.params = params