Hi all,
class: FileCheck(object):
def checkFiles(install_vers=None, uninstall_vers=None):
if uninstall_vers != None or install_vers != None:
if uninstall_vers != None:
for ver in uninstall_vers:
print "checking %s" % ver
if install_vers != None:
for ver in install_vers:
pass
print "done"
if __name__ == "__main__":
check = FileCheck()
check.checkFiles(uninstall_vers=["1.0","1.3"])
I'm getting the following error:
Checking 1.0 is uninstalled
Checking 1.3 is uninstalled
Traceback (most recent call last):
File "airFileCheck.py", line 332, in <module>
check.checkFiles(uninstall_vers=["1.0","1.3"])
File "airFileCheck.py", line 316, in checkFiles
for ver in install_vers:
TypeError: 'FileCheck' object is not iterable
If I remove the 'object' from the first line so it's: "class: FileCheck():" I get:
Checking 1.0 is uninstalled
Checking 1.3 is uninstalled
Traceback (most recent call last):
File "airFileCheck.py", line 331, in <module>
check.checkFiles(uninstall_vers=["1.0","1.3"])
File "airFileCheck.py", line 315, in checkFiles
for ver in install_vers:
TypeError: iteration over non-sequence
What am I doing wrong? Why isn't it detecting that my install_vers is equal to None?
Steve