Skip to content

Commit

Permalink
Merge branch 'main' into oidc
Browse files Browse the repository at this point in the history
  • Loading branch information
StefftheEmperor2 committed Feb 6, 2023
2 parents 3fc6e7d + 3eb9a29 commit f6bca86
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 99 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ install_requires =
filetype~=1.0
Js2Py~=0.7
pycurl~=7.43
certifi
# requests-html~=0.10
semver~=2.10
setuptools>=38.3
Expand Down
13 changes: 7 additions & 6 deletions src/pyload/core/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def get_plugin_config_dict(self):
@permission(Perms.STATUS)
def pause_server(self):
"""
Pause server: Tt wont start any new downloads, but nothing gets aborted.
Pause server: It won't start any new downloads, but nothing gets aborted.
"""
self.pyload.thread_manager.pause = True

Expand Down Expand Up @@ -455,10 +455,11 @@ def add_package(self, name, links, dest=Destination.QUEUE):
@permission(Perms.ADD)
def parse_urls(self, html=None, url=None):
"""
Parses html content or any arbitaty text for links and returns result of
Parses html content or any arbitrary text for links and returns result of
`check_urls`
:param html: html source
:param url: url to load html source from
:return:
"""
urls = []
Expand Down Expand Up @@ -590,7 +591,7 @@ def generate_and_add_packages(self, links, dest=Destination.COLLECTOR):
def check_and_add_packages(self, links, dest=Destination.COLLECTOR):
"""
Checks online status, retrieves names, and will add packages.
Because of this packages are not added immediatly, only for internal use.
Because of these packages are not added immediately, only for internal use.
:param links: list of urls
:param dest: `Destination`
Expand Down Expand Up @@ -944,7 +945,7 @@ def upload_container(self, filename, data):
"""
Uploads and adds a container file to pyLoad.
:param filename: filename, extension is important so it can correctly decrypted
:param filename: file name - extension is important, so it can correctly decrypt
:param data: file content
"""
with open(
Expand Down Expand Up @@ -1406,8 +1407,8 @@ def call(self, info):
:param info: `ServiceCall`
:return: result
:raises: ServiceDoesNotExists, when its not available
:raises: ServiceException, when a exception was raised
:raises: ServiceDoesNotExists, when it's not available
:raises: ServiceException, when an exception was raised
"""
plugin = info.plugin
func = info.func
Expand Down
2 changes: 1 addition & 1 deletion src/pyload/core/config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ general - "General":
debug;trace;stack debug_level : "Debug level" = trace
int min_free_space : "Minimum free space in MiB" = 1024
bool folder_per_package : "Create folder for each package" = True
bool ssl_verify : "Peer's SSL certificate verification" = True
bool ssl_verify : "Verify SSL certificates" = True
permission - "Permissions":
bool change_user : "Change user of running process" = False
str user : "Username for ownership" = user
Expand Down
18 changes: 9 additions & 9 deletions src/pyload/core/managers/addon_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AddonManager:
Manages addons, delegates and handles Events.
Every plugin can define events, \
but some very usefull events are called by the Core.
but some very useful events are called by the Core.
Contrary to overwriting addon methods you can use event listener,
which provides additional entry point in the control flow.
Only do very short tasks or use threads.
Expand All @@ -42,7 +42,7 @@ class AddonManager:
Name Arguments Description
===================== ============== ==================================
download_preparing fid A download was just queued and will be prepared now.
download_starts fid A plugin will immediately starts the download afterwards.
download_starts fid A plugin will immediately start the download afterwards.
links_added links, pid Someone just added links, you are able to modify the links.
all_downloads_processed Every link was handled, pyload would idle afterwards.
all_downloads_finished Every download in queue is finished.
Expand Down Expand Up @@ -101,13 +101,13 @@ def create_index(self):
active = []
deactive = []

for pluginname in self.pyload.plugin_manager.addon_plugins:
for plugin_name in self.pyload.plugin_manager.addon_plugins:
try:
# addon_class = getattr(plugin, plugin.__name__)

if self.pyload.config.get_plugin(pluginname, "enabled"):
if self.pyload.config.get_plugin(plugin_name, "enabled"):
plugin_class = self.pyload.plugin_manager.load_class(
"addon", pluginname
"addon", plugin_name
)
if not plugin_class:
continue
Expand All @@ -118,20 +118,20 @@ def create_index(self):
if plugin.is_activated():
active.append(plugin_class.__name__)
else:
deactive.append(pluginname)
deactive.append(plugin_name)

except Exception:
self.pyload.log.warning(
self._("Failed activating {}").format(pluginname),
self._("Failed activating {}").format(plugin_name),
exc_info=self.pyload.debug > 1,
stack_info=self.pyload.debug > 2,
)

self.pyload.log.info(
self._("Activated plugins: {}").format(", ".join(sorted(active)))
self._("Activated addons: {}").format(", ".join(sorted(active)))
)
self.pyload.log.info(
self._("Deactivate plugins: {}").format(", ".join(sorted(deactive)))
self._("Deactivate addons: {}").format(", ".join(sorted(deactive)))
)

self.plugins = plugins
Expand Down

0 comments on commit f6bca86

Please sign in to comment.