diff --git a/cyberqinterface/__init__.py b/cyberqinterface/__init__.py index 965b234..509bc7a 100644 --- a/cyberqinterface/__init__.py +++ b/cyberqinterface/__init__.py @@ -9,8 +9,8 @@ __author__ = 'Bryan Kemp' __license__ = 'BSD New' -from cyberqinterface import CyberQInterface -from cyberqinterface_exceptions import * +from .cyberqinterface import CyberQInterface +from .cyberqinterface_exceptions import * def debug(enable=True, level=1): """ diff --git a/cyberqinterface/cyberqinterface.py b/cyberqinterface/cyberqinterface.py index c9a14b6..aa00909 100644 --- a/cyberqinterface/cyberqinterface.py +++ b/cyberqinterface/cyberqinterface.py @@ -47,7 +47,7 @@ import requests from lxml import objectify -from cyberqinterface_exceptions import * +from .cyberqinterface_exceptions import * class CyberQInterface: """ @@ -173,7 +173,7 @@ def _validateParameters(self, parameters): 'COOK_SET' : '300'}) """ badParameters = {} - for key in parameters.keys(): + for key in list(parameters.keys()): if key not in self.validParameters: badParameters[key] = "Not a valid parameter" return badParameters @@ -334,7 +334,7 @@ def _lookup(self, table, code): if isinstance(code, objectify.IntElement): code = int(code) - if not codes.has_key(table): + if table not in codes: raise LookupException("No lookup table for: %s", table) try: return codes[table][code] @@ -450,9 +450,9 @@ def rampLookup(self, code): help(CyberQInterface) if args.version == True: - print "Version: %s" % __version__ - print "Last Modified: %s" % __date__ + print("Version: %s" % __version__) + print("Last Modified: %s" % __date__) if args.license == True: - print "License: %s" % __license__ - print __license_text__ + print("License: %s" % __license__) + print(__license_text__) diff --git a/docs/conf.py b/docs/conf.py index acae689..db33a75 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -40,8 +40,8 @@ master_doc = 'index' # General information about the project. -project = u'CyberQInterface' -copyright = u'2013, The Brilliant Idea' +project = 'CyberQInterface' +copyright = '2013, The Brilliant Idea' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -183,8 +183,8 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'CyberQInterface.tex', u'CyberQInterface Documentation', - u'Bryan Kemp', 'manual'), + ('index', 'CyberQInterface.tex', 'CyberQInterface Documentation', + 'Bryan Kemp', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -213,8 +213,8 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'cyberqinterface', u'CyberQInterface Documentation', - [u'Bryan Kemp'], 1) + ('index', 'cyberqinterface', 'CyberQInterface Documentation', + ['Bryan Kemp'], 1) ] # If true, show URL addresses after external links. @@ -227,8 +227,8 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'CyberQInterface', u'CyberQInterface Documentation', - u'Bryan Kemp', 'CyberQInterface', 'One line description of project.', + ('index', 'CyberQInterface', 'CyberQInterface Documentation', + 'Bryan Kemp', 'CyberQInterface', 'One line description of project.', 'Miscellaneous'), ] @@ -245,10 +245,10 @@ # -- Options for Epub output --------------------------------------------------- # Bibliographic Dublin Core info. -epub_title = u'CyberQInterface' -epub_author = u'Bryan Kemp' -epub_publisher = u'Bryan Kemp' -epub_copyright = u'2013, Bryan Kemp' +epub_title = 'CyberQInterface' +epub_author = 'Bryan Kemp' +epub_publisher = 'Bryan Kemp' +epub_copyright = '2013, Bryan Kemp' # The language of the text. It defaults to the language option # or en if the language is not set. diff --git a/src/CyberQInterface/cyberqinterface.py b/src/CyberQInterface/cyberqinterface.py index 9b4dab9..8205cb2 100644 --- a/src/CyberQInterface/cyberqinterface.py +++ b/src/CyberQInterface/cyberqinterface.py @@ -47,7 +47,7 @@ import requests from lxml import objectify -from cyberqinterface_exceptions import * +from .cyberqinterface_exceptions import * class CyberQInterface: """ @@ -173,7 +173,7 @@ def _validateParameters(self, parameters): 'COOK_SET' : '300'}) """ badParameters = {} - for key in parameters.keys(): + for key in list(parameters.keys()): if key not in self.validParameters: badParameters[key] = "Not a valid parameter" return badParameters @@ -334,7 +334,7 @@ def _lookup(self, table, code): if isinstance(code, objectify.IntElement): code = int(code) - if not codes.has_key(table): + if table not in codes: raise LookupException("No lookup table for: %s", table) try: return codes[table][code] @@ -418,9 +418,9 @@ def rampLookup(self, code): help(CyberQInterface) if args.version == True: - print "Version: %s" % __version__ - print "Last Modified: %s" % __date__ + print("Version: %s" % __version__) + print("Last Modified: %s" % __date__) if args.license == True: - print "License: %s" % __license__ - print __license_text__ + print("License: %s" % __license__) + print(__license_text__) diff --git a/src/docs/conf.py b/src/docs/conf.py index 9583073..0dd7cc5 100644 --- a/src/docs/conf.py +++ b/src/docs/conf.py @@ -40,8 +40,8 @@ master_doc = 'index' # General information about the project. -project = u'CyberQInterface' -copyright = u'2013, The Brilliant Idea' +project = 'CyberQInterface' +copyright = '2013, The Brilliant Idea' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -183,8 +183,8 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'CyberQInterface.tex', u'CyberQInterface Documentation', - u'Bryan Kemp', 'manual'), + ('index', 'CyberQInterface.tex', 'CyberQInterface Documentation', + 'Bryan Kemp', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -213,8 +213,8 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'cyberqinterface', u'CyberQInterface Documentation', - [u'Bryan Kemp'], 1) + ('index', 'cyberqinterface', 'CyberQInterface Documentation', + ['Bryan Kemp'], 1) ] # If true, show URL addresses after external links. @@ -227,8 +227,8 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'CyberQInterface', u'CyberQInterface Documentation', - u'Bryan Kemp', 'CyberQInterface', 'One line description of project.', + ('index', 'CyberQInterface', 'CyberQInterface Documentation', + 'Bryan Kemp', 'CyberQInterface', 'One line description of project.', 'Miscellaneous'), ] @@ -245,10 +245,10 @@ # -- Options for Epub output --------------------------------------------------- # Bibliographic Dublin Core info. -epub_title = u'CyberQInterface' -epub_author = u'Bryan Kemp' -epub_publisher = u'Bryan Kemp' -epub_copyright = u'2013, Bryan Kemp' +epub_title = 'CyberQInterface' +epub_author = 'Bryan Kemp' +epub_publisher = 'Bryan Kemp' +epub_copyright = '2013, Bryan Kemp' # The language of the text. It defaults to the language option # or en if the language is not set.