mirror of
https://github.com/hyugogirubato/KeyDive.git
synced 2026-07-15 18:40:02 +02:00
library search via pattern
This commit is contained in:
+5
-3
@@ -168,7 +168,9 @@ class Core:
|
|||||||
script.on('destroyed', __process_destroyed)
|
script.on('destroyed', __process_destroyed)
|
||||||
script.load()
|
script.load()
|
||||||
|
|
||||||
library = script.exports_sync.getlibrary(vendor.name)
|
libraries = script.exports_sync.getlibraries()
|
||||||
|
library = next((l for l in libraries if re.match(vendor.pattern, l['name'])), None)
|
||||||
|
|
||||||
if library:
|
if library:
|
||||||
self.logger.info('Library: %s (%s)', library['name'], library['path'])
|
self.logger.info('Library: %s (%s)', library['name'], library['path'])
|
||||||
|
|
||||||
@@ -178,10 +180,10 @@ class Core:
|
|||||||
elif vendor.oem < 18 and self.functions:
|
elif vendor.oem < 18 and self.functions:
|
||||||
self.logger.warning('The "functions" attribute is deprecated for OEM API < 18')
|
self.logger.warning('The "functions" attribute is deprecated for OEM API < 18')
|
||||||
|
|
||||||
return script.exports_sync.hooklibrary(vendor.name)
|
return script.exports_sync.hooklibrary(library['name'])
|
||||||
|
|
||||||
script.unload()
|
script.unload()
|
||||||
self.logger.warning('Library not found: %s' % vendor.name)
|
self.logger.warning('Library not found: %s' % vendor.pattern)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user