diff options
author | Devan Franchini <twitch153@gentoo.org> | 2014-04-26 15:29:23 -0400 |
---|---|---|
committer | Devan Franchini <twitch153@gentoo.org> | 2015-06-19 15:44:08 -0400 |
commit | 2909c15aff1eb419a7d705067864ac6b90ecf097 (patch) | |
tree | 49a0385518a880e5d518f349d7e8d6bbfa890518 /WebappConfig/content.py | |
parent | sbin/webapp-cleaner: alters source to /lib/gentoo/functions.sh (diff) | |
download | webapp-config-2909c15aff1eb419a7d705067864ac6b90ecf097.tar.gz webapp-config-2909c15aff1eb419a7d705067864ac6b90ecf097.tar.bz2 webapp-config-2909c15aff1eb419a7d705067864ac6b90ecf097.zip |
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.
Diffstat (limited to 'WebappConfig/content.py')
-rw-r--r-- | WebappConfig/content.py | 22 |
1 files changed, 11 insertions, 11 deletions
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 + '"') |