summaryrefslogtreecommitdiffstats
path: root/pym/portage/news.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-21 04:46:31 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-21 04:46:31 +0000
commit82f0c8c317c1d51a45589b708e476e7711a21da4 (patch)
treeace52bce4969f515901ca4fbde735071e3c28221 /pym/portage/news.py
parent9078941af78c0fc7b885ad2779a4f8b73b3f1bd4 (diff)
downloadportage-82f0c8c317c1d51a45589b708e476e7711a21da4.tar.gz
portage-82f0c8c317c1d51a45589b708e476e7711a21da4.tar.bz2
portage-82f0c8c317c1d51a45589b708e476e7711a21da4.zip
Replace _content_encoding, _fs_encoding, and _merge_encoding with direct
usage of _encodings. svn path=/main/trunk/; revision=14113
Diffstat (limited to 'pym/portage/news.py')
-rw-r--r--pym/portage/news.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/pym/portage/news.py b/pym/portage/news.py
index f3482150d..ca608d722 100644
--- a/pym/portage/news.py
+++ b/pym/portage/news.py
@@ -12,8 +12,7 @@ import logging
import os as _os
import re
from portage import os
-from portage import _content_encoding
-from portage import _fs_encoding
+from portage import _encodings
from portage import _unicode_decode
from portage import _unicode_encode
from portage.util import apply_secpass_permissions, ensure_dirs, \
@@ -100,7 +99,7 @@ class NewsManager(object):
news_dir = self._news_dir(repoid)
try:
news = _os.listdir(_unicode_encode(news_dir,
- encoding=_fs_encoding, errors='strict'))
+ encoding=_encodings['fs'], errors='strict'))
except OSError:
return
@@ -120,10 +119,10 @@ class NewsManager(object):
for itemid in news:
try:
itemid = _unicode_decode(itemid,
- encoding=_fs_encoding, errors='strict')
+ encoding=_encodings['fs'], errors='strict')
except UnicodeDecodeError:
itemid = _unicode_decode(itemid,
- encoding=_fs_encoding, errors='replace')
+ encoding=_encodings['fs'], errors='replace')
writemsg_level(
"!!! Invalid encoding in news item name: '%s'\n" % \
itemid, level=logging.ERROR, noiselevel=-1)
@@ -253,8 +252,9 @@ class NewsItem(object):
def parse(self):
lines = codecs.open(_unicode_encode(self.path,
- encoding=_fs_encoding, errors='strict'),
- mode='r', encoding=_content_encoding, errors='replace').readlines()
+ encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['content'], errors='replace'
+ ).readlines()
self.restrictions = {}
invalids = []
for i, line in enumerate(lines):