@@ -108,6 +108,12 @@ def config_file(self):
108
108
"""Current config file path."""
109
109
return self ._cfg_file_path
110
110
111
+ @property
112
+ def environment (self ):
113
+ if not self .has_section (CONSTS .EnvConfigsSectionName ):
114
+ self .add_section (CONSTS .EnvConfigsSectionName )
115
+ return self .get_section (CONSTS .EnvConfigsSectionName )
116
+
111
117
@property
112
118
def core (self ):
113
119
if not self .has_section (CONSTS .ConfigsCoreSection ):
@@ -562,12 +568,12 @@ def get_thirdparty_ext_root_dirs(self, include_default=True):
562
568
Returns:
563
569
:obj:`list`: list of strings. External user extension directories.
564
570
"""
565
- dir_list = []
571
+ dir_list = set ()
566
572
if include_default :
567
573
# add default ext path
568
- dir_list .append (THIRDPARTY_EXTENSIONS_DEFAULT_DIR )
574
+ dir_list .add (THIRDPARTY_EXTENSIONS_DEFAULT_DIR )
569
575
try :
570
- dir_list .extend ([
576
+ dir_list .update ([
571
577
op .expandvars (op .normpath (x ))
572
578
for x in self .core .get_option (
573
579
CONSTS .ConfigsUserExtensionsKey ,
@@ -586,11 +592,19 @@ def get_ext_root_dirs(self):
586
592
:obj:`list`: list of strings. user extension directories.
587
593
588
594
"""
589
- dir_list = []
595
+ dir_list = set ()
590
596
if op .exists (EXTENSIONS_DEFAULT_DIR ):
591
- dir_list .append (EXTENSIONS_DEFAULT_DIR )
592
- dir_list .extend (self .get_thirdparty_ext_root_dirs ())
593
- return list (set (dir_list ))
597
+ dir_list .add (EXTENSIONS_DEFAULT_DIR )
598
+ dir_list .update (self .get_thirdparty_ext_root_dirs ())
599
+ return list (dir_list )
600
+
601
+ def get_ext_sources (self ):
602
+ """Return a list of extension definition source files"""
603
+ ext_sources = self .environment .get_option (
604
+ CONSTS .EnvConfigsExtensionLookupSourcesKey ,
605
+ default_value = [],
606
+ )
607
+ return list (set (ext_sources ))
594
608
595
609
def set_thirdparty_ext_root_dirs (self , path_list ):
596
610
"""Updates list of external extension directories in config file
0 commit comments