From 77cf67bbb5c4b6ca67be35115d9b25a38135228f Mon Sep 17 00:00:00 2001 From: rix1337 <> Date: Wed, 7 Nov 2018 22:55:59 +0100 Subject: [PATCH] 0.0.1 - Build 0.0.1 --- .gitignore | 4 ++++ {myjd-api => myjd_api}/__init__.py | 0 {myjd-api => myjd_api}/common.py | 0 {myjd-api => myjd_api}/config.py | 0 {myjd-api => myjd_api}/files.py | 0 {myjd-api => myjd_api}/myjd.py | 0 {myjd-api => myjd_api}/myjdapi.py | 14 +++++++------- {myjd-api => myjd_api}/web.py | 0 setup.py | 6 +++--- 9 files changed, 14 insertions(+), 10 deletions(-) rename {myjd-api => myjd_api}/__init__.py (100%) rename {myjd-api => myjd_api}/common.py (100%) rename {myjd-api => myjd_api}/config.py (100%) rename {myjd-api => myjd_api}/files.py (100%) rename {myjd-api => myjd_api}/myjd.py (100%) rename {myjd-api => myjd_api}/myjdapi.py (99%) rename {myjd-api => myjd_api}/web.py (100%) diff --git a/.gitignore b/.gitignore index bbc1edd..fafcee0 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,7 @@ venv # PyCharm .idea + +# MyJD API files +*.conf +*.ini \ No newline at end of file diff --git a/myjd-api/__init__.py b/myjd_api/__init__.py similarity index 100% rename from myjd-api/__init__.py rename to myjd_api/__init__.py diff --git a/myjd-api/common.py b/myjd_api/common.py similarity index 100% rename from myjd-api/common.py rename to myjd_api/common.py diff --git a/myjd-api/config.py b/myjd_api/config.py similarity index 100% rename from myjd-api/config.py rename to myjd_api/config.py diff --git a/myjd-api/files.py b/myjd_api/files.py similarity index 100% rename from myjd-api/files.py rename to myjd_api/files.py diff --git a/myjd-api/myjd.py b/myjd_api/myjd.py similarity index 100% rename from myjd-api/myjd.py rename to myjd_api/myjd.py diff --git a/myjd-api/myjdapi.py b/myjd_api/myjdapi.py similarity index 99% rename from myjd-api/myjdapi.py rename to myjd_api/myjdapi.py index d111785..251bc2c 100644 --- a/myjd-api/myjdapi.py +++ b/myjd_api/myjdapi.py @@ -729,7 +729,7 @@ def action(self, path, params=(), http_action="POST"): action_url = self.__action_url() if not self.__direct_connection_enabled or self.__direct_connection_info is None \ or time.time() < self.__direct_connection_cooldown: - # No direct connection available, we use My.JDownloader myjd-api. + # No direct connection available, we use My.JDownloader myjd_api. response = self.myjd.request_api(path, http_action, params, action_url) if response is None: @@ -750,7 +750,7 @@ def action(self, path, params=(), http_action="POST"): connection = conn['conn'] api = "http://" + connection["ip"] + ":" + str( connection["port"]) - # if self.myjd-api.request_api("/device/ping", "POST", None, self.__action_url(), myjd-api): + # if self.myjd_api.request_api("/device/ping", "POST", None, self.__action_url(), myjd_api): response = self.myjd.request_api(path, http_action, params, action_url, api) if response is not None: @@ -766,7 +766,7 @@ def action(self, path, params=(), http_action="POST"): self.__direct_connection_consecutive_failures += 1 self.__direct_connection_cooldown = time.time() + \ (60 * self.__direct_connection_consecutive_failures) - # None of the direct connections worked, we use the My.JDownloader myjd-api + # None of the direct connections worked, we use the My.JDownloader myjd_api response = self.myjd.request_api(path, http_action, params, action_url) if response is None: @@ -789,11 +789,11 @@ class Myjdapi: def __init__(self): """ - This functions initializates the myjd-api object. + This functions initializates the myjd_api object. """ self.__request_id = int(time.time() * 1000) - self.__api_url = "https://myjd-api.jdownloader.org" + self.__api_url = "https://myjd_api.jdownloader.org" self.__app_key = "http://git.io/vmcsk" self.__api_version = 1 self.__devices = None @@ -897,7 +897,7 @@ def update_request_id(self): self.__request_id = int(time.time()) def connect(self, email, password): - """Establish connection to myjd-api + """Establish connection to myjd_api :param email: My.Jdownloader User email :param password: My.Jdownloader User password @@ -1020,7 +1020,7 @@ def request_api(self, params={"test":"test"} post_params={"test2":"test2"} action=True - This would make a request to "https://myjd-api.jdownloader.org" + This would make a request to "https://myjd_api.jdownloader.org" """ if not api: api = self.__api_url diff --git a/myjd-api/web.py b/myjd_api/web.py similarity index 100% rename from myjd-api/web.py rename to myjd_api/web.py diff --git a/setup.py b/setup.py index e089f36..bebd2f9 100644 --- a/setup.py +++ b/setup.py @@ -16,14 +16,14 @@ required = f.read().splitlines() setuptools.setup( - name="myjd-api", + name="myjd_api", version="0.0.1", author="rix1337", author_email="", description="A simple json interface for the MyJDownloader API", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/rix1337/myjd-api", + url="https://github.com/rix1337/myjd_api", packages=setuptools.find_packages(), include_package_data=True, install_requires=required, @@ -36,7 +36,7 @@ ], entry_points={ 'console_scripts': [ - 'myjd-api = myjd-api.web:main', + 'myjd_api = myjd_api.web:main', ], }, )