From: "Devan Franchini" <twitch153@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/webapp-config:experimental commit in: WebappConfig/
Date: Sat, 26 Apr 2014 19:33:41 +0000 (UTC) [thread overview]
Message-ID: <1398540563.b7d8fbf7ad46ba1e420956ff28eaf6a827e39f3d.twitch153@gentoo> (raw)
commit: b7d8fbf7ad46ba1e420956ff28eaf6a827e39f3d
Author: Devan Franchini <twitch153 <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 26 19:29:23 2014 +0000
Commit: Devan Franchini <twitch153 <AT> gentoo <DOT> org>
CommitDate: Sat Apr 26 19:29:23 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/webapp-config.git;a=commit;h=b7d8fbf7
Adds python3.x compatibility to codebase.
Although most of the codebase already has python3.x compatibility
when running 2to3 more minor changes where found. This commit
includes the changes found when running 2to3 on webapp-config's
codebase.
---
WebappConfig/config.py | 4 ++--
WebappConfig/content.py | 22 +++++++++++-----------
WebappConfig/db.py | 4 ++--
WebappConfig/debug.py | 8 ++++----
WebappConfig/dotconfig.py | 6 +++---
WebappConfig/ebuild.py | 2 +-
WebappConfig/filetype.py | 6 +++---
WebappConfig/sandbox.py | 4 ++--
8 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/WebappConfig/config.py b/WebappConfig/config.py
index 1f3fab1..597dc18 100644
--- a/WebappConfig/config.py
+++ b/WebappConfig/config.py
@@ -857,7 +857,7 @@ class Config:
OUT.debug('Trying to import environment variables', 7)
if envmap:
- for (key, value) in os.environ.items():
+ for (key, value) in list(os.environ.items()):
if envmap == 'all' or key.lower() in envmap:
@@ -894,7 +894,7 @@ class Config:
'verbose' : 'g_verbose',
'bug_report' : 'g_bugreport'}
- for i in option_to_config.keys():
+ for i in list(option_to_config.keys()):
if i in options.__dict__ and options.__dict__[i]:
self.config.set('USER', option_to_config[i],
str(options.__dict__[i]))
diff --git a/WebappConfig/content.py b/WebappConfig/content.py
index c635f5a..e157d23 100644
--- a/WebappConfig/content.py
+++ b/WebappConfig/content.py
@@ -291,7 +291,7 @@ class Contents:
self.check_installdir()
- values = [' '.join(i) for i in self.__content.values()]
+ values = [' '.join(i) for i in list(self.__content.values())]
if not self.__p:
try:
@@ -481,7 +481,7 @@ class Contents:
'sym' : [ 'sym', self.file_zero, self.file_link ],
}
- if not dsttype in allowed_types.keys():
+ if not dsttype in list(allowed_types.keys()):
OUT.die('Oops, webapp-config bug. "dsttype" is ' + dsttype)
# Generate handler for file attributes
@@ -548,7 +548,7 @@ class Contents:
''' Get a list of files. This is returned as a list sorted according
to length, so that files lower in the hierarchy can be removed
first.'''
- installed = self.__content.keys()
+ installed = list(self.__content.keys())
return sorted(installed, key=lambda x: (-len(x), x))
def get_directories(self):
@@ -675,7 +675,7 @@ class Contents:
def entry(self, entry):
''' Return a complete entry.'''
- if entry in self.__content.keys():
+ if entry in list(self.__content.keys()):
return ' '.join(self.__content[entry])
else:
raise Exception('Unknown file "' + entry + '"')
@@ -684,7 +684,7 @@ class Contents:
'''
Returns the entry type.
'''
- if entry in self.__content.keys():
+ if entry in list(self.__content.keys()):
return self.__content[entry][0]
else:
raise Exception('Unknown file "' + entry + '"')
@@ -693,7 +693,7 @@ class Contents:
'''
Returns if the entry is relative or not.
'''
- if entry in self.__content.keys():
+ if entry in list(self.__content.keys()):
return bool(int(self.__content[entry][1]))
else:
raise Exception('Unknown file "' + entry + '"')
@@ -702,7 +702,7 @@ class Contents:
'''
Returns the owner of the entry.
'''
- if entry in self.__content.keys():
+ if entry in list(self.__content.keys()):
return self.__content[entry][2]
else:
raise Exception('Unknown file "' + entry + '"')
@@ -711,7 +711,7 @@ class Contents:
'''
Returns the (possibly relative) path of the entry.
'''
- if entry in self.__content.keys():
+ if entry in list(self.__content.keys()):
msg = self.__content[entry][3]
if msg[0] == "/":
msg = self.__root + msg
@@ -724,7 +724,7 @@ class Contents:
'''
Returns the recorded modification time of the entry.
'''
- if entry in self.__content.keys():
+ if entry in list(self.__content.keys()):
return self.__content[entry][4]
else:
raise Exception('Unknown file "' + entry + '"')
@@ -733,7 +733,7 @@ class Contents:
'''
Returns the recorded md5 hash of the entry.
'''
- if entry in self.__content.keys():
+ if entry in list(self.__content.keys()):
return self.__content[entry][5]
else:
raise Exception('Unknown file "' + entry + '"')
@@ -742,7 +742,7 @@ class Contents:
'''
Returns the recorded target of the link.
'''
- if entry in self.__content.keys():
+ if entry in list(self.__content.keys()):
return self.__content[entry][6]
else:
raise Exception('Unknown file "' + entry + '"')
diff --git a/WebappConfig/db.py b/WebappConfig/db.py
index 2d70cb9..aa33ac5 100644
--- a/WebappConfig/db.py
+++ b/WebappConfig/db.py
@@ -405,7 +405,7 @@ class WebappDB(AppHierarchy):
result = {}
- for j in files.keys():
+ for j in list(files.keys()):
if files[j][0]:
p = files[j][0] + '/' + files[j][1] + '-' + files[j][2]
@@ -452,7 +452,7 @@ class WebappDB(AppHierarchy):
OUT.warn('Assuming webapp is no longer installed.')
OUT.warn('Pruning entry from database.')
if action == 'clean':
- for installs in files.keys():
+ for installs in list(files.keys()):
contents = open(installs).readlines()
new_entries = ''
for entry in contents:
diff --git a/WebappConfig/debug.py b/WebappConfig/debug.py
index 5482f43..1e6bd2c 100644
--- a/WebappConfig/debug.py
+++ b/WebappConfig/debug.py
@@ -395,7 +395,7 @@ class Message:
callerlocals = inspect.getargvalues(caller[0])[3]
## Is the caller an obejct? If so he provides 'self'
- if 'self' in callerlocals.keys():
+ if 'self' in list(callerlocals.keys()):
callerobject = callerlocals['self']
del callerlocals['self']
if self.show_class_variables:
@@ -407,7 +407,7 @@ class Message:
# Remove variables not requested
if not '*' in self.debug_var:
- callerlocals = dict([i for i in callerlocals.items()
+ callerlocals = dict([i for i in list(callerlocals.items())
if i[0] in self.debug_var])
## Is the object among the list of objects to debug?
@@ -445,7 +445,7 @@ class Message:
print('// ' + c, file=self.debug_out)
# Selected variables follow
if callerlocals:
- for i,j in callerlocals.items():
+ for i,j in list(callerlocals.items()):
print('// ' \
+ self.maybe_color('turquoise', str(i)) + ':' + str(j), file=self.debug_out)
# Finally the message
@@ -480,7 +480,7 @@ class Message:
if self.debug_vrb == 3:
print(ls + '//', file=self.debug_out)
print(ls + '// VALUES ', file=self.debug_out)
- for i,j in callerlocals.items():
+ for i,j in list(callerlocals.items()):
print(ls + '// ------------------> ' \
+ self.maybe_color('turquoise', str(i)) + ':', file=self.debug_out)
breaklines(str(j))
diff --git a/WebappConfig/dotconfig.py b/WebappConfig/dotconfig.py
index cab0392..948fa90 100644
--- a/WebappConfig/dotconfig.py
+++ b/WebappConfig/dotconfig.py
@@ -115,7 +115,7 @@ class DotConfig:
'WEB_INSTALLDIR']
def __getitem__(self, key):
- if key in self.__data.keys():
+ if key in list(self.__data.keys()):
return self.__data[key]
# this key didn't exist in old versions, but new versions
# expect it. fix bug 355295
@@ -180,8 +180,8 @@ class DotConfig:
OUT.debug('Trying to retrieve package name', 6)
- if 'WEB_PN' in self.__data.keys() and 'WEB_PVR' in self.__data.keys():
- if 'WEB_CATEGORY' in self.__data.keys():
+ if 'WEB_PN' in list(self.__data.keys()) and 'WEB_PVR' in list(self.__data.keys()):
+ if 'WEB_CATEGORY' in list(self.__data.keys()):
return self.__data['WEB_CATEGORY'] + '/' + \
self.__data['WEB_PN'] + '-' + self.__data['WEB_PVR']
else:
diff --git a/WebappConfig/ebuild.py b/WebappConfig/ebuild.py
index 29ec893..24ef0d6 100644
--- a/WebappConfig/ebuild.py
+++ b/WebappConfig/ebuild.py
@@ -326,7 +326,7 @@ class Ebuild:
'PVR': None}
result = {}
- for i in export_map.keys():
+ for i in list(export_map.keys()):
value = export_map[i]
diff --git a/WebappConfig/filetype.py b/WebappConfig/filetype.py
index 3c5acbb..63d7e5f 100644
--- a/WebappConfig/filetype.py
+++ b/WebappConfig/filetype.py
@@ -137,7 +137,7 @@ class FileType:
for i in server_owned:
- if self.__fix(i) in self.__cache.keys():
+ if self.__fix(i) in list(self.__cache.keys()):
OUT.debug('Adding config-server-owned file', 8)
@@ -177,7 +177,7 @@ class FileType:
filename = self.__fix(filename)
# look for config-protected files in the cache
- if filename in self.__cache.keys():
+ if filename in list(self.__cache.keys()):
return self.__cache[filename]
# unspecified file (and thus virtual)
@@ -208,7 +208,7 @@ class FileType:
directory = self.__fix(directory)
# check the cache
- if directory in self.__cache.keys():
+ if directory in list(self.__cache.keys()):
return self.__cache[directory]
# unspecified directories are default-owned
diff --git a/WebappConfig/sandbox.py b/WebappConfig/sandbox.py
index 3a86673..0cac7e1 100644
--- a/WebappConfig/sandbox.py
+++ b/WebappConfig/sandbox.py
@@ -35,7 +35,7 @@ if os.path.isdir("/proc/%i/fd" % os.getpid()):
return (int(fd) for fd in os.listdir("/proc/%i/fd" % os.getpid()) if fd.isdigit())
else:
def get_open_fds():
- return range(max_fd_limit)
+ return list(range(max_fd_limit))
class Sandbox:
@@ -88,7 +88,7 @@ class Sandbox:
# merge full_env (w-c variables) with env (write path)
self.env.update(full_env)
- for a in self.env.keys():
+ for a in list(self.env.keys()):
if not self.env[a]:
self.env[a] = ''
next reply other threads:[~2014-04-26 19:33 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-26 19:33 Devan Franchini [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-06-19 19:19 [gentoo-commits] proj/webapp-config:experimental commit in: WebappConfig/ Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-06-19 19:19 Devan Franchini
2015-05-17 3:54 Devan Franchini
2015-05-17 3:44 Devan Franchini
2015-05-17 3:19 Devan Franchini
2015-05-17 2:51 Devan Franchini
2015-05-17 2:42 Devan Franchini
2015-05-17 2:28 Devan Franchini
2015-05-17 0:38 Devan Franchini
2015-05-16 2:16 Devan Franchini
2014-11-18 0:03 Devan Franchini
2014-11-17 23:58 Devan Franchini
2014-11-17 23:42 Devan Franchini
2014-11-14 1:14 Devan Franchini
2014-10-16 19:18 Devan Franchini
2014-10-15 13:27 Devan Franchini
2014-10-15 13:27 Devan Franchini
2014-10-15 13:27 Devan Franchini
2014-10-14 19:13 Devan Franchini
2014-10-14 17:14 Devan Franchini
2014-10-09 18:02 Devan Franchini
2014-10-09 17:58 Devan Franchini
2014-10-09 17:52 Devan Franchini
2014-09-23 17:09 Devan Franchini
2014-01-24 21:45 Devan Franchini
2014-01-22 15:32 Devan Franchini
2014-01-08 4:03 Devan Franchini
2014-01-04 1:40 Devan Franchini
2014-01-04 1:13 Devan Franchini
2013-12-19 6:34 Devan Franchini
2013-12-10 1:34 Devan Franchini
2013-12-09 8:31 Devan Franchini
2013-12-01 8:50 Devan Franchini
2013-12-01 8:44 Devan Franchini
2013-11-05 22:17 Devan Franchini
2013-11-05 22:17 Devan Franchini
2013-10-29 2:18 Devan Franchini
2013-10-27 19:27 Devan Franchini
2013-10-27 2:26 Devan Franchini
2013-10-19 3:34 Devan Franchini
2013-10-18 3:39 Devan Franchini
2013-10-10 3:46 Devan Franchini
2013-10-10 3:41 Devan Franchini
2013-10-10 3:36 Devan Franchini
2013-10-10 2:00 Devan Franchini
2013-09-23 3:51 Devan Franchini
2013-09-23 1:13 Devan Franchini
2013-09-23 1:06 Devan Franchini
2013-09-23 0:19 Devan Franchini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1398540563.b7d8fbf7ad46ba1e420956ff28eaf6a827e39f3d.twitch153@gentoo \
--to=twitch153@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox