Fix compile errors and bad "None" comparisons
authorGreg Smith <gsmith@truviso.com>
Wed, 28 Oct 2009 04:46:47 +0000 (00:46 -0400)
committerGreg Smith <gsmith@truviso.com>
Wed, 28 Oct 2009 04:46:47 +0000 (00:46 -0400)
pgtune

diff --git a/pgtune b/pgtune
index 0e90429de0cbd0b41ff5c5ffeddfb8ca95f2bedb..86dc105ab2035459473e60a3ee9abf8b7b71f831 100755 (executable)
--- a/pgtune
+++ b/pgtune
@@ -166,7 +166,7 @@ class PGConfigFile(object):
   # is that making it a second step introduces the possibility of
   # detecting which version someone is running, based on what
   # settings do and don't exist in their postgresql.conf
-  def storeSettings(self,settingsInstance)
+  def storeSettings(self,settingsInstance):
     settings=settingsInstance
 
   # Get the current value, assuming the default if that parameter
@@ -207,7 +207,7 @@ class PGConfigFile(object):
     #print name,"min=",settings.min_val(name),"max=",settings.max_val(name) 
 
     # Construct a new settings line
-    newLineText=str(name)+" = "+str(newValue)+
+    newLineText=str(name)+" = "+str(newValue)+ \
       " # pg_generate_conf wizard "+str(datetime.date.today())
     newLine=PGConfigLine(newLineText)
 
@@ -459,9 +459,9 @@ def wizardTune(config,options,settings):
 
   # Estimate memory on this system via parameter or system lookup
   totalMemory=options.totalMemory
-  if totalMemory==None:
+  if totalMemory is None:
     totalMemory=totalMem()
-  if totalMemory==None:
+  if totalMemory is None:
     print "Error:  total memory not specified and unable to detect"
     sys.exit(1)
 
@@ -537,7 +537,7 @@ if __name__=='__main__':
   options,args=ReadOptions() 
   
   configFile=options.inputConfig
-  if configFile==None:
+  if configFile is None:
     print >> sys.stderr,"Can't do anything without an input config file; try --help"
     sys.exit(1)
     # TODO Show usage here
@@ -555,7 +555,7 @@ if __name__=='__main__':
   wizardTune(config,options)
   
   outputFileName=options.outputConfig
-  if outputFileName==None:  
+  if outputFileName is None:  
     outputFile=sys.stdout
   else:
     outputFile=open(outputFileName,'w')