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
@hookimpl
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

View file

@ -1,8 +1,9 @@
__package__ = 'plugins_extractor.wget'
__label__ = 'wget'
__id__ = 'wget'
__label__ = 'WGET'
__version__ = '2024.10.14'
__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__ = []
import abx
@ -11,13 +12,14 @@ import abx
@abx.hookimpl
def get_PLUGIN():
return {
'wget': {
'PACKAGE': __package__,
'LABEL': __label__,
'VERSION': __version__,
'AUTHOR': __author__,
'HOMEPAGE': __homepage__,
'DEPENDENCIES': __dependencies__,
__id__: {
'id': __id__,
'package': __package__,
'label': __label__,
'version': __version__,
'author': __author__,
'homepage': __homepage__,
'dependencies': __dependencies__,
}
}
@ -26,7 +28,7 @@ def get_CONFIG():
from .config import WGET_CONFIG
return {
'wget': WGET_CONFIG
__id__: WGET_CONFIG
}
@abx.hookimpl

View file

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