File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 1
1
from yamlmacros .lib .extend import apply
2
2
from yamlmacros .lib .syntax import rule as _rule
3
+ from yamlmacros .lib .include import include_resource
3
4
4
5
from yamlmacros import process_macros
5
6
6
7
import sublime
7
8
from os import path
8
9
9
- def include_resource (resource ):
10
- file_contents = sublime .load_resource (resource )
11
- return process_macros (
12
- file_contents ,
13
- arguments = { "file_path" : resource },
14
- )
10
+
11
+ __all__ = ['apply' , 'include_resource' , 'get_extensions' ]
12
+
13
+
14
+ def merge (* args ):
15
+ ret = {}
16
+ for arg in args :
17
+ ret .update (arg )
18
+ return ret
15
19
16
20
def has_value (val ):
17
21
return val is not None and val is not False
18
22
19
23
def get_extensions (node , eval , arguments ):
20
24
return [
21
- include_resource (file_path )
25
+ process_macros (
26
+ sublime .load_resource (file_path ),
27
+ arguments = merge (arguments , { "file_path" : file_path }),
28
+ )
22
29
for file_path in sublime .find_resources ('*.yaml' )
23
30
if path .dirname (file_path ).endswith ('Packages/JSCustom/extensions' )
24
31
and has_value (arguments .get (path .splitext (path .basename (file_path ))[0 ], None ))
You can’t perform that action at this time.
0 commit comments