[Avida-cvs] [avida-svn] r445 - branches/developers/avida-edward/source/python/AvidaGui2

baerb@myxo.css.msu.edu baerb at myxo.css.msu.edu
Wed Jan 25 09:56:14 PST 2006


Author: baerb
Date: 2006-01-25 12:56:13 -0500 (Wed, 25 Jan 2006)
New Revision: 445

Added:
   branches/developers/avida-edward/source/python/AvidaGui2/to-do_list
Modified:
   branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py
   branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogCtrl.py
   branches/developers/avida-edward/source/python/AvidaGui2/pyTemporaryReloads.py
Log:
Added To-Do list -- please feel free to add/change items.

Finished work on opening and creating new workspaces.



Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py	2006-01-21 19:59:58 UTC (rev 444)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py	2006-01-25 17:56:13 UTC (rev 445)
@@ -10,7 +10,8 @@
 from pyTwoPopulationCtrl import pyTwoPopulationCtrl
 from pyPetriConfigureCtrl import pyPetriConfigureCtrl
 from pyQuitDialogCtrl import pyQuitDialogCtrl
-import os.path
+from pyDefaultFiles import pyDefaultFiles
+import os.path, shutil
 
 
 from qt import *
@@ -29,12 +30,18 @@
     while self.m_widget_stack.visibleWidget():
       self.m_widget_stack.removeWidget(self.m_widget_stack.visibleWidget())
 
-    self.m_one_population_ctrl  = pyOnePopulationCtrl(self.m_widget_stack,  "m_one_population_ctrl")
-    self.m_two_population_ctrl  = pyTwoPopulationCtrl(self.m_widget_stack,  "m_two_population_ctrl")
-    self.m_one_organism_ctrl    = pyOneOrganismCtrl(self.m_widget_stack,    "m_one_organism_ctrl")
-    self.m_two_organism_ctrl    = pyTwoOrganismCtrl(self.m_widget_stack,    "m_two_organism_ctrl")
-    self.m_one_analyze_ctrl     = pyOneAnalyzeCtrl(self.m_widget_stack,     "m_one_analyze_ctrl")
-    self.m_two_analyze_ctrl     = pyTwoAnalyzeCtrl(self.m_widget_stack,     "m_two_analyze_ctrl")
+    self.m_one_population_ctrl  = pyOnePopulationCtrl(self.m_widget_stack,  
+                                    "m_one_population_ctrl")
+    self.m_two_population_ctrl  = pyTwoPopulationCtrl(self.m_widget_stack,  
+                                    "m_two_population_ctrl")
+    self.m_one_organism_ctrl    = pyOneOrganismCtrl(self.m_widget_stack,    
+                                    "m_one_organism_ctrl")
+    self.m_two_organism_ctrl    = pyTwoOrganismCtrl(self.m_widget_stack,    
+                                    "m_two_organism_ctrl")
+    self.m_one_analyze_ctrl     = pyOneAnalyzeCtrl(self.m_widget_stack,     
+                                    "m_one_analyze_ctrl")
+    self.m_two_analyze_ctrl     = pyTwoAnalyzeCtrl(self.m_widget_stack,     
+                                    "m_two_analyze_ctrl")
 
     for (cli, ctrl) in (
       (self.m_nav_bar_ctrl.m_one_population_cli, self.m_one_population_ctrl),
@@ -139,16 +146,58 @@
   # public slot
 
   def fileNew(self):
-    print "pyEduWorkspaceCtrl.fileNew(): Not implemented yet"
 
+    # loop till the users selects a directory name that does not exist or
+    # choses the cancel button
+
+    created = False
+    dialog_caption = "Enter the name of a new workspace"
+    while (created == False):
+      new_dir = QFileDialog.getSaveFileName(
+                    "",
+                    "Workspace (*.workspace)",
+                    None,
+                    "new workspace",
+                    dialog_caption);
+      new_dir = str(new_dir)
+      if (new_dir.strip() == ""):
+        created = True
+      else:
+        if (new_dir.endswith(".workspace") != True):
+          new_dir = new_dir + ".workspace"
+          if os.path.exists(new_dir):
+            dialog_caption = new_dir + " already exists"
+          else:
+            os.mkdir(new_dir)
+            os.mkdir(os.path.join(new_dir,"freezer"))
+            filesToCopy = ["environment.default", "inst_set.default", 
+                           "events.default", "genesis.default", 
+                           os.path.join("freezer", "default.empty"), 
+                           os.path.join("freezer", "default.organism")]
+            for fileName in filesToCopy:
+              sourceName = os.path.join(self.m_session_mdl.m_current_workspace,
+                           fileName)
+              destName = os.path.join(new_dir, fileName)
+              if (os.path.exists(sourceName)):
+                shutil.copyfile(sourceName, destName)
+              else:
+                pyDefaultFiles(fileName, destName)
+            created = True
+
   # public slot
 
   def fileOpen(self):
+
+    # self.m_session_mdl.m_current_workspace does not work correctly in this
+    # context (at least on the Mac).  It is a relative path where 
+    # getExistingDirectory seems to require an absult path
+
     workspace_dir = QFileDialog.getExistingDirectory(
-                    self.m_session_mdl.m_current_workspace,
+                    # self.m_session_mdl.m_current_workspace,
+                    "",
                     None,
-                    "get existing directory",
-                    "Choose a directory",
+                    "get existing workspace",
+                    "Choose a workspace",
                     True);
     workspace_dir = str(workspace_dir)              
 

Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogCtrl.py	2006-01-21 19:59:58 UTC (rev 444)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyRightClickDialogCtrl.py	2006-01-25 17:56:13 UTC (rev 445)
@@ -81,10 +81,6 @@
       file_dialog.show()
       file_dialog.exec_loop()
       if file_dialog.result() == True:
-        # tmp_dir = file_dialog.dir()
-        # tmp_file = file_dialog.selectedFile()
-        # print "BDB dir name = " + str(tmp_dir.path())
-        # print "BDB file name = " + str(tmp_file)
         export_file_name = os.path.join(str(file_dialog.selectedFile()),
          self.file_core_name)
         print "BDB export file name = " + str(export_file_name)

Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyTemporaryReloads.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyTemporaryReloads.py	2006-01-21 19:59:58 UTC (rev 444)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyTemporaryReloads.py	2006-01-25 17:56:13 UTC (rev 445)
@@ -43,11 +43,10 @@
 nontest_module_names = [
   "AvidaGui2.pyQuitDialogView",
   "AvidaGui2.pyQuitDialogCtrl",
-  "AvidaGui2.pyRightClickDialogView",
-  "AvidaGui2.pyRightClickDialogCtrl",
   "AvidaGui2.pyAnalyzeControlsView",
   "AvidaGui2.pyAnalyzeControlsCtrl",
   "AvidaGui2.pyAvidaStatsInterface",
+  "AvidaGui2.pyDefaultFiles",
   "AvidaGui2.pyFreezeDialogView",
   "AvidaGui2.pyFreezeDialogCtrl",
   "AvidaGui2.pyFreezeOrganismView",
@@ -77,6 +76,8 @@
   "AvidaGui2.pyPetriDishCtrl",
   "AvidaGui2.pyPopulationCellItem",
   "AvidaGui2.pyReadFreezer",
+  "AvidaGui2.pyRightClickDialogView",
+  "AvidaGui2.pyRightClickDialogCtrl",
   "AvidaGui2.pyTimelineView",
   "AvidaGui2.pyTimelineCtrl",
   "AvidaGui2.pyWriteGenesisEvent",

Added: branches/developers/avida-edward/source/python/AvidaGui2/to-do_list
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/to-do_list	2006-01-21 19:59:58 UTC (rev 444)
+++ branches/developers/avida-edward/source/python/AvidaGui2/to-do_list	2006-01-25 17:56:13 UTC (rev 445)
@@ -0,0 +1,35 @@
+16-Jan-06 Default mutation rate to 0.5? -- Brian -- Low priority (easy to change)
+
+16-Jan-06 Initial location of workspace box (ie before user can run program they must chose (or create) a workspace). -- Brian -- High Priority
+
+16-Jan-06 Non-Fix length Genomes? -- Brian -- Low priority
+
+16-Jan-06 Change header of config screen to warn users they can not change it when program is running. -- Brian -- Medium Priority
+
+16-Jan-06 Freeze button on bottom of main screen. -- Brian -- Medium Priority
+
+16-Jan-06 Get file system finished -- Brian -- High Priority
+
+16-Jan-06 Get Drag and Drop working in analyze mode and back of petri dish -- Jeff -- High Priority 
+
+16-Jan-06 Set up a temporary screen/widget to show new populations creatures dragged in before program starts running -- Jeff -- Medium Priority
+
+16-Jan-06 Get Windows version working -- Josh -- Medium to High Priority (depdnding the needs for this term)
+
+23-Jan-06 Get program to run on all Macs -- Kaben -- High Priority
+
+23-Jan-06 Remove die of old age option -- Brian -- Medium Priority
+
+23-Jan-06 Add ability to have resource control -- Brian -- Medium Priority
+
+23-Jan-06 Come up with list of 10-15 experiments that should be possible on Avida-ED -- Rich, Rob & Charles -- Medium Priority
+
+
+==============================================================================
+= DONE = DONE = DONE = DONE = DONE = DONE = DONE = DONE = DONE = DONE = DONE =
+==============================================================================
+
+16-Jan-06 Set up Angel account. -- Brian -- Medium Priority -- Finished 18-Jan-06
+
+
+




More information about the Avida-cvs mailing list