aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* python3.2 fixes: ResourceWarning: unclosed fileZac Medico2011-08-241-3/+4
|
* 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.
* Mark some messages for localization.Arfrever Frehtes Taifersar Arahesis2010-09-081-2/+2
|
* Remove all svn $Id keywords.Zac Medico2010-03-241-1/+0
|
* Deprecate pordbapi.mysettings since the portdbapi.settings alias is nowZac Medico2010-01-311-2/+2
| | | | | | supported by stable portage. svn path=/main/trunk/; revision=15306
* Use dict.(keys|values|items)() instead of ↵Arfrever Frehtes Taifersar Arahesis2009-09-211-2/+2
| | | | | | | | dict.(iterkeys|itervalues|iteritems)() for compatibility with Python 3. (2to3-3.1 -f dict -nw ${FILES}) svn path=/main/trunk/; revision=14327
* Update syntax of numbers for compatibility with Python 3.Arfrever Frehtes Taifersar Arahesis2009-09-201-3/+3
| | | | | | (2to3-3.1 -f numliterals -nw ${FILES}) svn path=/main/trunk/; revision=14292
* Replace _content_encoding, _fs_encoding, and _merge_encoding with directZac Medico2009-08-211-7/+7
| | | | | | usage of _encodings. svn path=/main/trunk/; revision=14113
* Bug #270866 - Validate News-Item-Format headers.Zac Medico2009-08-181-0/+5
| | | | svn path=/main/trunk/; revision=14086
* Bug #277619 - Fix news item relevance logic. Thanks to Alec WarnerZac Medico2009-08-171-11/+22
| | | | | | <antarus@gentoo.org> for this patch. svn path=/main/trunk/; revision=14081
* Use portage.os, _content_encoding, and _fs_encoding where appropriate.Zac Medico2009-08-171-6/+22
| | | | svn path=/main/trunk/; revision=14080
* Prepare 308 messages to localization.Arfrever Frehtes Taifersar Arahesis2009-08-151-4/+5
| | | | svn path=/main/trunk/; revision=14067
* Open new items in text mode (unicode), and safely handle unicode in news itemv2.2_rc38Zac Medico2009-08-101-1/+5
| | | | | | names. svn path=/main/trunk/; revision=13975
* whitespace cleanupZac Medico2009-03-061-7/+7
| | | | svn path=/main/trunk/; revision=12766
* Bug #255101 - Fix 'Permission denied' error handling inZac Medico2009-01-161-1/+1
| | | | | | | NewsManager.getUnreadItems(). If there's no permission to lock the unread file, skip the lock and try to read the file anyway. svn path=/main/trunk/; revision=12521
* Make NewsManager.updateItems() and getUnreadItems() return early ifZac Medico2008-11-151-5/+11
| | | | | | | PermissionDenied errors are encountered when attempting to read the skip or unread files. svn path=/main/trunk/; revision=11956
* Use apply_secpass_permissions() to avoid OperationNotPermitted errors whenZac Medico2008-11-131-3/+3
| | | | | | not allowed to chown files to root uid. svn path=/main/trunk/; revision=11873
* Use grabfile() instead of grablines(), to ignore empty lines.Zac Medico2008-11-131-4/+4
| | | | svn path=/main/trunk/; revision=11872
* Add quote from GLEP 42 about permission bits.Zac Medico2008-11-131-0/+4
| | | | svn path=/main/trunk/; revision=11871
* Misc fixes and cleanups in NewsManager.Zac Medico2008-11-131-68/+71
| | | | svn path=/main/trunk/; revision=11870
* Return early from NewsManager.updateItems() if the news path listdir callZac Medico2008-11-131-6/+4
| | | | | | fails. svn path=/main/trunk/; revision=11869
* Always return early from NewsManager.updateItems() if self.unread_path can'tZac Medico2008-11-131-10/+12
| | | | | | be created. svn path=/main/trunk/; revision=11868
* Use a simpler approach instead of implementing NewsItem.__getattr__().Zac Medico2008-11-121-5/+3
| | | | svn path=/main/trunk/; revision=11867
* * Add NewsItem.isValid() and DisplayRestriction.isValid() methods and useZac Medico2008-11-121-5/+33
| | | | | | | use them to check validity inside NewsManager.updateItems(). * Make DisplayInstalledRestriction.isValid() check validity of the atom. svn path=/main/trunk/; revision=11866
* Inside NewsManager.updateItems(), use a mutable set for skiplist and sort theZac Medico2008-11-121-3/+4
| | | | | | contents when writing the file. svn path=/main/trunk/; revision=11864
* Instead of raising a TypeError from the NewsItem constructor, check the pathZac Medico2008-11-121-6/+4
| | | | | | inside NewsManager.updateItems() before the NewsItem constructor is called. svn path=/main/trunk/; revision=11863
* Use a frozenset to optimize skiplist containment checks insideZac Medico2008-11-121-1/+1
| | | | | | NewsManager.updateItems(). svn path=/main/trunk/; revision=11862
* Bug #237526 - Use portage.util.grablines() for exception handling whenZac Medico2008-09-131-14/+5
| | | | | | reading the unread file. svn path=/main/trunk/; revision=11510
* Define __all__ and remove unused imports found by pyflakes.Zac Medico2008-09-131-3/+6
| | | | svn path=/main/trunk/; revision=11509
* - news bugfix from ferringbNed Ludd2008-03-111-0/+1
| | | | svn path=/main/trunk/; revision=9459
* Various repoman fixes, plus a weird lockfile tracekback in news.Alec Warner2008-02-241-1/+2
| | | | svn path=/main/trunk/; revision=9377
* Make some adjustments so that it's possible to install binaryZac Medico2007-12-201-4/+6
| | | | | | | | | | | | | | | | | | packages without having a portage tree: * Make portdbapi.aux_get() return early by raising a KeyError if it detects that there is no portage tree. * Move the ARCH and USERLAND sanity check to the last moment in doebuild() and only require these variables if an existing environment (such as environment.bz2) is unavailable. * Make the NewsManager constructor cope with a broken make.profile symlink. svn path=/main/trunk/; revision=8973
* Fix NewsManager.getUnreadItems() so that it works properlyZac Medico2007-10-211-13/+16
| | | | | | for an unprivileged user in readonly mode. svn path=/main/trunk/; revision=8215
* Bug #196427 - Prevent various news related tracebacksZac Medico2007-10-211-3/+10
| | | | | | | from occuring when running emerge as an unprivileged user in --pretend mode. svn path=/main/trunk/; revision=8214
* ignore "permission denied" errors when changing perms of news skipfile that ↵Marius Mauch2007-10-211-1/+10
| | | | | | happen when running with user priviledges in pretend mode svn path=/main/trunk/; revision=8202
* use skipfile rather than timestamp to ignore processed filesMarius Mauch2007-10-161-36/+25
| | | | svn path=/main/trunk/; revision=8148
* Fix minor issues with loaders in the static file loader, fix quoting and ↵Alec Warner2007-09-071-17/+18
| | | | | | import style in news.py. Add TextFileLoader and EnvLoader loaders svn path=/main/trunk/; revision=7753
* Run pychecker over everything, fix obvious thing slike modules not in use, ↵Alec Warner2007-07-221-2/+1
| | | | | | variables not being used, or global exceptions not being deleted. Also fix imports for style (1 per line) svn path=/main/trunk/; revision=7354
* Fix profile and config arguments to NewsItem.isRelevant() inside ↵Zac Medico2007-06-161-1/+11
| | | | | | NewsManager.updateItems(). svn path=/main/trunk/; revision=6862
* Pass existing portdbapi and vardbapi instances into the NewsManager constructor.Zac Medico2007-06-131-9/+7
| | | | svn path=/main/trunk/; revision=6841
* remove pointless $PORTDIR lockMarius Mauch2007-05-311-26/+16
| | | | svn path=/main/trunk/; revision=6682
* Avoid permission errors when trying to lock repo_path. Note that the lock ↵Zac Medico2007-05-191-1/+6
| | | | | | file should be mapped into /var somewhere. svn path=/main/trunk/; revision=6555
* - store newsid in unread file, not the path to the news itemMarius Mauch2007-05-181-52/+52
| | | | | | | | - use octal numbers to specify file permissions - use descriptive exceptions when (not) creating NewsItem objects - code style cleanups svn path=/main/trunk/; revision=6546
* make sure uid is an intAlec Warner2007-03-031-2/+2
| | | | svn path=/main/trunk/; revision=6155
* Namespace sanitizing, step 2Marius Mauch2007-01-251-5/+5
| | | | | | | Rename portage.exec to portage.process to avoid syntax errors svn path=/main/trunk/; revision=5780
* Namespace sanitizing, step 1Marius Mauch2007-01-251-0/+268
svn path=/main/trunk/; revision=5778