minor plugin improvements

This commit is contained in:
Nick Sweeting 2024-10-22 02:25:20 -07:00
parent c8790a943a
commit 72f777059f
No known key found for this signature in database
3 changed files with 30 additions and 18 deletions

View file

@ -10,5 +10,13 @@ impl = hookimpl = HookimplMarker("abx")
@hookspec @hookspec
@hookimpl @hookimpl
def get_system_user() -> str: def get_system_user() -> str:
# Beware $HOME may not match current EUID, UID, PUID, SUID, there are edge cases
# - sudo (EUD != UID != SUID)
# - running with an autodetected UID based on data dir ownership
# but mapping of UID:username is broken because it was created
# by a different host system, e.g. 911's $HOME outside of docker
# might be /usr/lib/lxd instead of /home/archivebox
# - running as a user that doens't have a home directory
# - home directory is set to a path that doesn't exist, or is inside a dir we cant read
return Path('~').expanduser().name return Path('~').expanduser().name

View file

@ -1,8 +1,9 @@
__package__ = 'plugins_extractor.wget' __package__ = 'plugins_extractor.wget'
__label__ = 'wget' __id__ = 'wget'
__label__ = 'WGET'
__version__ = '2024.10.14' __version__ = '2024.10.14'
__author__ = 'ArchiveBox' __author__ = 'ArchiveBox'
__homepage__ = 'https://github.com/ArchiveBox/ArchiveBox/tree/main/archivebox/plugins_extractor/wget' __homepage__ = 'https://github.com/ArchiveBox/ArchiveBox/tree/dev/archivebox/plugins_extractor/wget'
__dependencies__ = [] __dependencies__ = []
import abx import abx
@ -11,13 +12,14 @@ import abx
@abx.hookimpl @abx.hookimpl
def get_PLUGIN(): def get_PLUGIN():
return { return {
'wget': { __id__: {
'PACKAGE': __package__, 'id': __id__,
'LABEL': __label__, 'package': __package__,
'VERSION': __version__, 'label': __label__,
'AUTHOR': __author__, 'version': __version__,
'HOMEPAGE': __homepage__, 'author': __author__,
'DEPENDENCIES': __dependencies__, 'homepage': __homepage__,
'dependencies': __dependencies__,
} }
} }
@ -26,7 +28,7 @@ def get_CONFIG():
from .config import WGET_CONFIG from .config import WGET_CONFIG
return { return {
'wget': WGET_CONFIG __id__: WGET_CONFIG
} }
@abx.hookimpl @abx.hookimpl

View file

@ -1,6 +1,7 @@
__package__ = 'plugins_pkg.npm' __package__ = 'plugins_pkg.npm'
__label__ = 'npm'
__version__ = '2024.10.14' __version__ = '2024.10.14'
__id__ = 'npm'
__label__ = 'npm'
__author__ = 'ArchiveBox' __author__ = 'ArchiveBox'
__homepage__ = 'https://www.npmjs.com/' __homepage__ = 'https://www.npmjs.com/'
@ -10,12 +11,13 @@ import abx
@abx.hookimpl @abx.hookimpl
def get_PLUGIN(): def get_PLUGIN():
return { return {
'npm': { __id__: {
'PACKAGE': __package__, 'id': __id__,
'LABEL': __label__, 'package': __package__,
'VERSION': __version__, 'label': __label__,
'AUTHOR': __author__, 'version': __version__,
'HOMEPAGE': __homepage__, 'author': __author__,
'homepage': __homepage__,
} }
} }
@ -24,7 +26,7 @@ def get_CONFIG():
from .config import NPM_CONFIG from .config import NPM_CONFIG
return { return {
'npm': NPM_CONFIG, __id__: NPM_CONFIG,
} }
@abx.hookimpl @abx.hookimpl