File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -112,20 +112,21 @@ def user_log_dir(self) -> str:
112112 @property
113113 def site_data_path (self ) -> Path :
114114 """:return: data path shared by users. Only return first item, even if ``multipath`` is set to ``True``"""
115- site_data_dir = self .site_data_dir
116- if self .multipath :
117- # If multipath is True, the first path is returned.
118- site_data_dir = site_data_dir .split (os .pathsep )[0 ]
119- return Path (site_data_dir )
115+ return self ._first_item_as_path_if_multipath (self .site_data_dir )
120116
121117 @property
122118 def site_config_path (self ) -> Path :
123119 """:return: config path shared by the users. Only return first item, even if ``multipath`` is set to ``True``"""
124- site_config_dir = self .site_config_dir
120+ return self ._first_item_as_path_if_multipath (self .site_config_dir )
121+
122+ def _first_item_as_path_if_multipath (self , directory : str ) -> Path :
123+ """
124+ :return: first directory as path, even if ``multipath`` is set to ``True``
125+ """
125126 if self .multipath :
126127 # If multipath is True, the first path is returned.
127- site_config_dir = site_config_dir .split (os .pathsep )[0 ]
128- return Path (site_config_dir )
128+ directory = directory .split (os .pathsep )[0 ]
129+ return Path (directory )
129130
130131
131132__all__ = [
You can’t perform that action at this time.
0 commit comments