summaryrefslogtreecommitdiffstats
path: root/pym/portage/env
Commit message (Collapse)AuthorAgeFilesLines
* Replace @returns with @return.Zac Medico2012-03-271-2/+2
|
* Migrate from codecs.open() to io.open().Zac Medico2011-07-101-3/+3
| | | | | | | | | | | | | | | | | The io.open() function is the same as the built-in open() function in python3, and its implementation is optimized in python-2.7 and later. In addition to the possible performance improvement, this also allows us to avoid any future compatibility issues with codecs.open() that may arise if it is delegated to the built-in open() function as discussed in PEP 400. The main caveat involved with io.open() is that TextIOWrapper.write() raises TypeError if given raw bytes, unlike the streams returned from codecs.open(). This is mainly an issue for python2 since literal strings are raw bytes. We handle this by wrapping TextIOWrapper.write() arguments with our _unicode_decode() function. Also, the atomic_ofstream class overrides the write() method in python2 so that it performs automatic coercion to unicode when necessary.
* Remove all svn $Id keywords.Zac Medico2010-03-244-4/+0
|
* Bug #286475 - Fix KeyValuePairFileLoader.lineParser() so it doesn't raiseZac Medico2009-09-261-4/+1
| | | | | | AttributeError when a key/value is redefined. svn path=/main/trunk/; revision=14435
* Update syntax of 'except' statements for compatibility with Python 3.Arfrever Frehtes Taifersar Arahesis2009-09-201-1/+1
| | | | | | (2to3-3.1 -f except -nw ${FILES}) svn path=/main/trunk/; revision=14289
* Replace _content_encoding, _fs_encoding, and _merge_encoding with directZac Medico2009-08-211-5/+4
| | | | | | usage of _encodings. svn path=/main/trunk/; revision=14113
* Use _content_encoding and _fs_encoding for unicode encoding/decoding.Zac Medico2009-08-171-7/+21
| | | | svn path=/main/trunk/; revision=14072
* Do not pass unicode strings into os.walk calls, since it can causeZac Medico2009-08-061-0/+6
| | | | | | internal os.path.join calls to raise UnicodeDecodeError. svn path=/main/trunk/; revision=13926
* Always pass encodings='utf_8' to codecs.open(), since otherwise it canZac Medico2009-07-201-1/+1
| | | | | | | | | | return non-unicode strings (at least in some cases, observed with python-2.6.2). Don't use unicode in portage.util.getconfig() for now, since shlex doesn't seem to support it (spurious \0 characters). If we use unicode for config variables, it breaks shlex.split() calls on those variables due to the same issue (spurious \0 characters). svn path=/main/trunk/; revision=13845
* Use codecs.open for unicode support in FileLoader.load().Zac Medico2009-07-201-1/+2
| | | | svn path=/main/trunk/; revision=13836
* Prepare 41 messages to localization.Arfrever Frehtes Taifersar Arahesis2009-06-291-9/+10
| | | | svn path=/main/trunk/; revision=13733
* Make RecursiveFileLoader skip hidden directories, and only use a single statZac Medico2009-04-081-5/+10
| | | | | | call to check for existence and file type. svn path=/main/trunk/; revision=13298
* Make KeyValuePairFileLoader store the values as a strings instead of a lists.Zac Medico2009-03-031-1/+1
| | | | svn path=/main/trunk/; revision=12744
* Fix KeyValuePairFileLoader to only split on '=' once and strip whitespaceZac Medico2009-03-021-3/+3
| | | | | | for keys and values. svn path=/main/trunk/; revision=12742
* For compatibility with python-3.0, open files in text mode where appropriate.Zac Medico2009-02-191-1/+1
| | | | svn path=/main/trunk/; revision=12642
* Remove redundant ConfigLoaderKlass.__iter__() method.Zac Medico2009-02-191-3/+0
| | | | svn path=/main/trunk/; revision=12631
* Implement a substitute for UserDict.UserDict so that code converted viaZac Medico2009-02-191-3/+6
| | | | | | | | 2to3 will run: http://bugs.python.org/issue2876 svn path=/main/trunk/; revision=12629
* ignore missing filesMarius Mauch2007-10-051-2/+3
| | | | svn path=/main/trunk/; revision=7948
* or I was right the first time :(Alec Warner2007-09-091-1/+1
| | | | svn path=/main/trunk/; revision=7766
* sigh, or, not andAlec Warner2007-09-091-1/+1
| | | | svn path=/main/trunk/; revision=7765
* compress two loop iterations into oneAlec Warner2007-09-081-2/+1
| | | | svn path=/main/trunk/; revision=7764
* Fix incorrect parse check as value lists in KeyListFileLoader might be ↵Marius Mauch2007-09-071-5/+32
| | | | | | empty, add support for value validators in relevant Loaders svn path=/main/trunk/; revision=7757
* return the full path, not just the filenameMarius Mauch2007-09-071-1/+1
| | | | svn path=/main/trunk/; revision=7755
* fix errors in call logicMarius Mauch2007-09-071-2/+2
| | | | svn path=/main/trunk/; revision=7754
* Fix minor issues with loaders in the static file loader, fix quoting and ↵Alec Warner2007-09-071-1/+34
| | | | | | import style in news.py. Add TextFileLoader and EnvLoader loaders svn path=/main/trunk/; revision=7753
* Validator should be a function, not a class, fix spacing/tab issues. Fix ↵Alec Warner2007-07-233-26/+72
| | | | | | parsing errors for KeyValuePairLoader. Add a GenericFileLoader class that uses more than 1 loader in a vain attempt to figure out what kind of file it is. Fix inheritance by renaming UserConfigKlass svn path=/main/trunk/; revision=7368
* Move common file functionality into a FileLoader class and delegate parsing ↵Alec Warner2007-07-232-112/+140
| | | | | | to subclasses via a lineParser func, no idea how this will work performance wise. Fix errors in parser (blank lines are not errors ;)) svn path=/main/trunk/; revision=7365
* fix spacing, comments, default argsAlec Warner2007-07-231-8/+8
| | | | svn path=/main/trunk/; revision=7364
* Implement UserConfigKlass.__iter__() so that tests pass.Zac Medico2007-06-211-0/+3
| | | | svn path=/main/trunk/; revision=6914
* fix spacing in loadersAlec Warner2007-05-091-3/+3
| | | | svn path=/main/trunk/; revision=6506
* validators++Alec Warner2007-05-082-11/+15
| | | | svn path=/main/trunk/; revision=6498
* Add missing base class.Zac Medico2007-05-051-1/+1
| | | | svn path=/main/trunk/; revision=6484
* I consulted the python oracle and it told me enumerate was better, so go ↵Alec Warner2007-04-011-11/+9
| | | | | | team enumerate svn path=/main/trunk/; revision=6330
* drop line_count in favor of izip and count(), itertools FOR THE WIN baby.Alec Warner2007-03-312-20/+45
| | | | svn path=/main/trunk/; revision=6329
* After talking to marienz, decide that 1 class is better than 4, also realize ↵Alec Warner2007-03-312-109/+39
| | | | | | that UserDict has most of the dict methods exposed, so drop them. Also add a LoaderError Exception. Still to do? add a validation callable into the loader to validate data. svn path=/main/trunk/; revision=6328
* spaces -> tabsZac Medico2007-03-281-1/+1
| | | | svn path=/main/trunk/; revision=6318
* spaces -> tabsZac Medico2007-03-281-3/+3
| | | | svn path=/main/trunk/; revision=6317
* fix broken PortageModule classesAlec Warner2007-03-261-1/+3
| | | | svn path=/main/trunk/; revision=6290
* clean up some init functions, add PortageModules classAlec Warner2007-03-261-6/+39
| | | | svn path=/main/trunk/; revision=6288
* split the loader classes into their own file, split the recursive filename ↵Alec Warner2007-03-252-167/+168
| | | | | | grabbing out into it's own function svn path=/main/trunk/; revision=6281
* completely rewrite file bits, use Loader classes to push loading ↵Alec Warner2007-03-251-72/+197
| | | | | | functionality down svn path=/main/trunk/; revision=6280
* Fix a typo.Zac Medico2007-03-171-1/+1
| | | | svn path=/main/trunk/; revision=6222
* add PackageMask{File} classes, change unit tests to use try/finally, makes ↵Alec Warner2007-03-081-0/+55
| | | | | | sure the tempfile gets destroyed even if something weird happens svn path=/main/trunk/; revision=6193
* Change load() to have no default arguments, makes caller specifiy ↵Alec Warner2007-03-081-2/+56
| | | | | | explicitly...I think assuming a default arg is bad here. Also add PackageUse and PackageUseFile, change up the comments a bit. I've started to notice code re-use here; these are basically the same code. I think I will write up the rest of the package* classes and then perform code merges to save LOC and memory and whatnot svn path=/main/trunk/; revision=6192
* Part of my attempt now involves cleaning up config; this means for me; ↵Alec Warner2007-03-072-0/+64
removing the file-based stuff from it (config_path) and encapsulating that into classes. This is the first one, a simple PackageKeywords class that does file-based stuff, no recursion yet but soon. Trying to do TDD here as well,so tests first then code. svn path=/main/trunk/; revision=6190