Commit 0efc02a7 authored by eric pellegrini's avatar eric pellegrini
Browse files

Rename module and assocaited classes

parent d2b02537
......@@ -35,7 +35,7 @@ import operator
import numpy
from MDANSE.Framework.UserDefinitionsStore import UD_STORE
from MDANSE.Framework.UserDefinitionStore import UD_STORE
from MDANSE.Framework.Configurators.IConfigurator import IConfigurator
from MDANSE.Framework.AtomSelectionParser import AtomSelectionParser
......
......@@ -31,7 +31,7 @@ Created on Mar 30, 2015
'''
from MDANSE import ELEMENTS
from MDANSE.Framework.UserDefinitionsStore import UD_STORE
from MDANSE.Framework.UserDefinitionStore import UD_STORE
from MDANSE.Framework.Configurators.IConfigurator import IConfigurator, ConfiguratorError
from MDANSE.Framework.AtomSelectionParser import AtomSelectionParser
......
......@@ -30,7 +30,7 @@ Created on Mar 30, 2015
:author: Eric C. Pellegrini
'''
from MDANSE.Framework.UserDefinitionsStore import UD_STORE
from MDANSE.Framework.UserDefinitionStore import UD_STORE
from MDANSE.Framework.Configurators.IConfigurator import IConfigurator
from MDANSE.MolecularDynamics.Trajectory import find_atoms_in_molecule
......
......@@ -30,7 +30,7 @@ Created on Mar 30, 2015
:author: Bachir Aoun and Eric C. Pellegrini
'''
from MDANSE.Framework.UserDefinitionsStore import UD_STORE
from MDANSE.Framework.UserDefinitionStore import UD_STORE
from MDANSE.Framework.Configurators.IConfigurator import IConfigurator
from MDANSE.MolecularDynamics.Trajectory import find_atoms_in_molecule
......
......@@ -30,7 +30,7 @@ Created on Mar 30, 2015
:author: Bachir Aoun and Eric C. Pellegrini
'''
from MDANSE.Framework.UserDefinitionsStore import UD_STORE
from MDANSE.Framework.UserDefinitionStore import UD_STORE
from MDANSE.Framework.Configurators.IConfigurator import IConfigurator
from MDANSE.MolecularDynamics.Trajectory import find_atoms_in_molecule
......
......@@ -33,7 +33,7 @@ Created on Jun 9, 2015
import os
from MDANSE.Framework.Configurators.IConfigurator import IConfigurator,ConfiguratorError
from MDANSE.Framework.UserDefinitionsStore import UD_STORE
from MDANSE.Framework.UserDefinitionStore import UD_STORE
class PartialChargeConfigurator(IConfigurator):
"""
......
......@@ -31,7 +31,7 @@ Created on May 22, 2015
'''
from MDANSE import REGISTRY
from MDANSE.Framework.UserDefinitionsStore import UD_STORE
from MDANSE.Framework.UserDefinitionStore import UD_STORE
from MDANSE.Framework.Configurators.IConfigurator import IConfigurator, ConfiguratorError
class QVectorsConfigurator(IConfigurator):
......
......@@ -40,7 +40,7 @@ from MDANSE import LOGGER, REGISTRY
from MDANSE.Externals.pubsub import pub
from MDANSE.Framework.AtomSelectionParser import AtomSelectionParser, AtomSelectionParserError
from MDANSE.Framework.Plugins.DataPlugin import get_data_plugin
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionsPlugin
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionPlugin
from MDANSE.MolecularDynamics.Trajectory import sorted_atoms
class Query(object):
......@@ -149,7 +149,7 @@ class Query(object):
self._parser = parser
class AtomSelectionPlugin(UserDefinitionsPlugin):
class AtomSelectionPlugin(UserDefinitionPlugin):
type = 'atom_selection'
......@@ -167,7 +167,7 @@ class AtomSelectionPlugin(UserDefinitionsPlugin):
pub.subscribe(self.msg_select_atoms_from_viewer, 'msg_select_atoms_from_viewer')
UserDefinitionsPlugin.__init__(self,parent,size=(800,500))
UserDefinitionPlugin.__init__(self,parent,size=(800,500))
def build_panel(self):
......
......@@ -36,7 +36,7 @@ import wx
import wx.aui as wxaui
from MDANSE import LOGGER
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionsPlugin
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionPlugin
from MDANSE.MolecularDynamics.Trajectory import find_atoms_in_molecule, get_chemical_objects_dict
class AtomNameDropTarget(wx.TextDropTarget):
......@@ -69,7 +69,7 @@ class AtomNameDropTarget(wx.TextDropTarget):
self._atoms.Append([data])
class AtomsListPlugin(UserDefinitionsPlugin):
class AtomsListPlugin(UserDefinitionPlugin):
type = 'atoms_list'
......@@ -87,7 +87,7 @@ class AtomsListPlugin(UserDefinitionsPlugin):
self._selection = []
UserDefinitionsPlugin.__init__(self,parent,size=(800,500))
UserDefinitionPlugin.__init__(self,parent,size=(800,500))
def build_panel(self):
......
......@@ -38,9 +38,9 @@ import wx.aui as wxaui
import wx.grid as wxgrid
from MDANSE import LOGGER
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionsPlugin
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionPlugin
class PartialChargesPlugin(UserDefinitionsPlugin):
class PartialChargesPlugin(UserDefinitionPlugin):
type = 'partial_charges'
......@@ -54,7 +54,7 @@ class PartialChargesPlugin(UserDefinitionsPlugin):
self._selectedAtoms = []
UserDefinitionsPlugin.__init__(self, parent)
UserDefinitionPlugin.__init__(self, parent)
def build_panel(self):
......
......@@ -38,7 +38,7 @@ import wx.grid as wxgrid
from wx.lib.delayedresult import startWorker
from MDANSE import LOGGER, REGISTRY
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionsPlugin
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionPlugin
from MDANSE.GUI.ComboWidgets.ConfigurationPanel import ConfigurationPanel
from MDANSE.GUI.ComboWidgets.ProgressBar import ProgressBar
......@@ -151,7 +151,7 @@ class QVectorsPanel(wx.Panel):
return self._progress
class QVectorsPlugin(UserDefinitionsPlugin):
class QVectorsPlugin(UserDefinitionPlugin):
type = 'q_vectors'
......@@ -165,7 +165,7 @@ class QVectorsPlugin(UserDefinitionsPlugin):
self._value = None
UserDefinitionsPlugin.__init__(self, parent,size=(800,700))
UserDefinitionPlugin.__init__(self, parent,size=(800,700))
def build_panel(self):
......
......@@ -5,11 +5,11 @@ from MDANSE import PLATFORM
from MDANSE.Core.Error import Error
from MDANSE.Core.Singleton import Singleton
class UserDefinitionsStoreError(Error):
class UserDefinitionStoreError(Error):
pass
class UserDefinitionsStore(dict):
class UserDefinitionStore(dict):
'''
This class is used to register, save and delete MDANSE user definitions (a.k.a. UD).
......@@ -34,12 +34,12 @@ class UserDefinitionsStore(dict):
Load the user definitions.
'''
if not os.path.exists(UserDefinitionsStore.UD_PATH):
if not os.path.exists(UserDefinitionStore.UD_PATH):
return
# Try to open the UD file.
try:
f = open(UserDefinitionsStore.UD_PATH, "rb")
f = open(UserDefinitionStore.UD_PATH, "rb")
UD = cPickle.load(f)
# If for whatever reason the pickle file loading failed do not even try to restore it
......@@ -59,7 +59,7 @@ class UserDefinitionsStore(dict):
'''
try:
f = open(UserDefinitionsStore.UD_PATH, "wb")
f = open(UserDefinitionStore.UD_PATH, "wb")
except IOError:
return
else:
......@@ -75,7 +75,7 @@ class UserDefinitionsStore(dict):
'''
if not self.has_definition(target,section,name):
raise UserDefinitionsStoreError('The item %r could not be found' % (target,section,name))
raise UserDefinitionStoreError('The item %r could not be found' % (target,section,name))
ud = self[target][section][name]
......@@ -99,7 +99,7 @@ class UserDefinitionsStore(dict):
def set_definition(self, target, section, name, value):
if self.has_definition(target, section, name):
raise UserDefinitionsStoreError('Item %s is already registered as an user definition. You must delete it before setting it.' % (target,section,name))
raise UserDefinitionStoreError('Item %s is already registered as an user definition. You must delete it before setting it.' % (target,section,name))
self.setdefault(target,{}).setdefault(section,{})[name] = value
......@@ -128,4 +128,4 @@ class UserDefinitionsStore(dict):
return self[target][section].has_key(name)
UD_STORE = UserDefinitionsStore()
UD_STORE = UserDefinitionStore()
......@@ -35,8 +35,8 @@ import os
import wx
from MDANSE.Externals.pubsub import pub
from MDANSE.Framework.UserDefinitionsStore import UD_STORE
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionsDialog, UserDefinitionWidget
from MDANSE.Framework.UserDefinitionStore import UD_STORE
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionDialog, UserDefinitionWidget
from MDANSE.GUI.Icons import ICONS
class AtomSelectionWidget(UserDefinitionWidget):
......@@ -152,7 +152,7 @@ if __name__ == "__main__":
app = wx.App(False)
p = UserDefinitionsDialog(None,t,'atoms_list')
p = UserDefinitionDialog(None,t,'atoms_list')
p.SetSize((800,800))
......
......@@ -34,7 +34,7 @@ import wx
from MDANSE import ELEMENTS
from MDANSE.Framework.UserDefinitionsStore import UD_STORE
from MDANSE.Framework.UserDefinitionStore import UD_STORE
from MDANSE.Framework.Widgets.AtomSelectionWidget import AtomSelectionWidget
from MDANSE.GUI.Icons import ICONS
......
......@@ -30,8 +30,8 @@ Created on Jun 30, 2015
:author: Eric C. Pellegrini
'''
from MDANSE.Framework.UserDefinitionsStore import UD_STORE
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionWidget, UserDefinitionsDialog
from MDANSE.Framework.UserDefinitionStore import UD_STORE
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionWidget, UserDefinitionDialog
class AtomListWidget(UserDefinitionWidget):
......@@ -39,7 +39,7 @@ class AtomListWidget(UserDefinitionWidget):
def on_new_user_definition(self,event):
dlg = UserDefinitionsDialog(self,self._trajectory,self.type)
dlg = UserDefinitionDialog(self,self._trajectory,self.type)
dlg.plugin.set_natoms(self._configurator._nAtoms)
......
......@@ -34,7 +34,7 @@ import os
import wx
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionsDialog, UserDefinitionWidget
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionDialog, UserDefinitionWidget
class PartialChargesWidget(UserDefinitionWidget):
......@@ -50,7 +50,7 @@ if __name__ == "__main__":
app = wx.App(False)
p = UserDefinitionsDialog(None,t,'partial_charges')
p = UserDefinitionDialog(None,t,'partial_charges')
p.SetSize((800,800))
......
......@@ -34,7 +34,7 @@ import os
import wx
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionsDialog, UserDefinitionWidget
from MDANSE.Framework.Widgets.UserDefinitionWidget import UserDefinitionDialog, UserDefinitionWidget
class QVectorsWidget(UserDefinitionWidget):
......@@ -50,7 +50,7 @@ if __name__ == "__main__":
app = wx.App(False)
p = UserDefinitionsDialog(None,t,'q_vectors')
p = UserDefinitionDialog(None,t,'q_vectors')
p.SetSize((800,800))
......
......@@ -39,11 +39,11 @@ import wx.aui as wxaui
from MDANSE import LOGGER, REGISTRY
from MDANSE.Externals.pubsub import pub
from MDANSE.Framework.Plugins.ComponentPlugin import ComponentPlugin
from MDANSE.Framework.UserDefinitionsStore import UD_STORE
from MDANSE.Framework.UserDefinitionStore import UD_STORE
from MDANSE.Framework.Widgets.IWidget import IWidget
from MDANSE.GUI import DATA_CONTROLLER
class UserDefinitionsDialog(wx.Dialog):
class UserDefinitionDialog(wx.Dialog):
def __init__(self,parent,trajectory,udType,*args,**kwargs):
......@@ -114,7 +114,7 @@ class UserDefinitionWidget(IWidget):
def on_new_definition(self,event):
dlg = UserDefinitionsDialog(None,self._trajectory,self.type)
dlg = UserDefinitionDialog(None,self._trajectory,self.type)
dlg.ShowModal()
......@@ -138,7 +138,7 @@ class UserDefinitionWidget(IWidget):
self._availableUDs.SetItems(uds)
class UserDefinitionsPlugin(ComponentPlugin):
class UserDefinitionPlugin(ComponentPlugin):
category = ('User definition',)
......
......@@ -34,7 +34,7 @@ import wx
from MDANSE import LOGGER
from MDANSE.Externals.pubsub import pub
from MDANSE.Framework.UserDefinitionsStore import UD_STORE
from MDANSE.Framework.UserDefinitionStore import UD_STORE
class UserDefinitionViewer(wx.Frame):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment