Changeset View
Changeset View
Standalone View
Standalone View
bin/EmergeConfig.py
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 27 | class EmergeStandardDirs( object ): | |||
---|---|---|---|---|---|
57 | def _pathCache( ): | 57 | def _pathCache( ): | ||
58 | if EmergeStandardDirs._allowShortpaths: | 58 | if EmergeStandardDirs._allowShortpaths: | ||
59 | return EmergeStandardDirs.__pathCache | 59 | return EmergeStandardDirs.__pathCache | ||
60 | else: | 60 | else: | ||
61 | return EmergeStandardDirs.__noShortPathCache | 61 | return EmergeStandardDirs.__noShortPathCache | ||
62 | 62 | | |||
63 | @staticmethod | 63 | @staticmethod | ||
64 | def allowShortpaths( allowd ): | 64 | def allowShortpaths( allowd ): | ||
65 | old = EmergeStandardDirs._allowShortpaths | ||||
65 | EmergeStandardDirs._allowShortpaths = allowd | 66 | EmergeStandardDirs._allowShortpaths = allowd | ||
67 | return old | ||||
66 | 68 | | |||
67 | @staticmethod | 69 | @staticmethod | ||
68 | def downloadDir( ): | 70 | def downloadDir( ): | ||
69 | """ location of directory where fetched files are stored """ | 71 | """ location of directory where fetched files are stored """ | ||
70 | if not "DOWNLOADDIR" in EmergeStandardDirs._pathCache( ): | 72 | if not "DOWNLOADDIR" in EmergeStandardDirs._pathCache( ): | ||
71 | if EmergeStandardDirs._allowShortpaths and emergeSettings.getboolean( "ShortPath", "EMERGE_USE_SHORT_PATH", | 73 | if EmergeStandardDirs._allowShortpaths and emergeSettings.getboolean( "ShortPath", "EMERGE_USE_SHORT_PATH", | ||
72 | False ): | 74 | False ): | ||
73 | EmergeStandardDirs._pathCache( )[ "DOWNLOADDIR" ] = EmergeStandardDirs.nomalizePath( | 75 | EmergeStandardDirs._pathCache( )[ "DOWNLOADDIR" ] = EmergeStandardDirs.nomalizePath( | ||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | 144 | def etcPortageDir( ): | |||
144 | return os.path.join( EmergeStandardDirs.etcDir( ), "portage" ) | 146 | return os.path.join( EmergeStandardDirs.etcDir( ), "portage" ) | ||
145 | 147 | | |||
146 | 148 | | |||
147 | class EmergeConfig( object ): | 149 | class EmergeConfig( object ): | ||
148 | variablePatern = re.compile( "\$\{[A-Za-z0-9_]*\}", re.IGNORECASE ) | 150 | variablePatern = re.compile( "\$\{[A-Za-z0-9_]*\}", re.IGNORECASE ) | ||
149 | 151 | | |||
150 | def __init__( self ): | 152 | def __init__( self ): | ||
151 | self._config = None | 153 | self._config = None | ||
152 | EmergeStandardDirs.allowShortpaths( False ) | 154 | old = EmergeStandardDirs.allowShortpaths( False ) | ||
153 | self.iniPath = os.path.join( EmergeStandardDirs.etcDir( ), "kdesettings.ini" ) | 155 | self.iniPath = os.path.join( EmergeStandardDirs.etcDir( ), "kdesettings.ini" ) | ||
154 | EmergeStandardDirs.allowShortpaths( True ) | 156 | EmergeStandardDirs.allowShortpaths( old ) | ||
155 | self._alias = dict( ) | 157 | self._alias = dict( ) | ||
156 | self._readSettings( ) | 158 | self._readSettings( ) | ||
157 | 159 | | |||
158 | self.setDefault( "General", "DUMP_SETTINGS", "False" ) | 160 | self.setDefault( "General", "DUMP_SETTINGS", "False" ) | ||
159 | self.addAlias( "EmergeDebug", "Verbose", "General", "EMERGE_VERBOSE" ) | 161 | self.addAlias( "EmergeDebug", "Verbose", "General", "EMERGE_VERBOSE" ) | ||
160 | self.addAlias( "EmergeDebug", "MeasureTime", "General", "EMERGE_MEASURE_TIME" ) | 162 | self.addAlias( "EmergeDebug", "MeasureTime", "General", "EMERGE_MEASURE_TIME" ) | ||
161 | self.addAlias( "General", "UseHardlinks", "General", "EMERGE_USE_SYMLINKS" ) | 163 | self.addAlias( "General", "UseHardlinks", "General", "EMERGE_USE_SYMLINKS" ) | ||
162 | self.addAlias( "General", "WorkOffline", "General", "EMERGE_OFFLINE" ) | 164 | self.addAlias( "General", "WorkOffline", "General", "EMERGE_OFFLINE" ) | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |