Esempio n. 1
0
 def _setup_schema(self, installer_name, destination_dir):
     schema_path = os.path.join(destination_dir, installer_name,
                                "schema.sql")
     if os.path.exists(schema_path):
         try:
             installer_util.sqldotphp(self.instancedir(), schema_path)
         except Exception, e:
             raise Naive_Installer_Exception(
                 "_setup_schema: While installing, I found a schema.sql and tried to use it, but there was some issue with it.\n",
                 e)
 def _setup_schema(self, installer_name, destination_dir):
     schema_path = os.path.join(destination_dir, installer_name, "schema.sql")
     if os.path.exists(schema_path):
         try:
             installer_util.sqldotphp(self.instancedir(), schema_path)
         except Exception, e:
             raise Naive_Installer_Exception(
                 "_setup_schema: While installing, I found a schema.sql and tried to use it, but there was some issue with it.\n",
                 e,
             )
Esempio n. 3
0
def exec_drops(drops,instancedir):
	"""Execute the SQL code to drop tables, using sql.php"""
	# python 2.3-2.5
	dropfilename=tempfile.mktemp(suffix=".sql")
	dropfile=file(dropfilename,"w")
	# dropfile=tempfile.NamedTemporaryFile(delete=False) python 2.6 or later
	dropfile.write(drops)
	dropfile.close()
	try:
		installer_util.sqldotphp(instancedir,dropfile.name)	
	except Exception,e:
		raise SchemaException("exec_drops: issue occurred while dropping table",e)
Esempio n. 4
0
def exec_drops(drops, instancedir):
    """Execute the SQL code to drop tables, using sql.php"""
    # python 2.3-2.5
    dropfilename = tempfile.mktemp(suffix=".sql")
    dropfile = file(dropfilename, "w")
    # dropfile=tempfile.NamedTemporaryFile(delete=False) python 2.6 or later
    dropfile.write(drops)
    dropfile.close()
    try:
        installer_util.sqldotphp(instancedir, dropfile.name)
    except Exception, e:
        raise SchemaException(
            "exec_drops: issue occurred while dropping table", e)