diff options
author | dol-sen <brian.dolbec@gmail.com> | 2011-09-18 23:22:15 -0700 |
---|---|---|
committer | dol-sen <brian.dolbec@gmail.com> | 2011-09-22 20:12:00 -0700 |
commit | f3e1976da8eeef942a95019669633255fa3b6c50 (patch) | |
tree | fd5abe96dd7a25684a81fd6508e7c5c86204f683 /layman/api.py | |
parent | 2413c2f4d2c5eb09063f477bcd158244ab8d32ff (diff) | |
download | layman-f3e1976da8eeef942a95019669633255fa3b6c50.tar.gz layman-f3e1976da8eeef942a95019669633255fa3b6c50.tar.bz2 layman-f3e1976da8eeef942a95019669633255fa3b6c50.zip |
py2, py3 compatability changes so 2to3 will work correctly.
Diffstat (limited to 'layman/api.py')
-rwxr-xr-x | layman/api.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/layman/api.py b/layman/api.py index 5e624d1..c1a0e97 100755 --- a/layman/api.py +++ b/layman/api.py @@ -22,6 +22,8 @@ from layman.dbbase import UnknownOverlayException, UnknownOverlayMessage from layman.db import DB, RemoteDB from layman.overlays.source import require_supported #from layman.utils import path, delete_empty_directory +from layman.compatibility import encode, fileopen + UNKNOWN_REPO_ID = "Repo ID '%s' " + \ "is not listed in the current available overlays list" @@ -91,7 +93,7 @@ class LaymanAPI(object): if isinstance(repos, basestring): repos = [repos] # else assume it is an iterable, if not it will error - return repos + return [encode(i) for i in repos] def delete_repos(self, repos): @@ -411,7 +413,7 @@ class LaymanAPI(object): >>> api.get_errors() [] >>> filename = api._get_remote_db().filepath(config['overlays'])+'.xml' - >>> b = open(filename) + >>> b = fileopen(filename, 'r') >>> b.readlines()[24] ' A collection of ebuilds from Gunnar Wrobel [wrobel@gentoo.org].\\n' |