-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCyalPlugin.py
More file actions
30 lines (23 loc) · 862 Bytes
/
CyalPlugin.py
File metadata and controls
30 lines (23 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import glob
from pathlib import Path
import shutil
from nuitka.plugins.PluginBase import NuitkaPluginBase
def get_libraries(module):
"""Returns a list of the libraries needed by cyal"""
cyal_dir = module.getCompileTimeDirectory()
return list(glob.glob(f'{cyal_dir}/*.dll'))
class cyalPlugin(NuitkaPluginBase):
plugin_name = "cyal"
plugin_desc = "provides cyal support"
def __init__(self):
self.copied_cyal = False
def considerExtraDlls(self, dist_dir, module):
libs = get_libraries(module)
name = module.getFullName()
# to avoid copying files twice
if self.copied_cyal == False and name == "cyal":
for lib in libs:
shutil.copy(lib, str(Path(dist_dir)))
self.info(f'copied {lib}')
self.copied_cyal = True
return ()