Author: bugman Date: Tue Oct 2 14:23:43 2012 New Revision: 17664 URL: http://svn.gna.org/viewcvs/relax?rev=17664&view=rev Log: Python 3 preparation - the relax data store (the data package) now supports both Python 2 and 3. The command used was: 2to3 -w data/__init__.py Modified: trunk/data/__init__.py Modified: trunk/data/__init__.py URL: http://svn.gna.org/viewcvs/relax/trunk/data/__init__.py?rev=17664&r1=17663&r2=17664&view=diff ============================================================================== --- trunk/data/__init__.py (original) +++ trunk/data/__init__.py Tue Oct 2 14:23:43 2012 @@ -301,7 +301,7 @@ # The pipe bundle. if bundle: # A new bundle. - if bundle not in self.pipe_bundles.keys(): + if bundle not in list(self.pipe_bundles.keys()): self.pipe_bundles[bundle] = [] # Add the pipe to the bundle. @@ -327,9 +327,9 @@ """ # No pipes should exist. - if not self.keys() == []: + if not list(self.keys()) == []: if verbosity: - stderr.write("The relax data store contains the data pipes %s.\n" % self.keys()) + stderr.write("The relax data store contains the data pipes %s.\n" % list(self.keys())) return False # Objects which should be in here. @@ -479,7 +479,7 @@ pipes.append(pipe_name) # Set the current pipe. - if self.current_pipe in self.keys(): + if self.current_pipe in list(self.keys()): builtins.cdp = self[self.current_pipe] # Finally update the molecule, residue, and spin metadata. @@ -506,7 +506,7 @@ all = False if not pipes: all = True - pipes = self.keys() + pipes = list(self.keys()) elif isinstance(pipes, str): pipes = [pipes] @@ -536,7 +536,7 @@ # Add all objects in the data store base object to the XML element. if all: - blacklist = list(self.__class__.__dict__.keys() + dict.__dict__.keys()) + blacklist = list(list(self.__class__.__dict__.keys()) + list(dict.__dict__.keys())) for name in dir(self): # Skip blacklisted objects. if name in blacklist: