diff --git a/.gitignore b/.gitignore index 9431eae1..7b72bbae 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ docs/build .spyderproject .spyderworkspace .spyproject +.vscode \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 3a82f2d6..d1fff75f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,9 @@ branches: matrix: include: - - env: PYTHON=3.5 CONDA_PY=35 QT_VERSION=5 - env: PYTHON=3.6 CONDA_PY=36 QT_VERSION=5 - env: PYTHON=3.7 CONDA_PY=37 QT_VERSION=5 + - env: PYTHON=3.8 CONDA_PY=38 QT_VERSION=5 before_install: @@ -25,6 +25,7 @@ before_install: # Setup environment - travis_retry conda update --yes conda - conda config --set always_yes yes + - conda config --append channels conda-forge - conda config --append channels exopy - conda install conda-build anaconda-client -q - conda info -a @@ -40,7 +41,7 @@ before_install: - export CONDA_BLD_PATH=$(pwd) # Install exopy dependencies - - $CONDA_INSTALL pyqt=$QT_VERSION numpy configobj watchdog enaml>=0.10.2 qtawesome pyvisa + - $CONDA_INSTALL pyqt=$QT_VERSION numpy configobj watchdog qtawesome pyvisa enaml>=0.11.0 # Intall test tools - $CONDA_INSTALL pytest diff --git a/docs/source/dev_guide/atom_enaml.rst b/docs/source/dev_guide/atom_enaml.rst index 1cc07547..bb72c89b 100644 --- a/docs/source/dev_guide/atom_enaml.rst +++ b/docs/source/dev_guide/atom_enaml.rst @@ -15,10 +15,6 @@ duck-typing but tends to make the code easier to read. Note also that metadata can be added to a member using the :py:meth:tag method. Metadata are extensively used in Exopy. -.. note:: - - For clarity sake and Python2/3 compatibility, Unicode should be used - instead of Str. Enaml ----- diff --git a/docs/source/dev_guide/tasks.rst b/docs/source/dev_guide/tasks.rst index 5423980b..0921e159 100644 --- a/docs/source/dev_guide/tasks.rst +++ b/docs/source/dev_guide/tasks.rst @@ -61,7 +61,7 @@ used to identify the part to replace with the value stored in the database). my_int = Int(1).tag(pref=True) # Integer with a default value of 1 #: my_text description - my_text = Unicode().tag(pref=True) + my_text = Str().tag(pref=True) Tasks use a common database (which is nothing else that a kind of smart dictionary) to exchange data. If a task needs to write a value in the database @@ -123,12 +123,12 @@ simply need to tag the concerned member with 'fmt' (formatting only) or 'feval' """MyTask description. """ - value1 = Unicode().tag(feval=v.Feval(types=numbers.Real, + value1 = Str().tag(feval=v.Feval(types=numbers.Real, warn=True)) - value2 = Unicode().tag(feval=v.SkipEmpty()) + value2 = Str().tag(feval=v.SkipEmpty()) - value3 = Unicode().tag(feval=v.SkipLoop()) + value3 = Str().tag(feval=v.SkipLoop()) In the above example : @@ -370,7 +370,7 @@ implemented and the handling of the database use the same members. .. code-block:: python - from atom.api import Unicode, Int + from atom.api import Str, Int class MyInterface(TaskInterface): """MyInterface description. @@ -382,7 +382,7 @@ implemented and the handling of the database use the same members. my_int = Int(1).tag(pref=True) # Integer with a default value of 1 #: my_text description - my_text = Unicode().tag(pref=True) + my_text = Str().tag(pref=True) database_entries = set_default({'val': 1}) diff --git a/exopy/app/app_extensions.py b/exopy/app/app_extensions.py index 3c537fde..bf5ae2c0 100644 --- a/exopy/app/app_extensions.py +++ b/exopy/app/app_extensions.py @@ -9,7 +9,7 @@ """App plugin extensions declarations. """ -from atom.api import Unicode, Int +from atom.api import Str, Int from enaml.core.api import Declarative, d_, d_func @@ -22,7 +22,7 @@ class AppStartup(Declarative): """ #: The globally unique identifier for the start-up. - id = d_(Unicode()) + id = d_(Str()) #: The priority determine the order in which AppStartup are called. The #: **lowest** this number the sooner the object will be called. Two @@ -64,7 +64,7 @@ class AppClosing(Declarative): """ #: The globally unique identifier for the closing. - id = d_(Unicode()) + id = d_(Str()) @d_func def validate(self, window, event): @@ -107,7 +107,7 @@ class AppClosed(Declarative): """ #: The globally unique identifier for the closing. - id = d_(Unicode()) + id = d_(Str()) #: The priority determine the order in which AppClosed are called. The #: **lowest** this number the sooner the object will be called. Two diff --git a/exopy/app/dependencies/dependencies.py b/exopy/app/dependencies/dependencies.py index e8efaf67..cf651831 100644 --- a/exopy/app/dependencies/dependencies.py +++ b/exopy/app/dependencies/dependencies.py @@ -16,7 +16,7 @@ also drivers classes and intsrument profiles (runtime) """ -from atom.api import (Unicode) +from atom.api import (Str) from enaml.core.api import Declarative, d_, d_func @@ -31,7 +31,7 @@ class BuildDependency(Declarative): """ #: Unique id for this extension. Should match the dep_type attribute value #: of the object it is meant for. - id = d_(Unicode()) + id = d_(Str()) @d_func def analyse(self, workbench, obj, getter, dependencies, errors): @@ -125,11 +125,11 @@ class RuntimeDependencyAnalyser(Declarative): """ #: Unique id for this extension. - id = d_(Unicode()) + id = d_(Str()) #: Id of the collector that should be used to collect the dependencies #: discovered during analysis. - collector_id = d_(Unicode()) + collector_id = d_(Str()) @d_func def analyse(self, workbench, obj, dependencies, errors): @@ -164,7 +164,7 @@ class RuntimeDependencyCollector(Declarative): """ #: Unique id for this extension. - id = d_(Unicode()) + id = d_(Str()) @d_func def validate(self, workbench, dependencies, errors): diff --git a/exopy/app/errors/errors.py b/exopy/app/errors/errors.py index d24785a4..9d45a1a3 100644 --- a/exopy/app/errors/errors.py +++ b/exopy/app/errors/errors.py @@ -9,7 +9,7 @@ """Declarations for the extensions to the error plugin. """ -from atom.api import Unicode +from atom.api import Str from enaml.core.api import Declarative, d_, d_func @@ -18,11 +18,11 @@ class ErrorHandler(Declarative): """ #: Id of the error. When signaling errors it will referred to as the kind. - id = d_(Unicode()) + id = d_(Str()) #: Short description of what this handler can do. The keyword for the #: handle method should be specified. - description = d_(Unicode()) + description = d_(Str()) @d_func def handle(self, workbench, infos): diff --git a/exopy/app/icons/icon_theme.py b/exopy/app/icons/icon_theme.py index 819a9297..9612daf8 100644 --- a/exopy/app/icons/icon_theme.py +++ b/exopy/app/icons/icon_theme.py @@ -9,7 +9,7 @@ """Extension objects to the icon plugin. """ -from atom.api import Unicode, Dict, List +from atom.api import Str, Dict, List from enaml.core.api import Declarative, d_, d_func @@ -25,7 +25,7 @@ class IconTheme(Declarative): """ #: Unique id of the icon theme. - id = d_(Unicode()) + id = d_(Str()) @d_func def get_icon(self, manager, icon_id): @@ -77,10 +77,10 @@ class IconThemeExtension(Declarative): """ #: Unicsue id of the extension. - id = d_(Unicode()) + id = d_(Str()) #: Id of the icon theme to which to contribute the children Icon objects. - theme = d_(Unicode()) + theme = d_(Str()) def icons(self): """List the associated icons. @@ -103,7 +103,7 @@ class Icon(Declarative): """ #: Unique id describing the icon. It should provide a clear description #: of the icon purpose. - id = d_(Unicode()) + id = d_(Str()) @d_func def get_icon(self, manager, theme): diff --git a/exopy/app/icons/plugin.py b/exopy/app/icons/plugin.py index c6ec105e..fc6867bd 100644 --- a/exopy/app/icons/plugin.py +++ b/exopy/app/icons/plugin.py @@ -11,7 +11,7 @@ """ import logging -from atom.api import List, Typed, Unicode +from atom.api import List, Typed, Str from .icon_theme import IconTheme, IconThemeExtension from ...utils.traceback import format_exc @@ -29,11 +29,11 @@ class IconManagerPlugin(HasPreferencesPlugin): """ #: Id of the currently selected icon theme - current_theme = Unicode('exopy.FontAwesome').tag(pref=True) + current_theme = Str('exopy.FontAwesome').tag(pref=True) #: Id of the icon theme to use as fallback if a theme fail to provide an #: icon. - fallback_theme = Unicode('exopy.FontAwesome').tag(pref=True) + fallback_theme = Str('exopy.FontAwesome').tag(pref=True) #: Registered icon themes ids icon_themes = List() diff --git a/exopy/app/log/plugin.py b/exopy/app/log/plugin.py index c41c98fa..8b8e63d9 100644 --- a/exopy/app/log/plugin.py +++ b/exopy/app/log/plugin.py @@ -12,7 +12,7 @@ import os import logging -from atom.api import Unicode, Dict, List, Tuple, Typed +from atom.api import Str, Dict, List, Tuple, Typed from enaml.workbench.api import Plugin from .tools import (LogModel, GuiHandler, DayRotatingTimeHandler) @@ -30,10 +30,10 @@ class LogPlugin(Plugin): """ #: List of installed handlers. - handler_ids = List(Unicode()) + handler_ids = List(Str()) #: List of installed filters. - filter_ids = List(Unicode()) + filter_ids = List(Str()) #: Model which can be used to display the log in the GUI. It is associated #: to a handler attached to the root logger. @@ -197,7 +197,7 @@ def set_formatter(self, handler_id, formatter): # ---- Private API -------------------------------------------------------- # Mapping between handler ids and handler, logger name pairs. - _handlers = Dict(Unicode(), Tuple()) + _handlers = Dict(Str(), Tuple()) # Mapping between filter_id and filter, handler_id pairs. - _filters = Dict(Unicode(), Tuple()) + _filters = Dict(Str(), Tuple()) diff --git a/exopy/app/log/tools.py b/exopy/app/log/tools.py index b49ed137..48b18f0a 100644 --- a/exopy/app/log/tools.py +++ b/exopy/app/log/tools.py @@ -32,7 +32,7 @@ from logging.handlers import TimedRotatingFileHandler from threading import Thread from enaml.application import deferred_call -from atom.api import Atom, Unicode, Int +from atom.api import Atom, Str, Int import codecs @@ -199,7 +199,7 @@ class LogModel(Atom): """ #: Text representing all the messages sent by the handler. #: Should not be altered by user code. - text = Unicode() + text = Str() #: Maximum number of lines. buff_size = Int(1000) diff --git a/exopy/app/preferences/plugin.py b/exopy/app/preferences/plugin.py index bc4377d1..7778bf23 100644 --- a/exopy/app/preferences/plugin.py +++ b/exopy/app/preferences/plugin.py @@ -10,7 +10,7 @@ """ import os -from atom.api import Unicode, Typed, Dict +from atom.api import Str, Typed, Dict from enaml.workbench.api import Plugin from configobj import ConfigObj from functools import partial @@ -29,10 +29,10 @@ class PrefPlugin(Plugin): """ #: Folder used by the application to store informations such as preferences #: log files, ... - app_directory = Unicode() + app_directory = Str() #: Path of the last location visited using a dialog. - last_directory = Unicode() + last_directory = Str() def start(self): """Start the plugin, locate app folder and load default preferences. diff --git a/exopy/app/preferences/preferences.py b/exopy/app/preferences/preferences.py index 50e1d8c9..db5c7940 100644 --- a/exopy/app/preferences/preferences.py +++ b/exopy/app/preferences/preferences.py @@ -9,7 +9,7 @@ """Declarative class for defining hnadling of preferences. """ -from atom.api import List, Unicode +from atom.api import List, Str from enaml.core.api import Declarative, d_, d_func @@ -22,11 +22,11 @@ class Preferences(Declarative): """ #: Name of the method of the plugin contributing this extension to call #: when the preference plugin need to save the preferences. - saving_method = d_(Unicode('preferences_from_members')) + saving_method = d_(Str('preferences_from_members')) #: Name of the method of the plugin contributing this extension to call #: when the preference plugin need to load preferences. - loading_method = d_(Unicode('update_members_from_preferences')) + loading_method = d_(Str('update_members_from_preferences')) #: The list of plugin members whose values should be observed and whose #: update should cause and automatic update of the preferences. diff --git a/exopy/app/states/state.py b/exopy/app/states/state.py index 98ed580f..fc88449b 100644 --- a/exopy/app/states/state.py +++ b/exopy/app/states/state.py @@ -9,7 +9,7 @@ """State plugin extension declaration. """ -from atom.api import (List, Unicode) +from atom.api import (List, Str) from enaml.core.api import Declarative, d_ @@ -21,11 +21,11 @@ class State(Declarative): """ #: The globally unique identifier for the state - id = d_(Unicode()) + id = d_(Str()) #: An optional description of what the state provides. - description = d_(Unicode()) + description = d_(Str()) #: The list of plugin members whose values should be reflected in the #: state object - sync_members = d_(List(Unicode())) + sync_members = d_(List(Str())) diff --git a/exopy/instruments/connections/base_connection.py b/exopy/instruments/connections/base_connection.py index 91a91bd3..6bbce4c1 100644 --- a/exopy/instruments/connections/base_connection.py +++ b/exopy/instruments/connections/base_connection.py @@ -14,7 +14,7 @@ starter used to instantiate the driver. """ -from atom.api import Unicode, ForwardTyped, Bool +from atom.api import Str, ForwardTyped, Bool from enaml.core.api import d_, Declarative, d_func from enaml.widgets.api import GroupBox @@ -45,10 +45,10 @@ class Connection(Declarative): """ #: Unique name used to identify the connection. - id = d_(Unicode()) + id = d_(Str()) #: Connection description. - description = d_(Unicode()) + description = d_(Str()) @d_func def new(self, workbench, defaults, read_only): diff --git a/exopy/instruments/drivers/driver_decl.py b/exopy/instruments/drivers/driver_decl.py index dd9a56a8..1ba7ca1b 100644 --- a/exopy/instruments/drivers/driver_decl.py +++ b/exopy/instruments/drivers/driver_decl.py @@ -9,7 +9,7 @@ """Declarator for registering drivers. """ -from atom.api import Unicode, Dict, Property, Enum +from atom.api import Str, Dict, Property, Enum from enaml.core.api import d_ from ...utils.traceback import format_exc @@ -25,24 +25,24 @@ class Driver(Declarator): #: name preceded by ':'. #: TODO complete : ex: exopy_hqc_legacy.instruments. #: The path of any parent Drivers object will be prepended to it. - driver = d_(Unicode()) + driver = d_(Str()) #: Name identifying the system the driver is built on top of (lantz, hqc, #: slave, etc ...). Allow to handle properly multiple drivers declared in #: a single extension package for the same instrument. - architecture = d_(Unicode()) + architecture = d_(Str()) #: Name of the instrument manufacturer. Can be inferred from parent #: Drivers. - manufacturer = d_(Unicode()) + manufacturer = d_(Str()) #: Serie this instrument is part of. This is optional as it does not always #: make sense to be specified but in some cases it can help finding a #: a driver. Can be inferred from parent Drivers. - serie = d_(Unicode()) + serie = d_(Str()) #: Model of the instrument this driver has been written for. - model = d_(Unicode()) + model = d_(Str()) #: Kind of the instrument, to ease instrument look up. If no kind match, #: leave 'Other' as the kind. Can be inferred from parent @@ -51,7 +51,7 @@ class Driver(Declarator): #: Starter to use when initializing/finialzing this driver. #: Can be inferred from parent Drivers. - starter = d_(Unicode()) + starter = d_(Str()) #: Supported connections and default values for some parameters. The #: admissible values for a given kind can be determined by looking at the @@ -264,19 +264,19 @@ class Drivers(GroupDeclarator): """ #: Name identifying the system the driver is built on top of for the #: declared children. - architecture = d_(Unicode()) + architecture = d_(Str()) #: Instrument manufacturer of the declared children. - manufacturer = d_(Unicode()) + manufacturer = d_(Str()) #: Serie of the declared children. - serie = d_(Unicode()) + serie = d_(Str()) #: Kind of the declared children. kind = d_(Enum(None, *INSTRUMENT_KINDS)) #: Starter to use for the declared children. - starter = d_(Unicode()) + starter = d_(Str()) #: Supported connections of the declared children. connections = d_(Dict()) diff --git a/exopy/instruments/infos.py b/exopy/instruments/infos.py index 9fc28e4a..3c68a76d 100644 --- a/exopy/instruments/infos.py +++ b/exopy/instruments/infos.py @@ -14,7 +14,7 @@ from operator import attrgetter from configobj import ConfigObj -from atom.api import (Atom, Unicode, Dict, Callable, List, Property, Typed, +from atom.api import (Atom, Str, Dict, Callable, List, Property, Typed, Bool, Enum, Value) from ..utils.mapping_utils import recursive_update @@ -29,7 +29,7 @@ class DriverInfos(Atom): """ #: Id of the driver built on the class name and the top-level package - id = Unicode() + id = Str() #: Actual class to use as driver. cls = Callable() @@ -38,7 +38,7 @@ class DriverInfos(Atom): infos = Dict() #: Starter id - starter = Unicode() + starter = Str() #: Connection information. connections = Dict() @@ -101,13 +101,13 @@ class InstrumentModelInfos(Atom): """ #: Instrument manufacturer (this is the real manufacturer not an alias). - manufacturer = Unicode() + manufacturer = Str() #: Instrument model. - model = Unicode() + model = Str() #: Instrument serie. - serie = Unicode() + serie = Str() #: Instrument kind. kind = Enum(*INSTRUMENT_KINDS) @@ -186,7 +186,7 @@ class SeriesInfos(Atom): """ #: Name of the serie. - name = Unicode() + name = Str() #: List of the instrument models matching the selected kind. #: This object should not be manipulated by user code. @@ -333,7 +333,7 @@ class ManufacturersHolder(Atom): use_series = Bool(True) #: Expose the known instruments only of the matching kind. - kind = Unicode('All') + kind = Str('All') def update_manufacturers(self, drivers, removed=False): """Update a manufacturer infos and create it if it does not exist yet. @@ -411,13 +411,13 @@ class ProfileInfos(Atom): """ #: Path to the .ini file holding the full infos. - path = Unicode() + path = Str() #: Reference to the instrument plugin. plugin = Value() #: Profile id. - id = Unicode() + id = Str() #: Supported model model = Typed(InstrumentModelInfos) diff --git a/exopy/instruments/manufacturer_aliases.py b/exopy/instruments/manufacturer_aliases.py index 7e3fc68a..b7d97016 100644 --- a/exopy/instruments/manufacturer_aliases.py +++ b/exopy/instruments/manufacturer_aliases.py @@ -11,7 +11,7 @@ ex : Keysight : aliases Agilent, HP """ -from atom.api import Unicode, List +from atom.api import Str, List from enaml.core.api import Declarative, d_ @@ -20,7 +20,7 @@ class ManufacturerAlias(Declarative): """ #: Main name under which the vendor is expected to be known - id = d_(Unicode()) + id = d_(Str()) #: List of aliased names. aliases = d_(List()) diff --git a/exopy/instruments/settings/base_settings.py b/exopy/instruments/settings/base_settings.py index cf004d5e..99edc396 100644 --- a/exopy/instruments/settings/base_settings.py +++ b/exopy/instruments/settings/base_settings.py @@ -12,7 +12,7 @@ if several are available for example. """ -from atom.api import Unicode, ForwardTyped, Bool +from atom.api import Str, ForwardTyped, Bool from enaml.core.api import d_, Declarative, d_func from enaml.widgets.api import GroupBox @@ -23,7 +23,7 @@ class BaseSettings(GroupBox): """ #: Id of this settings (different from the declaration one as multiple #: settings of the same type can exist for a single instrument). - user_id = d_(Unicode()) + user_id = d_(Str()) #: Reference to the declaration that created this object. declaration = d_(ForwardTyped(lambda: Settings)) @@ -58,10 +58,10 @@ class Settings(Declarative): """ #: Unique name used to identify the editor. - id = d_(Unicode()) + id = d_(Str()) #: Connection description. - description = d_(Unicode()) + description = d_(Str()) @d_func def new(self, workbench, defaults, read_only): diff --git a/exopy/instruments/starters/base_starter.py b/exopy/instruments/starters/base_starter.py index cc395287..854b034d 100644 --- a/exopy/instruments/starters/base_starter.py +++ b/exopy/instruments/starters/base_starter.py @@ -9,7 +9,7 @@ """Tool handling initializind/finalizing a driver. """ -from atom.api import Atom, Unicode, Typed +from atom.api import Atom, Str, Typed from enaml.core.api import Declarative, d_ @@ -18,7 +18,7 @@ class BaseStarter(Atom): """ #: Id of the starter set by the declaration. - id = Unicode() + id = Str() def start(self, driver_cls, connection, settings): """Fully initialize a driver and open the communication channel. @@ -101,10 +101,10 @@ class Starter(Declarative): """ #: Unique id identifying this starter. #: The usual format is top_level_package_name.starter_name - id = d_(Unicode()) + id = d_(Str()) #: Description of the starter action. - description = d_(Unicode()) + description = d_(Str()) #: Starter instance to use for managing associate instruments. #: Note that the class must be defined in a python file not enaml file diff --git a/exopy/instruments/user.py b/exopy/instruments/user.py index b1620518..af927dba 100644 --- a/exopy/instruments/user.py +++ b/exopy/instruments/user.py @@ -9,7 +9,7 @@ """Declaration of plugin susceptible to use instruments """ -from atom.api import Enum, Unicode +from atom.api import Enum, Str from enaml.core.declarative import Declarative, d_, d_func @@ -20,7 +20,7 @@ class InstrUser(Declarative): #: Plugin id associated with this use of instrument. This allow the manager #: to know what part of the application requested the right to use some #: drivers. - id = d_(Unicode()) + id = d_(Str()) #: Is the plugin susceptible to release the profiles it is currently using #: if the manager asks it to do so. diff --git a/exopy/measurement/base_tool.py b/exopy/measurement/base_tool.py index 05e72e9b..a837ff60 100644 --- a/exopy/measurement/base_tool.py +++ b/exopy/measurement/base_tool.py @@ -24,7 +24,7 @@ """ import sys -from atom.api import ForwardTyped, Unicode, Bool +from atom.api import ForwardTyped, Str, Bool from enaml.core.api import Declarative, d_, d_func from ..utils.atom_util import HasPrefAtom @@ -102,10 +102,10 @@ class BaseToolDeclaration(Declarative): """ #: Unique name used to identify the tool. #: The usual format is top_level_package_name.tool_name - id = d_(Unicode()) + id = d_(Str()) #: Description of the tool. - description = d_(Unicode()) + description = d_(Str()) #: Flag indicating whether the tool has an associated parametrisation #: widget. diff --git a/exopy/measurement/editors/base_editor.py b/exopy/measurement/editors/base_editor.py index cc7b1d78..eb88168a 100644 --- a/exopy/measurement/editors/base_editor.py +++ b/exopy/measurement/editors/base_editor.py @@ -9,7 +9,7 @@ """Base classes for all editors. """ -from atom.api import Unicode, Typed, Bool, ForwardTyped, Int +from atom.api import Str, Typed, Bool, ForwardTyped, Int from enaml.core.api import Declarative, d_, d_func from enaml.widgets.api import Page @@ -80,10 +80,10 @@ class Editor(Declarative): """ #: Unique name used to identify the editor. #: The usual format is top_level_package_name.tool_name - id = d_(Unicode()) + id = d_(Str()) #: Editor description. - description = d_(Unicode()) + description = d_(Str()) #: Rank of this editor. Editors are displayed by rank and alphabetical #: order diff --git a/exopy/measurement/engines/base_engine.py b/exopy/measurement/engines/base_engine.py index 16629611..a74a29cf 100644 --- a/exopy/measurement/engines/base_engine.py +++ b/exopy/measurement/engines/base_engine.py @@ -9,7 +9,7 @@ """Base classes for all engines """ -from atom.api import (Atom, Unicode, ForwardTyped, Signal, Enum, Bool, Dict, +from atom.api import (Atom, Str, ForwardTyped, Signal, Enum, Bool, Dict, Value, List) from enaml.core.api import Declarative, d_, d_func @@ -22,7 +22,7 @@ class ExecutionInfos(Atom): """ #: Id used to identify the task in logger messages. - id = Unicode() + id = Str() #: Task to execute. task = Value() @@ -145,10 +145,10 @@ class Engine(Declarative): """ #: Unique name used to identify the engine. Should be user understandable. - id = d_(Unicode()) + id = d_(Str()) #: Description of the engine - description = d_(Unicode()) + description = d_(Str()) @d_func def new(self, workbench, default=True): diff --git a/exopy/measurement/engines/process_engine/engine_declaration.enaml b/exopy/measurement/engines/process_engine/engine_declaration.enaml index 179b200d..48fd3ef1 100644 --- a/exopy/measurement/engines/process_engine/engine_declaration.enaml +++ b/exopy/measurement/engines/process_engine/engine_declaration.enaml @@ -9,7 +9,7 @@ """Declaration of the ProcessEngine and workspace related contribution. """ -from atom.api import Atom, Bool, Unicode +from atom.api import Atom, Bool, Str from enaml.workbench.api import PluginManifest, Extension from enaml.widgets.api import DockItem, Container, Menu, Action from enaml.layout.api import InsertItem, RemoveItem @@ -25,7 +25,7 @@ class ProcFilter(Atom): """ #: Name of the process from which to accept records. - process_name = Unicode('exopy.MeasureProcess') + process_name = Str('exopy.MeasureProcess') # Bool indicating whether to reject if the process name is wrong (False), # or reject if the process name is right (True). diff --git a/exopy/measurement/measurement.py b/exopy/measurement/measurement.py index 10d330cb..0d0f3a13 100644 --- a/exopy/measurement/measurement.py +++ b/exopy/measurement/measurement.py @@ -15,7 +15,7 @@ from itertools import chain from datetime import date, datetime -from atom.api import (Atom, Dict, Unicode, Typed, ForwardTyped, Bool, Enum, +from atom.api import (Atom, Dict, Str, Typed, ForwardTyped, Bool, Enum, Value) from configobj import ConfigObj @@ -316,12 +316,12 @@ class Measurement(HasPrefAtom): """ #: Name of the measurement. - name = Unicode().tag(pref=True) + name = Str().tag(pref=True) #: Id of that particular iteration of the measurement. This value is used #: when saving the measurement before running it. It is also communicated #: to the root task - id = Unicode().tag(pref=True) + id = Str().tag(pref=True) #: Current measurement status. status = Enum('READY', 'RUNNING', 'PAUSING', 'PAUSED', 'RESUMING', @@ -329,10 +329,10 @@ class Measurement(HasPrefAtom): 'INTERRUPTED') #: Detailed information about the measurement status. - infos = Unicode() + infos = Str() #: Path to the last file in which that measurement was saved. - path = Unicode() + path = Str() #: Root task holding the measurement logic. root_task = Typed(RootTask) diff --git a/exopy/measurement/monitors/text_monitor/custom_entry_edition.enaml b/exopy/measurement/monitors/text_monitor/custom_entry_edition.enaml index 5e6a8b9a..498fd6cf 100644 --- a/exopy/measurement/monitors/text_monitor/custom_entry_edition.enaml +++ b/exopy/measurement/monitors/text_monitor/custom_entry_edition.enaml @@ -11,7 +11,7 @@ """ from collections import Counter -from atom.api import (Atom, Unicode, List, Dict) +from atom.api import (Atom, Str, List, Dict) from enaml.widgets.api import (ObjectCombo, Dialog, Container, Field, Label, PushButton) from enaml.layout.api import hbox, vbox, spacer @@ -26,7 +26,7 @@ class _Entry(Atom): """ #: Selected database entry. - entry = Unicode() + entry = Str() #: All database entries that can be used. entries = List() diff --git a/exopy/measurement/monitors/text_monitor/entry.py b/exopy/measurement/monitors/text_monitor/entry.py index 72c80a1e..417d19e1 100644 --- a/exopy/measurement/monitors/text_monitor/entry.py +++ b/exopy/measurement/monitors/text_monitor/entry.py @@ -9,7 +9,7 @@ """Entries that can be displayed by the text monitor. """ -from atom.api import (Unicode, List) +from atom.api import (Str, List) from enaml.application import deferred_call from exopy.utils.atom_util import HasPrefAtom @@ -20,16 +20,16 @@ class MonitoredEntry(HasPrefAtom): """ #: User understandable name of the monitored entry. - name = Unicode().tag(pref=True) + name = Str().tag(pref=True) #: Full name of the entry as found or built from the database. - path = Unicode().tag(pref=True) + path = Str().tag(pref=True) #: Formatting of the entry. - formatting = Unicode().tag(pref=True) + formatting = Str().tag(pref=True) #: Current value that the monitor should display. - value = Unicode() + value = Str() #: List of database entries the entry depend_on. depend_on = List().tag(pref=True) diff --git a/exopy/measurement/monitors/text_monitor/rules/base.py b/exopy/measurement/monitors/text_monitor/rules/base.py index 06d64b8a..cba231ed 100644 --- a/exopy/measurement/monitors/text_monitor/rules/base.py +++ b/exopy/measurement/monitors/text_monitor/rules/base.py @@ -12,7 +12,7 @@ """ from inspect import cleandoc -from atom.api import Unicode, List, Dict +from atom.api import Str, List, Dict from enaml.core.api import Declarative, d_ from .....utils.traceback import format_exc @@ -26,17 +26,17 @@ class BaseRule(HasPrefAtom): """ #: Name of the rule. - id = Unicode().tag(pref=True) + id = Str().tag(pref=True) #: Quick description of what this rule is intended for. - description = d_(Unicode()).tag(pref=True) + description = d_(Str()).tag(pref=True) #: List of database entries suffixes used to identify the entries which #: contributes to the rule. suffixes = List(default=['']).tag(pref=True) #: Id of the class used for persistence. - class_id = Unicode().tag(pref=True) + class_id = Str().tag(pref=True) def try_apply(self, new_entry, monitor): """ Attempt to apply the rule. @@ -75,11 +75,11 @@ class RuleType(Declarator): #: name preceded by ':'. #: ex: exopy.measurement.monitors.text_monitor.std_rules:RejectRule #: The path of any parent GroupDeclarator object will be prepended to it. - rule = d_(Unicode()) + rule = d_(Str()) #: Path to the view object associated with the task. #: The path of any parent GroupDeclarator object will be prepended to it. - view = d_(Unicode()) + view = d_(Str()) def register(self, collector, traceback): """Collect rule and view and store them into the DeclaratorCollector @@ -189,14 +189,14 @@ class RuleConfig(Declarative): """ #: Id of this rule configuration this should be unique. - id = d_(Unicode()) + id = d_(Str()) #: Quick description of what this rule is intended for. - description = d_(Unicode()) + description = d_(Str()) #: Id of the rule to use. This is dot separated string containing the #: name of the package defining the rule type and the rule type name. - rule_type = d_(Unicode()) + rule_type = d_(Str()) #: Configuration dictionary to use to instantiate the rule config = d_(Dict()) diff --git a/exopy/measurement/monitors/text_monitor/rules/std_rules.py b/exopy/measurement/monitors/text_monitor/rules/std_rules.py index 78432756..08aa3956 100644 --- a/exopy/measurement/monitors/text_monitor/rules/std_rules.py +++ b/exopy/measurement/monitors/text_monitor/rules/std_rules.py @@ -10,7 +10,7 @@ TextMonitor. """ -from atom.api import (Unicode, Bool) +from atom.api import (Str, Bool) from ..entry import MonitoredEntry from .base import BaseRule @@ -42,10 +42,10 @@ class FormatRule(BaseRule): """ #: The format in which the new entry created by the rule should be #: displayed - new_entry_formatting = Unicode().tag(pref=True) + new_entry_formatting = Str().tag(pref=True) #: The suffix of the new entry created by the rule. - new_entry_suffix = Unicode().tag(pref=True) + new_entry_suffix = Str().tag(pref=True) #: Whether or not to hide the entries used by the rules. hide_entries = Bool(True).tag(pref=True) diff --git a/exopy/measurement/plugin.py b/exopy/measurement/plugin.py index 76a89390..d4a2758b 100644 --- a/exopy/measurement/plugin.py +++ b/exopy/measurement/plugin.py @@ -13,7 +13,7 @@ import os from functools import partial -from atom.api import Typed, Unicode, List, ForwardTyped, Enum, Bool, Dict +from atom.api import Typed, Str, List, ForwardTyped, Enum, Bool, Dict from ..utils.plugin_tools import (HasPreferencesPlugin, ExtensionsCollector, make_extension_validator) @@ -76,7 +76,7 @@ class MeasurementPlugin(HasPreferencesPlugin): #: Reference to the last directory from/in which a measurement was #: loaded/saved - path = Unicode().tag(pref=True) + path = Str().tag(pref=True) #: Currently edited measurements. edited_measurements = Typed(MeasurementContainer, ()) @@ -91,7 +91,7 @@ class MeasurementPlugin(HasPreferencesPlugin): engines = List() #: Currently selected engine represented by its id. - selected_engine = Unicode().tag(pref=True) + selected_engine = Str().tag(pref=True) #: What to do of the engine when there is no more measurement to perform. engine_policy = Enum('stop', 'sleep').tag(pref=True) diff --git a/exopy/tasks/configs/base_configs.py b/exopy/tasks/configs/base_configs.py index 31874c8f..41754010 100644 --- a/exopy/tasks/configs/base_configs.py +++ b/exopy/tasks/configs/base_configs.py @@ -11,7 +11,7 @@ """ import random -from atom.api import (Atom, Bool, Unicode, Subclass, ForwardTyped, Typed) +from atom.api import (Atom, Bool, Str, Subclass, ForwardTyped, Typed) from inspect import getdoc @@ -40,7 +40,7 @@ class BaseTaskConfig(Atom): manager = ForwardTyped(task_manager) #: Name of the task to create. - task_name = Unicode() + task_name = Str() #: Class of the task to create. task_class = Subclass(BaseTask) @@ -113,7 +113,7 @@ class PyTaskConfig(BaseTaskConfig): """ # Docstring of the class to help pepole know what they are going to create. - task_doc = Unicode() + task_doc = Str() def __init__(self, **kwargs): super(PyTaskConfig, self).__init__(**kwargs) @@ -131,10 +131,10 @@ class TemplateTaskConfig(BaseTaskConfig): """ #: Path to the file storing the hierarchy. - template_path = Unicode() + template_path = Str() #: Description of the template. - template_doc = Unicode() + template_doc = Str() def __init__(self, **kwargs): super(TemplateTaskConfig, self).__init__(**kwargs) diff --git a/exopy/tasks/configs/loop_config.py b/exopy/tasks/configs/loop_config.py index 440be2e5..8e6151ae 100644 --- a/exopy/tasks/configs/loop_config.py +++ b/exopy/tasks/configs/loop_config.py @@ -9,7 +9,7 @@ """Configurer dedicated to the LoopTask allowing to specify a task to embed. """ -from atom.api import (Typed, Unicode, Bool) +from atom.api import (Typed, Str, Bool) from .base_configs import PyTaskConfig, BaseTaskConfig from .base_config_views import BaseConfigView @@ -23,7 +23,7 @@ class LoopTaskConfig(PyTaskConfig): use_subtask = Bool() #: Embedded task id. - subtask = Unicode() + subtask = Str() #: Configurer for the subtask. subconfig = Typed(BaseTaskConfig) diff --git a/exopy/tasks/declarations.py b/exopy/tasks/declarations.py index 94a3a726..1643b243 100644 --- a/exopy/tasks/declarations.py +++ b/exopy/tasks/declarations.py @@ -11,7 +11,7 @@ """ from inspect import cleandoc -from atom.api import Unicode, List, Value, Dict, Property +from atom.api import Str, List, Value, Dict, Property from enaml.core.api import d_, d_func from .infos import TaskInfos, InterfaceInfos, ConfigInfos @@ -59,11 +59,11 @@ class Task(Declarator): #: updated that way), one can specify the name of the top level package #: in which the task is defined followed by its name. #: ex: exopy.LoopTask - task = d_(Unicode()) + task = d_(Str()) #: Path to the view object associated with the task. #: The path of any parent GroupDeclarator object will be prepended to it. - view = d_(Unicode()) + view = d_(Str()) #: Metadata associated to the task. ex : loopable = True metadata = d_(Dict()) @@ -265,7 +265,7 @@ class Interface(Declarator): #: Example : #: exopy.tasks.tasks.logic.loop_linspace_interface:LinspaceLoopInterface #: The path of any parent GroupDeclarator object will be prepended to it. - interface = d_(Unicode()) + interface = d_(Str()) #: Path or tuple of paths to the view objects associated with the interface #: The path of any parent GroupDeclarator object will be prepended to it. @@ -513,11 +513,11 @@ class TaskConfig(Declarator): #: name preceded by ':'. #: ex: exopy.tasks.config.base_config:PyConfigTask #: The path of any parent GroupDeclarator object will be prepended to it. - config = d_(Unicode()) + config = d_(Str()) #: Path to the view object associated with the task. #: The path of any parent GroupDeclarator object will be prepended to it. - view = d_(Unicode()) + view = d_(Str()) #: Id of the config computed from the top-level package and the config name id = Property(cached=True) diff --git a/exopy/tasks/filters.py b/exopy/tasks/filters.py index f5dab8ca..81fd6d01 100644 --- a/exopy/tasks/filters.py +++ b/exopy/tasks/filters.py @@ -11,7 +11,7 @@ The filter available by default are declared in the manager manifest. """ -from atom.api import Value, Subclass, Unicode, Property, set_default +from atom.api import Value, Subclass, Str, Property, set_default from enaml.core.api import d_func, d_ from .tasks.base_tasks import BaseTask @@ -23,7 +23,7 @@ class TaskFilter(Declarator): """ #: Unique id of this filter (also used as a name). - id = d_(Unicode()) + id = d_(Str()) @d_func def filter_tasks(self, tasks, templates): @@ -69,7 +69,7 @@ class MetadataTaskFilter(TaskFilter): """ #: Metadata key to match. - meta_key = d_(Unicode()) + meta_key = d_(Str()) #: Metadata value to match. meta_value = d_(Value()) @@ -90,7 +90,7 @@ class GroupTaskFilter(MetadataTaskFilter): """ #: Group to which the tasks must belong. - group = d_(Unicode()) + group = d_(Str()) meta_key = set_default('group') diff --git a/exopy/tasks/infos.py b/exopy/tasks/infos.py index dcb00e02..8e39794d 100644 --- a/exopy/tasks/infos.py +++ b/exopy/tasks/infos.py @@ -9,7 +9,7 @@ """Objects used to store tasks, interfaces and configs in the manager. """ -from atom.api import (Atom, List, Subclass, Dict, Coerced, Typed, Unicode, +from atom.api import (Atom, List, Subclass, Dict, Coerced, Typed, Str, set_default) import enaml @@ -39,11 +39,11 @@ class ObjectDependentInfos(Atom): """ #: Id of the runtime dependency analyser to use for driver detection to add #: to the dependencies if instruments is set. - DRIVER_ANALYSER = Unicode() + DRIVER_ANALYSER = Str() #: Id of the runtime dependency analyser to use for profile detection to #: add to the dependencies if instruments is set. - PROFILE_ANALYSER = Unicode() + PROFILE_ANALYSER = Str() #: Set of instrument supported by this task. This should never be updated #: in place, it should always be copied and replaced by the new value. diff --git a/exopy/tasks/plugin.py b/exopy/tasks/plugin.py index 6f854615..b74a8b02 100644 --- a/exopy/tasks/plugin.py +++ b/exopy/tasks/plugin.py @@ -13,7 +13,7 @@ import logging from collections import defaultdict -from atom.api import List, Dict, Typed, Unicode +from atom.api import List, Dict, Typed, Str from watchdog.observers import Observer from .declarations import (Task, Interface, Tasks, Interfaces, TaskConfig, @@ -45,7 +45,7 @@ class TaskManagerPlugin(HasPreferencesPlugin): filters = List() #: Path to the file in which the names for the tasks are located. - auto_task_path = Unicode(os.path.join(FOLDER_PATH, + auto_task_path = Str(os.path.join(FOLDER_PATH, 'tasknames.txt')).tag(pref=True) #: List of names to use when creating a new task. diff --git a/exopy/tasks/tasks/base_tasks.py b/exopy/tasks/tasks/base_tasks.py index e924ca0d..8a564a35 100644 --- a/exopy/tasks/tasks/base_tasks.py +++ b/exopy/tasks/tasks/base_tasks.py @@ -24,7 +24,7 @@ from cProfile import Profile from operator import attrgetter -from atom.api import (Atom, Int, Bool, Value, Unicode, List, +from atom.api import (Atom, Int, Bool, Value, Str, List, ForwardTyped, Typed, Callable, Dict, Signal, Tuple, Coerced, Constant, set_default) from configobj import Section, ConfigObj @@ -70,10 +70,10 @@ class BaseTask(Atom): dep_type = Constant(DEP_TYPE).tag(pref=True) #: Name of the class, used for persistence. - task_id = Unicode().tag(pref=True) + task_id = Str().tag(pref=True) #: Name of the task this should be unique in hierarchy. - name = Unicode().tag(pref=True) + name = Str().tag(pref=True) #: Depth of the task in the hierarchy. this should not be manipulated #: directly by user code. @@ -88,11 +88,11 @@ class BaseTask(Atom): #: Entries the task declares in the database and the associated default #: values. This should be copied and re-assign when modified not modfied #: in place. - database_entries = Dict(Unicode(), Value()) + database_entries = Dict(Str(), Value()) #: Path of the task in the hierarchy. This refers to the parent task and #: is used when writing in the database. - path = Unicode() + path = Str() #: Reference to the root task in the hierarchy. root = ForwardTyped(lambda: RootTask) @@ -110,14 +110,14 @@ class BaseTask(Atom): #: Dictionary indicating whether the task is executed in parallel #: ('activated' key) and which is pool it belongs to ('pool' key). - parallel = Dict(Unicode()).tag(pref=True) + parallel = Dict(Str()).tag(pref=True) #: Dictionary indicating whether the task should wait on any pool before #: performing its job. Three valid keys can be used : #: - 'activated' : a bool indicating whether or not to wait. #: - 'wait' : the list should then specify which pool should be waited. #: - 'no_wait' : the list should specify which pool not to wait on. - wait = Dict(Unicode()).tag(pref=True) + wait = Dict(Str()).tag(pref=True) #: Dict of access exception in the database. This should not be manipulated #: by user code. @@ -1042,7 +1042,7 @@ class RootTask(ComplexTask): """ #: Path to which log infos, preferences, etc should be written by default. - default_path = Unicode('').tag(pref=True) + default_path = Str('').tag(pref=True) #: Should the execution be profiled. should_profile = Bool().tag(pref=True) diff --git a/exopy/tasks/tasks/decorators.py b/exopy/tasks/tasks/decorators.py index 6e10ef4b..025a070b 100644 --- a/exopy/tasks/tasks/decorators.py +++ b/exopy/tasks/tasks/decorators.py @@ -17,7 +17,7 @@ from time import sleep from threading import Thread, Event, current_thread -from atom.api import Atom, Value, Callable, Unicode +from atom.api import Atom, Value, Callable, Str from ...utils.traceback import format_exc @@ -185,7 +185,7 @@ def stop(self): _func = Callable() #: Pool id to which this dispatcher belongs. - _pool = Unicode() + _pool = Str() def _background_loop(self): """Background function executed by the thread. diff --git a/exopy/tasks/tasks/logic/conditional_task.py b/exopy/tasks/tasks/logic/conditional_task.py index 890b19ab..50ae42db 100644 --- a/exopy/tasks/tasks/logic/conditional_task.py +++ b/exopy/tasks/tasks/logic/conditional_task.py @@ -9,7 +9,7 @@ """Task equivalent to an if statement. """ -from atom.api import (Unicode) +from atom.api import (Str) from ..validators import Feval from ..base_tasks import ComplexTask @@ -20,7 +20,7 @@ class ConditionalTask(ComplexTask): """ #: Condition to meet in order to perform the children tasks. - condition = Unicode().tag(pref=True, feval=Feval()) + condition = Str().tag(pref=True, feval=Feval()) def perform(self): """Call the children task if the condition evaluate to True. diff --git a/exopy/tasks/tasks/logic/loop_exceptions_tasks.py b/exopy/tasks/tasks/logic/loop_exceptions_tasks.py index b171a6f0..c5b4dc15 100644 --- a/exopy/tasks/tasks/logic/loop_exceptions_tasks.py +++ b/exopy/tasks/tasks/logic/loop_exceptions_tasks.py @@ -9,7 +9,7 @@ """Tasks used to modify the execution of a loop. """ -from atom.api import (Unicode, set_default) +from atom.api import (Str, set_default) from ..validators import Feval from ..base_tasks import SimpleTask @@ -25,7 +25,7 @@ class BreakTask(SimpleTask): """ #: Condition under which to perform the break. - condition = Unicode().tag(pref=True, feval=Feval()) + condition = Str().tag(pref=True, feval=Feval()) #: Never run this task in parallel. parallel = set_default({'forbidden': True}) @@ -59,7 +59,7 @@ class ContinueTask(SimpleTask): """ #: Condition under which to continue. - condition = Unicode().tag(pref=True, feval=Feval()) + condition = Str().tag(pref=True, feval=Feval()) #: Never run this task in parallel. parallel = set_default({'forbidden': True}) diff --git a/exopy/tasks/tasks/logic/loop_iterable_interface.py b/exopy/tasks/tasks/logic/loop_iterable_interface.py index 9e595cd3..4a982bc2 100644 --- a/exopy/tasks/tasks/logic/loop_iterable_interface.py +++ b/exopy/tasks/tasks/logic/loop_iterable_interface.py @@ -11,7 +11,7 @@ """ import numpy as np -from atom.api import Unicode +from atom.api import Str from collections import Iterable from ..task_interface import TaskInterface @@ -23,7 +23,7 @@ class IterableLoopInterface(TaskInterface): """ #: Iterable on which to iterate. - iterable = Unicode('range(10)').tag(pref=True, feval=Feval(types=Iterable)) + iterable = Str('range(10)').tag(pref=True, feval=Feval(types=Iterable)) def check(self, *args, **kwargs): """Check that the iterable member evaluation does yield an iterable. diff --git a/exopy/tasks/tasks/logic/loop_linspace_interface.py b/exopy/tasks/tasks/logic/loop_linspace_interface.py index c2837da5..2aa3be2b 100644 --- a/exopy/tasks/tasks/logic/loop_linspace_interface.py +++ b/exopy/tasks/tasks/logic/loop_linspace_interface.py @@ -13,7 +13,7 @@ from decimal import Decimal import numpy as np -from atom.api import Unicode +from atom.api import Str from ..task_interface import TaskInterface from ..validators import Feval @@ -24,13 +24,13 @@ class LinspaceLoopInterface(TaskInterface): """ #: Value at which to start the loop. - start = Unicode('0.0').tag(pref=True, feval=Feval(types=numbers.Real)) + start = Str('0.0').tag(pref=True, feval=Feval(types=numbers.Real)) #: Value at which to stop the loop (included) - stop = Unicode('1.0').tag(pref=True, feval=Feval(types=numbers.Real)) + stop = Str('1.0').tag(pref=True, feval=Feval(types=numbers.Real)) #: Step between loop values. - step = Unicode('0.1').tag(pref=True, feval=Feval(types=numbers.Real)) + step = Str('0.1').tag(pref=True, feval=Feval(types=numbers.Real)) def check(self, *args, **kwargs): """Check evaluation of all loop parameters. diff --git a/exopy/tasks/tasks/logic/while_task.py b/exopy/tasks/tasks/logic/while_task.py index 14c8d4fb..d713a81a 100644 --- a/exopy/tasks/tasks/logic/while_task.py +++ b/exopy/tasks/tasks/logic/while_task.py @@ -9,7 +9,7 @@ """Task allowing to use a while statement. """ -from atom.api import (Unicode, set_default) +from atom.api import (Str, set_default) from ..validators import Feval from ..base_tasks import ComplexTask @@ -24,7 +24,7 @@ class WhileTask(ComplexTask): """ #: Condition under which to continue looping. - condition = Unicode().tag(pref=True, feval=Feval()) + condition = Str().tag(pref=True, feval=Feval()) database_entries = set_default({'index': 1}) diff --git a/exopy/tasks/tasks/task_editor.enaml b/exopy/tasks/tasks/task_editor.enaml index f84746e5..938b147b 100644 --- a/exopy/tasks/tasks/task_editor.enaml +++ b/exopy/tasks/tasks/task_editor.enaml @@ -12,7 +12,7 @@ from itertools import chain from functools import partial -from atom.api import (Typed, Unicode, Constant, Bool, Value, Dict, +from atom.api import (Typed, Str, Constant, Bool, Value, Dict, set_default) from enaml.core.declarative import d_, d_func from enaml.widgets.api import Container, Stack, StackItem, PushButton, Label diff --git a/exopy/tasks/tasks/task_interface.py b/exopy/tasks/tasks/task_interface.py index cfb03a66..5be666e4 100644 --- a/exopy/tasks/tasks/task_interface.py +++ b/exopy/tasks/tasks/task_interface.py @@ -9,7 +9,7 @@ """Definition of the base classes for interfaces in tasks. """ -from atom.api import (Atom, ForwardTyped, Typed, Unicode, Dict, Property, +from atom.api import (Atom, ForwardTyped, Typed, Str, Dict, Property, Constant) from ...utils.traceback import format_exc @@ -283,7 +283,7 @@ class BaseInterface(HasPrefAtom): #: Id of the interface preceded by the ids of all its anchors separated by # ':'. Used for persistence purposes. - interface_id = Unicode().tag(pref=True) + interface_id = Str().tag(pref=True) #: Dict of database entries added by the interface. database_entries = Dict() diff --git a/exopy/tasks/tasks/util/log_task.py b/exopy/tasks/tasks/util/log_task.py index 95e8a14c..d2670025 100644 --- a/exopy/tasks/tasks/util/log_task.py +++ b/exopy/tasks/tasks/util/log_task.py @@ -9,7 +9,7 @@ """Logging Task. """ -from atom.api import (Unicode, set_default) +from atom.api import (Str, set_default) import logging from ..base_tasks import SimpleTask @@ -20,7 +20,7 @@ class LogTask(SimpleTask): """ #: Message to log when the task is executed. - message = Unicode().tag(pref=True, fmt=True) + message = Str().tag(pref=True, fmt=True) database_entries = set_default({'message': ''}) diff --git a/exopy/tasks/tasks/util/sleep_task.py b/exopy/tasks/tasks/util/sleep_task.py index e94d1d3d..d1ebb721 100644 --- a/exopy/tasks/tasks/util/sleep_task.py +++ b/exopy/tasks/tasks/util/sleep_task.py @@ -11,7 +11,7 @@ """ import numbers -from atom.api import (Unicode, set_default) +from atom.api import (Str, set_default) from time import sleep from ..base_tasks import SimpleTask @@ -23,7 +23,7 @@ class SleepTask(SimpleTask): Wait for any parallel operation before execution by default. """ # Time to wait - time = Unicode().tag(pref=True, feval=Feval(types=numbers.Real)) + time = Str().tag(pref=True, feval=Feval(types=numbers.Real)) wait = set_default({'': True}) diff --git a/exopy/tasks/widgets/building.enaml b/exopy/tasks/widgets/building.enaml index fa39d576..64cc0eb8 100644 --- a/exopy/tasks/widgets/building.enaml +++ b/exopy/tasks/widgets/building.enaml @@ -9,7 +9,7 @@ """Widgets dedicated to the construction of new tasks. """ -from atom.api import (Atom, Typed, Unicode, ForwardTyped, Bool, observe) +from atom.api import (Atom, Typed, Str, ForwardTyped, Bool, observe) from enaml.core.api import Include from enaml.widgets.widget import Widget from enaml.layout.api import hbox, spacer, vbox diff --git a/exopy/tasks/widgets/saving.enaml b/exopy/tasks/widgets/saving.enaml index 23105cee..bdad04fc 100644 --- a/exopy/tasks/widgets/saving.enaml +++ b/exopy/tasks/widgets/saving.enaml @@ -12,7 +12,7 @@ import os from textwrap import fill -from atom.api import (Atom, Unicode, Bool, ForwardTyped, observe) +from atom.api import (Atom, Str, Bool, ForwardTyped, observe) from enaml.widgets.api import (Container, Field, MultilineField, CheckBox, PushButton, Dialog) from enaml.layout.api import align, hbox, vbox, spacer @@ -36,13 +36,13 @@ class TemplateSaverModel(Atom): manager = ForwardTyped(task_manager) #: Currently selected folder in which to save the template. - folder = Unicode() + folder = Str() #: File in which to save the template. - filename = Unicode() + filename = Str() #: Documentation for the template. - doc = Unicode() + doc = Str() #: Flag indicating whether or not enough informations have been provided #: to porceed with saving. diff --git a/exopy/utils/atom_util.py b/exopy/utils/atom_util.py index 82066cf4..dd97e7b6 100644 --- a/exopy/utils/atom_util.py +++ b/exopy/utils/atom_util.py @@ -14,7 +14,7 @@ from ast import literal_eval from textwrap import fill -from atom.api import Str, Unicode, Enum, Atom, Constant +from atom.api import Str, Str, Enum, Atom, Constant from inspect import getfullargspec from inspect import cleandoc @@ -84,10 +84,10 @@ def member_from_pref(obj, member, val): # If 'pref=True' then we rely on the standard save mechanism if meta_value is True: - # If the member is a subclass of Str, Unicode then we just take the + # If the member is a subclass of Str, Str then we just take the # raw value and Atom will handle the casting if any for us. # If it is a subclass of basestring then we save it as-is - if isinstance(member, (Str, Unicode)): + if isinstance(member, (Str, Str)): value = val # If it is an Enum where the first item is a (subclass of) string, then diff --git a/exopy/utils/container_change.py b/exopy/utils/container_change.py index c6fa087a..b7a473cc 100644 --- a/exopy/utils/container_change.py +++ b/exopy/utils/container_change.py @@ -9,7 +9,7 @@ """Payload to use when notifying the system about a container change. """ -from atom.api import (Atom, Value, Unicode, List) +from atom.api import (Atom, Value, Str, List) class ContainerChange(Atom): @@ -20,7 +20,7 @@ class ContainerChange(Atom): obj = Value() #: Name of the modified container. - name = Unicode() + name = Str() #: List of added entries. Should not be manipulated directly by user code. #: Use the add_operation method to add operations. diff --git a/exopy/utils/declarator.py b/exopy/utils/declarator.py index 58661bab..a49890a2 100644 --- a/exopy/utils/declarator.py +++ b/exopy/utils/declarator.py @@ -12,7 +12,7 @@ import re from importlib import import_module -from atom.api import Unicode, Bool +from atom.api import Str, Bool from enaml.core.api import Declarative, d_ from .traceback import format_exc @@ -96,11 +96,11 @@ class GroupDeclarator(Declarator): """ #: Prefix path to use for all children Declarator. Path should be dot #: separated. - path = d_(Unicode()) + path = d_(Str()) #: Id of the group common to all children Declarator. It is the #: responsability of the children to mention they are part of a group. - group = d_(Unicode()) + group = d_(Str()) def get_path(self): """Overriden method to walk all parents. diff --git a/exopy/utils/plugin_tools.py b/exopy/utils/plugin_tools.py index b51755af..b89535e5 100644 --- a/exopy/utils/plugin_tools.py +++ b/exopy/utils/plugin_tools.py @@ -12,7 +12,7 @@ import sys from collections import defaultdict -from atom.api import Atom, Dict, Unicode, Coerced, Typed, Callable, List +from atom.api import Atom, Dict, Str, Coerced, Typed, Callable, List from enaml.workbench.api import Workbench, Plugin from .atom_util import (update_members_from_preferences, @@ -137,7 +137,7 @@ class BaseCollector(Atom): workbench = Typed(Workbench) #: Id of the extension point to observe. - point = Unicode() + point = Str() #: Expected class(es) of the object generated by the extension. ext_class = Coerced(ClassTuple) diff --git a/exopy/utils/widgets/dict_tree_view.enaml b/exopy/utils/widgets/dict_tree_view.enaml index d464aeb1..7e4e2b9b 100644 --- a/exopy/utils/widgets/dict_tree_view.enaml +++ b/exopy/utils/widgets/dict_tree_view.enaml @@ -11,7 +11,7 @@ """ from collections import Mapping -from atom.api import Atom, Typed, Value, Unicode, ForwardTyped, List +from atom.api import Atom, Typed, Value, Str, ForwardTyped, List from .qt_tree_widget import QtTreeWidget from .tree_nodes import TreeNode @@ -22,7 +22,7 @@ class Leaf(Atom): """ #: Key under which the value is stored. - name = Unicode() + name = Str() #: Value associated with the name. value = Value() @@ -33,7 +33,7 @@ class Node(Atom): """ #: Key under which the mapping is stored or blank if this is the root node. - name = Unicode() + name = Str() #: Nodes generated from the key/value pairs of the mapping. nodes = List() diff --git a/exopy/utils/widgets/list_editor.enaml b/exopy/utils/widgets/list_editor.enaml index 03cd11b4..291f5fd1 100644 --- a/exopy/utils/widgets/list_editor.enaml +++ b/exopy/utils/widgets/list_editor.enaml @@ -14,7 +14,7 @@ responsability of the model to signal internal changes to the list. """ from functools import partial -from atom.api import Unicode, List +from atom.api import Str, List from enaml.core.api import Looper, Conditional from enaml.core.declarative import d_ from enaml.layout.api import hbox, align, spacer, grid, vbox @@ -90,7 +90,7 @@ class ListContainer(Container): """ #: Aligmenent of the PushButton used to edit the list content. - alignment = d_(Unicode('top')) + alignment = d_(Str('top')) def layout_constraints(self): """Layout the push buttons used to edit the list content. diff --git a/exopy/utils/widgets/qt_autoscroll_html.py b/exopy/utils/widgets/qt_autoscroll_html.py index 452f52a6..d06aeb93 100644 --- a/exopy/utils/widgets/qt_autoscroll_html.py +++ b/exopy/utils/widgets/qt_autoscroll_html.py @@ -9,7 +9,7 @@ """Html widget automatically scrolling ot show latest added text. """ -from atom.api import Unicode +from atom.api import Str from enaml.core.declarative import d_ from enaml.qt import QtGui, QtWidgets from enaml.widgets.api import RawWidget @@ -23,7 +23,7 @@ class QtAutoscrollHtml(RawWidget): """ #: Text displayed by the widget. Any Html mark up will be rendered. - text = d_(Unicode()) + text = d_(Str()) hug_width = 'ignore' hug_height = 'ignore' diff --git a/exopy/utils/widgets/qt_completers.py b/exopy/utils/widgets/qt_completers.py index 6b3d26a6..304880e5 100644 --- a/exopy/utils/widgets/qt_completers.py +++ b/exopy/utils/widgets/qt_completers.py @@ -9,7 +9,7 @@ """Widgets with support for text completion. """ -from atom.api import List, Tuple, Unicode, Bool, Callable, Value +from atom.api import List, Tuple, Str, Bool, Callable, Value from enaml.core.declarative import d_ from enaml.qt import QtCore, QtWidgets from enaml.widgets.api import RawWidget, Feature @@ -139,7 +139,7 @@ class QtLineCompleter(RawWidget): """ #: Text being edited by this widget. - text = d_(Unicode()) + text = d_(Str()) #: Static list of entries used to propose completion. This member value is #: not updated by the entries_updater. @@ -149,7 +149,7 @@ class QtLineCompleter(RawWidget): entries_updater = d_(Callable()) #: Delimiters marking the begining and end of completed section. - delimiters = d_(Tuple(Unicode(), ('{', '}'))) + delimiters = d_(Tuple(Str(), ('{', '}'))) hug_width = 'ignore' features = Feature.FocusEvents @@ -237,7 +237,7 @@ class QtTextCompleter(RawWidget): """ #: Text being edited by this widget. - text = d_(Unicode()) + text = d_(Str()) #: Static list of entries used to propose completion. This member value is #: not updated by the entries_updater. @@ -247,7 +247,7 @@ class QtTextCompleter(RawWidget): entries_updater = d_(Callable()) #: Delimiters marking the begining and end of completed section. - delimiters = d_(Tuple(Unicode(), ('{', '}'))) + delimiters = d_(Tuple(Str(), ('{', '}'))) hug_width = 'ignore' features = Feature.FocusEvents diff --git a/exopy/utils/widgets/tree_nodes.py b/exopy/utils/widgets/tree_nodes.py index ecf938b4..0ca6bdf7 100644 --- a/exopy/utils/widgets/tree_nodes.py +++ b/exopy/utils/widgets/tree_nodes.py @@ -9,7 +9,7 @@ """Declarative node for tree node generation. """ -from atom.api import (Unicode, Bool, List, Value, Property, Dict) +from atom.api import (Str, Bool, List, Value, Property, Dict) from enaml.core.declarative import Declarative, d_, d_func from enaml.widgets.api import Menu @@ -40,18 +40,18 @@ class TreeNode(Declarative): #: Either the name of a member containing a label, or a constant label, if #: the string starts with '='. - label = d_(Unicode()) + label = d_(Str()) #: Either the name of a member containing a tooltip, or constant tooltip, #: if the string starts with '='. - tooltip = d_(Unicode()) + tooltip = d_(Str()) #: Name of the member containing children (if '', the node is a leaf). - children_member = d_(Unicode()) + children_member = d_(Str()) #: Name of the signal use to notify changes to the children. The payload of #: the signal should be a ContainerChange instance. - children_changed = d_(Unicode()) + children_changed = d_(Str()) #: List of object classes than can be added or copied add = d_(List()) @@ -60,7 +60,7 @@ class TreeNode(Declarative): move = d_(List()) #: Name to use for a new instance - name = d_(Unicode()) + name = d_(Str()) #: Can the object's children be renamed? rename = d_(Bool(True)) @@ -90,16 +90,16 @@ class TreeNode(Declarative): node_for_class = Property() #: Name of leaf item icon - icon_item = d_(Unicode('')) + icon_item = d_(Str('')) #: Name of group item icon - icon_group = d_(Unicode('')) + icon_group = d_(Str('')) #: Name of opened group item icon - icon_open = d_(Unicode('')) + icon_open = d_(Str('')) #: Resource path used to locate the node icon - icon_path = d_(Unicode('Icon')) + icon_path = d_(Str('Icon')) #: Selector or name for background color background = Value('white') diff --git a/tests/app/icons/contributions.enaml b/tests/app/icons/contributions.enaml index f4b64866..88fe97e9 100644 --- a/tests/app/icons/contributions.enaml +++ b/tests/app/icons/contributions.enaml @@ -11,7 +11,7 @@ """ import enaml.icon from enaml.widgets.api import Window, Container, PushButton -from atom.api import Unicode +from atom.api import Str from enaml.workbench.api import Extension, PluginManifest from exopy.app.icons.icon_theme import IconTheme, IconThemeExtension, Icon @@ -21,7 +21,7 @@ class DumbIcon(enaml.icon.Icon): """Dumb class for testing. """ - id = Unicode() + id = Str() enamldef DummyTheme(IconTheme): diff --git a/tests/app/packages/test_plugin.py b/tests/app/packages/test_plugin.py index 2149a425..ede6ca5b 100644 --- a/tests/app/packages/test_plugin.py +++ b/tests/app/packages/test_plugin.py @@ -11,7 +11,7 @@ """ import pytest import enaml -from atom.api import Atom, Bool, Value, Unicode +from atom.api import Atom, Bool, Value, Str from exopy.testing.util import handle_dialog @@ -52,7 +52,7 @@ class FalseEntryPoint(Atom): """ #: Name of this entry point - name = Unicode() + name = Str() #: Flag indicating whether the require method should raise an error. missing_require = Bool() diff --git a/tests/app/preferences/pref_utils.enaml b/tests/app/preferences/pref_utils.enaml index 7cfa654b..196f4625 100644 --- a/tests/app/preferences/pref_utils.enaml +++ b/tests/app/preferences/pref_utils.enaml @@ -9,7 +9,7 @@ """Preferences plugin test helpers. """ -from atom.api import Atom, Unicode +from atom.api import Atom, Str from enaml.workbench.api import PluginManifest, Extension from exopy.utils.plugin_tools import HasPreferencesPlugin @@ -21,10 +21,10 @@ class _Pref(HasPreferencesPlugin): """ #: Non auto saving member. - string = Unicode().tag(pref=True) + string = Str().tag(pref=True) #: Member needing to be automatically saved. - auto = Unicode().tag(pref=True) + auto = Str().tag(pref=True) enamldef PrefContributor(PluginManifest): diff --git a/tests/app/states/states_utils.enaml b/tests/app/states/states_utils.enaml index 30073bde..6ca3ede9 100644 --- a/tests/app/states/states_utils.enaml +++ b/tests/app/states/states_utils.enaml @@ -9,7 +9,7 @@ """Dummy plugin to test the state plugin. """ -from atom.api import Atom, Unicode +from atom.api import Atom, Str from enaml.workbench.api import PluginManifest, Plugin, Extension from exopy.app.states.state import State @@ -19,7 +19,7 @@ class _State(Plugin): """Dummy plugin having a string member. """ - string = Unicode('init') + string = Str('init') enamldef StateContributor(PluginManifest): diff --git a/tests/measurement/engines/test_process_engine.py b/tests/measurement/engines/test_process_engine.py index f7baa06c..68baf38f 100644 --- a/tests/measurement/engines/test_process_engine.py +++ b/tests/measurement/engines/test_process_engine.py @@ -16,7 +16,7 @@ import enaml import pytest -from atom.api import Bool, Unicode, Value +from atom.api import Bool, Str, Value from exopy.measurement.engines.api import ExecutionInfos from exopy.measurement.engines.process_engine.subprocess import TaskProcess @@ -36,7 +36,7 @@ class WaitingTask(SimpleTask): """ check_flag = Bool(True).tag(pref=True) sync_port = Value(()).tag(pref=True) - sock_id = Unicode().tag(pref=True) + sock_id = Str().tag(pref=True) def check(self, *args, **kwargs): super(WaitingTask, self).check(*args, **kwargs) diff --git a/tests/measurement/workspace/test_workspace.py b/tests/measurement/workspace/test_workspace.py index 73bc5367..2af7e9a1 100644 --- a/tests/measurement/workspace/test_workspace.py +++ b/tests/measurement/workspace/test_workspace.py @@ -552,11 +552,11 @@ def test_measurement_execution(workspace, exopy_qtbot): """ from exopy.measurement.processor import MeasurementProcessor - from atom.api import Unicode, Dict + from atom.api import Str, Dict class P(MeasurementProcessor): - called = Unicode() + called = Str() args = Dict() diff --git a/tests/tasks/tasks/test_execution.py b/tests/tasks/tasks/test_execution.py index dc074c04..d0f132f6 100644 --- a/tests/tasks/tasks/test_execution.py +++ b/tests/tasks/tasks/test_execution.py @@ -16,7 +16,7 @@ from time import sleep import pytest -from atom.api import Unicode, set_default +from atom.api import Str, set_default from enaml.application import deferred_call from exopy.tasks.tasks.base_tasks import RootTask, ComplexTask @@ -58,13 +58,13 @@ class Tester(CheckTask): """Class declaring a member to format and one to eval. """ - form = Unicode().tag(fmt=True) + form = Str().tag(fmt=True) - feval = Unicode().tag(feval=Feval()) + feval = Str().tag(feval=Feval()) - feval_warn = Unicode().tag(feval=Feval(warn=True)) + feval_warn = Str().tag(feval=Feval(warn=True)) - feval_empty = Unicode().tag(feval=SkipEmpty()) + feval_empty = Str().tag(feval=SkipEmpty()) database_entries = set_default({'form': '', 'feval': 0, 'feval_warn': 0, 'feval_empty': 0}) @@ -111,7 +111,7 @@ class Tester(CheckTask): validator. """ - feval = Unicode().tag(feval=object()) + feval = Str().tag(feval=object()) tester = Tester(name='test', feval='2*{test_val}', database_entries={'val': 1, 'feval': 0}) diff --git a/tests/tasks/tasks/test_instr_task.py b/tests/tasks/tasks/test_instr_task.py index ca6db70a..16610c21 100644 --- a/tests/tasks/tasks/test_instr_task.py +++ b/tests/tasks/tasks/test_instr_task.py @@ -9,7 +9,7 @@ """Test for the instrument task. """ -from atom.api import Unicode +from atom.api import Str from exopy.tasks.tasks.base_tasks import RootTask from exopy.tasks.tasks.validators import Feval @@ -52,7 +52,7 @@ def setup(self): 'settings': {'s': {}}}}} class InTask(InstrumentTask): - feval = Unicode('1').tag(feval=Feval()) + feval = Str('1').tag(feval=Feval()) self.task = InTask(name='Dummy', selected_instrument=('p', 'd', 'c', 's')) diff --git a/tests/tasks/tasks/test_task_interfaces.py b/tests/tasks/tasks/test_task_interfaces.py index a235e589..a2affeb1 100644 --- a/tests/tasks/tasks/test_task_interfaces.py +++ b/tests/tasks/tasks/test_task_interfaces.py @@ -11,7 +11,7 @@ """ import pytest -from atom.api import Bool, Unicode, set_default +from atom.api import Bool, Str, set_default from exopy.tasks.tasks.base_tasks import ComplexTask, RootTask from exopy.tasks.tasks.validators import Feval @@ -53,10 +53,10 @@ class InterfaceTest2(TaskInterface): """ #: Member to test auto formatting of tagged members. - fmt = Unicode().tag(fmt=True) + fmt = Str().tag(fmt=True) #: Member to test auto evaluation of tagged members. - feval = Unicode().tag(feval=Feval()) + feval = Str().tag(feval=Feval()) database_entries = set_default({'fmt': '', 'feval': 0, 'itest': 2.0}) @@ -66,10 +66,10 @@ class InterfaceTest2bis(TaskInterface): """ #: Member to test auto formatting of tagged members. - fmt = Unicode().tag(fmt=True) + fmt = Str().tag(fmt=True) #: Member to test auto evaluation of tagged members. - feval = Unicode().tag(feval=object()) + feval = Str().tag(feval=object()) database_entries = set_default({'fmt': '', 'feval': 0, 'itest': 2.0}) @@ -122,10 +122,10 @@ class IIinterfaceTest2(IInterface): """ #: Member to test auto formatting of tagged members. - fmt = Unicode().tag(fmt=True) + fmt = Str().tag(fmt=True) #: Member to test auto evaluation of tagged members. - feval = Unicode().tag(feval=Feval()) + feval = Str().tag(feval=Feval()) database_entries = set_default({'fmt': '', 'feval': 0, 'itest': 2.0}) diff --git a/tests/tasks/tasks/test_validators.py b/tests/tasks/tasks/test_validators.py index ebbda2e9..b585d77c 100644 --- a/tests/tasks/tasks/test_validators.py +++ b/tests/tasks/tasks/test_validators.py @@ -14,7 +14,7 @@ from multiprocessing import Event import pytest -from atom.api import Unicode +from atom.api import Str from exopy.tasks.api import RootTask, validators from exopy.tasks.tasks.logic.loop_task import LoopTask @@ -30,7 +30,7 @@ class Tester(CheckTask): """Class for testing feval validators. """ - feval = Unicode() + feval = Str() root = RootTask(should_stop=Event(), should_pause=Event()) task = Tester(name='test', database_entries={'val': 1}) diff --git a/tests/utils/plugin_tools_testing.enaml b/tests/utils/plugin_tools_testing.enaml index 5f444a63..a406c154 100644 --- a/tests/utils/plugin_tools_testing.enaml +++ b/tests/utils/plugin_tools_testing.enaml @@ -9,7 +9,7 @@ """Manifests used when testing plugin tools module content. """ -from atom.api import Typed, Unicode, Bool, Enum +from atom.api import Typed, Str, Bool, Enum from enaml.workbench.api import (PluginManifest, Plugin, Extension, ExtensionPoint) from enaml.core.api import Declarative, d_, d_func @@ -30,9 +30,9 @@ class Contribution(Declarative): """Dummy class representing a contribution to an extension point. """ - id = d_(Unicode()) + id = d_(Str()) - description = d_(Unicode()) + description = d_(Str()) @d_func def new(self, workbench): @@ -168,7 +168,7 @@ class TestDeclarator(Declarator): """Dummy Declarator simply taking note that it registered and unregistered. """ - id = d_(Unicode()) + id = d_(Str()) fail_register = d_(Bool()) diff --git a/tests/utils/test_atom_util.py b/tests/utils/test_atom_util.py index 10e11092..43914f2d 100644 --- a/tests/utils/test_atom_util.py +++ b/tests/utils/test_atom_util.py @@ -12,7 +12,7 @@ from collections import OrderedDict import pytest -from atom.api import (Unicode, Float, Enum, List, Typed, Int, Value, +from atom.api import (Str, Float, Enum, List, Typed, Int, Value, Constant) from exopy.utils.atom_util import (tagged_members, member_from_pref, member_to_pref, HasPrefAtom, @@ -32,7 +32,7 @@ class _Faux(HasPrefAtom): class _Aux(HasPrefAtom): - string = Unicode().tag(pref=True) + string = Str().tag(pref=True) float_n = Float().tag(pref=True) enum = Enum('a', 'b').tag(pref=True) enum_float = Enum(1.0, 2.0).tag(pref=True) diff --git a/tests/utils/widgets/test_autoscroll_html.enaml b/tests/utils/widgets/test_autoscroll_html.enaml index 7e23e885..34765a5c 100644 --- a/tests/utils/widgets/test_autoscroll_html.enaml +++ b/tests/utils/widgets/test_autoscroll_html.enaml @@ -16,7 +16,7 @@ in two should be bold. """ import sys import os -from atom.api import Atom, Unicode +from atom.api import Atom, Str from enaml.widgets.api import Window, Container, PushButton from enaml.layout.api import vbox, hbox @@ -33,7 +33,7 @@ class Model(Atom): """Dummy class holding the string displayed by the QtAutoscrollHtml widget. """ - text = Unicode() + text = Str() enamldef Main(Window): diff --git a/tests/utils/widgets/test_completers.enaml b/tests/utils/widgets/test_completers.enaml index 0e7bccb8..b263a1a5 100644 --- a/tests/utils/widgets/test_completers.enaml +++ b/tests/utils/widgets/test_completers.enaml @@ -24,7 +24,7 @@ The window is divided in two : """ import sys import os -from atom.api import Atom, Unicode, Bool +from atom.api import Atom, Str, Bool from enaml.widgets.api import (Window, Container, PushButton, Field, MultilineField, GroupBox) from enaml.layout.api import vbox, hbox, spacer @@ -45,7 +45,7 @@ class Model(Atom): """ #: Text displayed by the completer. - text = Unicode() + text = Str() #: Flag used to change the proposed list of entries. _flag = Bool() diff --git a/tests/utils/widgets/test_dict_tree_view.enaml b/tests/utils/widgets/test_dict_tree_view.enaml index b102d036..2501c0de 100644 --- a/tests/utils/widgets/test_dict_tree_view.enaml +++ b/tests/utils/widgets/test_dict_tree_view.enaml @@ -11,7 +11,7 @@ """ import sys import os -from atom.api import Atom, Unicode, Signal, List +from atom.api import Atom, Str, Signal, List from enaml.widgets.api import (Window, Container, Label, MultilineField) from enaml.layout.api import vbox, hbox, spacer from enaml.stdlib.mapped_view import MappedView diff --git a/tests/utils/widgets/test_tree_widget.enaml b/tests/utils/widgets/test_tree_widget.enaml index 7f89cab4..13bb1a91 100644 --- a/tests/utils/widgets/test_tree_widget.enaml +++ b/tests/utils/widgets/test_tree_widget.enaml @@ -40,7 +40,7 @@ Action to test: """ import sys import os -from atom.api import Atom, Unicode, Signal, List +from atom.api import Atom, Str, Signal, List from enaml.widgets.api import (Window, Container, PushButton, Field, CheckBox, Action, GroupBox, Dialog, Menu, Label) @@ -72,14 +72,14 @@ class File(Atom): """Class simply holding a name, to be represented as a leaf. """ - name = Unicode() + name = Str() class Folder(Atom): """Class having a name and children to be represented as a node. """ - name = Unicode() + name = Str() children = List()