Index: /trunk/plugins/oforgeplugin/oforge/api.py
===================================================================
--- /trunk/plugins/oforgeplugin/oforge/api.py	(revision 843)
+++ /trunk/plugins/oforgeplugin/oforge/api.py	(revision 844)
@@ -618,171 +618,5 @@
 
     def _copy_ini_sections(self, src_conf, target_conf, sections, save=True):
-        for section in sectio      category = config.get('project', 'category')
-        project_display_name = config.get('project','name', name)
-        # Create the new schema/user
-        self._create_postgres_user_and_schema(new_user_schema_name, new_password)
-
-        src_db_cnx = self.getenv(name).get_db_cnx()
-        olddburl = config.get('trac', 'database')
-        config.set('trac', 'database', 
-                self._get_postgres_url(new_user_schema_name, new_password))
-        config.set('oforge', 'postgres_schema', new_user_schema_name)
-        config.save()
-        new_env = self.getenv(name)
-        target_db_cnx = new_env.get_db_cnx()
-        try:
-            # Create tables in new schema
-            DatabaseManager(new_env).init_db()
-            # This is needed to get the default data into the DB
-            # Which is required to run the upgrade method that follows
-            EnvironmentSetup(new_env).environment_created()
-            new_env.upgrade(backup=False)
-            # Get list of tables excluding ones that shouldn't be copeied
-            target_db_cursor = target_db_cnx.cursor()
-            target_db_cursor.execute("""
-                SELECT table_name 
-                FROM information_schema.tables 
-                WHERE table_schema = %s AND table_name != 'session' 
-                    AND table_name != 'auth_cookie'""", (new_user_schema_name,))
-            # Copy tables
-            for table in map(lambda r: r[0], target_db_cursor.fetchall()):
-                self.logger.debug("copying table %s"%(table))
-                self._copy_table(src_db_cnx, target_db_cnx, table)
-            # Commit all changes
-            target_db_cnx.commit()
-        except Exception, e:
-            config.set('trac','database', olddburl)
-            config.set('oforge','proj_id', None)
-            target_db_cnx.rollback()
-            master_db_cnx = self.warehouse_db_cnx()
-            master_cursor = master_db_cnx.cursor()
-            master_cursor.execute('DROP SCHEMA %s CASCADE'%(new_user_schema_name))
-            master_cursor.execute('DROP USER %s'%(new_user_schema_name))
-            master_db_cnx.commit()
-            raise 
-
-    def add_dashboard_project(self, name, tags=None):
-        """
-        Connect a project to the project dashboard.
-        """
-        env = self.getenv(name)
-        if env.config.get('oforge', 'proj_id', None):
-            raise OForgeException("Project already registered")
-        display_name = env.config.get('project', 'name')
-        type = env.config.get('project', 'category')
-        p = Project(name=name, display_name=display_name,type=type,
-                state='Open',start_date=datetime.datetime.now())
-        p.save()
-        p.tags = tags
-        p.save()
-        env.config.set('oforge', 'proj_id', p.id)
-        env.config.save()
-        return p.id
-
-    def remove_dashboard_project(self, name):
-        """
-        Disconnect a project from the project dashboard.
-        """
-        env = self.getenv(name)
-        proj_id = env.config.getint('oforge', 'proj_id', -1)
-        if proj_id != -1:
-            Project.objects.filter(id=proj_id).delete()
-            env.config.set('oforge', 'proj_id', None)
-            env.config.save()
-        else:
-            raise OForgeProjectException("Project not registered")
-
-    def createproject(self, name, **kwargs):
-        '''
-        Create an OForge project.  Takes the following dict args:
-
-         * createsvn:           Flag to stop svn repo creation
-                                default: True
-
-         * svntemplate:         Template svn structure
-                                default: none
-
-         * type:                Project type
-                                default: Client
-
-         * defaultworkspace:    Workspace to clone
-                                default: none
-
-         * admins:              Users to give admin priviledges to
-                                Comma seperated
-                                default: noone
-
-         * postgres:            Use postgres DB instead of sqlite
-                                default: True
-
-         * display_name:        Display name of project
-                                default: same as name parameter
-
-         * description:         Description of the project
-
-         * tags:                Tags for project
-
-         * copy_ini_sections:   Sections of default workspace (if any)
-                                to copy to the new environment
-                                default: ticket-workflow and ticket-custom
-        '''
-        self.logger.debug('Parsing args')
-
-        svnlocation = None
-        gitlocation = None
-        traclocation = None
-        engine = "git"
-        createsvn = kwargs.get('createsvn', False)
-        svntemplate = kwargs.get('svntemplate', None)
-        type = kwargs.get('type', 'Client')
-        defaultworkspace = kwargs.get('defaultworkspace', None)
-        admins = kwargs.get('admins', None)
-        postgres = kwargs.get('postgres', True)
-        descr = kwargs.get('description', None)
-        display_name = kwargs.get('display_name', name)
-        tags = kwargs.get('tags', None)
-        copy_ini_sections = kwargs.get('copy_ini_sections', ('ticket-custom', 
-            'ticket-workflow'))
-        tracadmin = TracAdmin()
-
-        # error handling flags
-        project_created = None
-        schema_created = None
-        user_created = None
-        env_created = None
-        svn_created = None
-        proj_id = None
-        try:
-        #added git
-            if createsvn:
-        	if engine=="svn":
-            	    svnlocation = path.join(self.config.get('oforge', 'svn_base'),name)
-            	    if not path.exists(svnlocation) and createsvn:
-                	os.makedirs(svnlocation)
-                	svn_created = True
-        	if engine=="git":
-            	    gitlocation = path.join(self.config.get('oforge', 'git_base'),name)
-            	    if not path.exists(gitlocation) and createsvn:
-                	os.makedirs(gitlocation)
-                	svn_created = True
-            
-            traclocation = path.join(self.config.get('oforge', 'trac_base'), 
-                    name)
-            dburl = None
-            if postgres:
-                new_user_schema_name = self._canonize_schema_name(name)
-                new_password = self.config.get('oforge','initial_db_password', 'secret')
-                self._create_postgres_user_and_schema(new_user_schema_name, new_password)
-                schema_created = user_created = True
-                dburl = self._get_postgres_url(new_user_schema_name, new_password)
-            self.logger.debug('Creating svn and trac dirs')
-            if not path.exists(traclocation):
-                os.makedirs(traclocation)
-            self.logger.debug('Sanity check')
-            # sanity check
-            tracadmin.env_set(traclocation)
-            if tracadmin.env_check():
-                raise OForgeProjectCreationError, \
-                ns:
+        for section in sections:
             for option in target_conf[section].options():
                 target_conf.remove(section, option[0])
