Skip to content

Commit

Permalink
Automated fixups of examples and integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
corranwebster committed Jun 21, 2016
1 parent 6b38690 commit 1a706f5
Show file tree
Hide file tree
Showing 117 changed files with 247 additions and 247 deletions.
4 changes: 2 additions & 2 deletions examples/demo/Advanced/Adapted_tree_editor_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#-- FileAdapter Class ----------------------------------------------------


class FileAdapter (ITreeNodeAdapter):
class FileAdapter(ITreeNodeAdapter):

adapts(File, ITreeNode)

Expand Down Expand Up @@ -95,7 +95,7 @@ def can_auto_close(self):
#-- FileTreeDemo Class ---------------------------------------------------


class FileTreeDemo (HasTraits):
class FileTreeDemo(HasTraits):

# The path to the file tree root:
root_path = Directory(entries=10)
Expand Down
6 changes: 3 additions & 3 deletions examples/demo/Advanced/Auto_editable_readonly_table_cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@
#-- Integer Class --------------------------------------------------------


class Integer (HasTraits):
class Integer(HasTraits):

# The value:
n = Int

#-- Factor Class ---------------------------------------------------------


class Factor (HasTraits):
class Factor(HasTraits):

# The number being factored:
n = Int
Expand Down Expand Up @@ -127,7 +127,7 @@ def _get_factors(self):
#-- Factors Class --------------------------------------------------------


class Factors (HasTraits):
class Factors(HasTraits):

# The maximum number to include in the table:
max_n = Range(1, 1000, 20, mode='slider')
Expand Down
4 changes: 2 additions & 2 deletions examples/demo/Advanced/Dynamic_EnumEditor_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#-- The KitchenCapabilities class ----------------------------------------


class KitchenCapabilities (HasPrivateTraits):
class KitchenCapabilities(HasPrivateTraits):

# The current set of entrees the kitchen can make (based on its larder):
available = List(possible_entrees)
Expand All @@ -73,7 +73,7 @@ class KitchenCapabilities (HasPrivateTraits):
#-- The OrderMenu class --------------------------------------------------


class OrderMenu (HasPrivateTraits):
class OrderMenu(HasPrivateTraits):

# The person's entree order:
entree = Str
Expand Down
4 changes: 2 additions & 2 deletions examples/demo/Advanced/Dynamic_range_trait_and_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
#-- The Hotel class ------------------------------------------------------


class Hotel (HasPrivateTraits):
class Hotel(HasPrivateTraits):

# The season of the year:
season = Enum('Winter', 'Spring', 'Summer', 'Fall')
Expand Down Expand Up @@ -138,7 +138,7 @@ def _add_guest_changed(self):
#-- The Guest class ------------------------------------------------------


class Guest (HasPrivateTraits):
class Guest(HasPrivateTraits):

# The name of the guest:
name = Str
Expand Down
12 changes: 6 additions & 6 deletions examples/demo/Advanced/Dynamic_views_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import DynamicView, HasDynamicViews


class HasFooView (HasDynamicViews):
class HasFooView(HasDynamicViews):
""" A base class declaring the existence of the 'foo' dynamic view.
"""

Expand Down Expand Up @@ -42,13 +42,13 @@ def __init__(self, *args, **traits):
self.declare_dynamic_view(declaration)


class MyInfoHandler (Handler):
class MyInfoHandler(Handler):

def object_first_changed(self, info):
info.object.derived = info.object.first


class BaseFoo (HasFooView):
class BaseFoo(HasFooView):
""" A base class that puts some content in the 'foo' dynamic view.
"""

Expand Down Expand Up @@ -77,13 +77,13 @@ class BaseFoo (HasFooView):
)


class FatherInfoHandler (Handler):
class FatherInfoHandler(Handler):

def object_father_first_name_changed(self, info):
info.object.father_derived = info.object.father_first_name


class DerivedFoo (BaseFoo):
class DerivedFoo(BaseFoo):
""" A derived class that puts additional content in the 'foo' dynamic view.
Note that the additional content could also have been added via a traits
category contribution, or even dynamic manipulation of metadata on a UI
Expand Down Expand Up @@ -141,7 +141,7 @@ def _knows_father_changed(self, old, new):
del ui_father._foo_order


class FooDemo (HasTraits):
class FooDemo(HasTraits):
""" Defines a class to run the demo.
"""

Expand Down
2 changes: 1 addition & 1 deletion examples/demo/Advanced/History_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#-- HistoryDemo Class ----------------------------------------------------


class HistoryDemo (HasTraits):
class HistoryDemo(HasTraits):

name = Str
file = File
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/Advanced/Invalid_state_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
#-- System Class ---------------------------------------------------------


class System (HasTraits):
class System(HasTraits):

# The mass of the system:
mass = Range(0.0, 100.0)
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/Advanced/ListStrEditor_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#-- ShoppingListDemo Class -----------------------------------------------


class ShoppingListDemo (HasTraits):
class ShoppingListDemo(HasTraits):

# The list of things to buy at the store:
shopping_list = List(Str)
Expand Down
4 changes: 2 additions & 2 deletions examples/demo/Advanced/List_editors_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# 'Person' class:


class Person (HasStrictTraits):
class Person(HasStrictTraits):

# Trait definitions:
name = Str
Expand Down Expand Up @@ -74,7 +74,7 @@ class Person (HasStrictTraits):
# 'ListTraitTest' class:


class ListTraitTest (HasStrictTraits):
class ListTraitTest(HasStrictTraits):

# Trait definitions:
people = List(Instance(Person, ()))
Expand Down
4 changes: 2 additions & 2 deletions examples/demo/Advanced/Popup_Dialog_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#-- The PersonHandler class ----------------------------------------------


class PersonHandler (Handler):
class PersonHandler(Handler):

# The UIInfo object associated with the view:
info = Instance(UIInfo)
Expand Down Expand Up @@ -69,7 +69,7 @@ def _cancel_changed(self):
#-- The Person class -----------------------------------------------------


class Person (HasPrivateTraits):
class Person(HasPrivateTraits):

# The person's name, age and gender:
name = Str
Expand Down
4 changes: 2 additions & 2 deletions examples/demo/Advanced/Property_List_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#-- Person Class ---------------------------------------------------------


class Person (HasStrictTraits):
class Person(HasStrictTraits):
""" Defines some sample data to display in the TableEditor.
"""

Expand All @@ -63,7 +63,7 @@ class Person (HasStrictTraits):
#-- PropertyListDemo Class -----------------------------------------------


class PropertyListDemo (HasPrivateTraits):
class PropertyListDemo(HasPrivateTraits):
""" Displays a random list of Person objects in a TableEditor that is
refreshed every 3 seconds by a background thread.
"""
Expand Down
4 changes: 2 additions & 2 deletions examples/demo/Advanced/Scrubber_editor_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@
#-- Shared Themed Item Definition ----------------------------------------


class TItem (Item):
class TItem(Item):
editor = ScrubberEditor()
item_theme = ATheme('@std:LG')

#-- ScrubberDemo Class ---------------------------------------------------


class ScrubberDemo (HasTraits):
class ScrubberDemo(HasTraits):

# Define some sample ranges and values:
simple_integer = Range(0, 100)
Expand Down
8 changes: 4 additions & 4 deletions examples/demo/Advanced/String_list_ui_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# Define the tabular adapter used by the Traits UI string list editor:


class MultiSelectAdapter (TabularAdapter):
class MultiSelectAdapter(TabularAdapter):

# The columns in the table (just the string value):
columns = [('Value', 'value')]
Expand All @@ -44,7 +44,7 @@ def _get_value_text(self):
# Define the actual Traits UI string list editor:


class _StringListEditor (UIEditor):
class _StringListEditor(UIEditor):

# Indicate that the editor is scrollable/resizable:
scrollable = True
Expand Down Expand Up @@ -85,7 +85,7 @@ def _selected_modified(self):
# Define the StringListEditor class used by client code:


class StringListEditor (BasicEditorFactory):
class StringListEditor(BasicEditorFactory):

# The editor implementation class:
klass = _StringListEditor
Expand All @@ -96,7 +96,7 @@ class StringListEditor (BasicEditorFactory):
#-- Define the demo class ----------------------------------------------------


class MultiSelect (HasPrivateTraits):
class MultiSelect(HasPrivateTraits):
""" This class demonstrates using the StringListEditor to select a set
of string values from a set of choices.
"""
Expand Down
6 changes: 3 additions & 3 deletions examples/demo/Advanced/Table_editor_with_checkbox_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

# Create a specialized column to set the text color differently based upon
# whether or not the player is in the lineup:
class PlayerColumn (ObjectColumn):
class PlayerColumn(ObjectColumn):

# Override some default settings for the column:
width = 0.08
Expand Down Expand Up @@ -58,7 +58,7 @@ def get_text_color(self, object):
# 'Player' class:


class Player (HasStrictTraits):
class Player(HasStrictTraits):

# Trait definitions:
in_lineup = Bool(True)
Expand All @@ -82,7 +82,7 @@ def _get_average(self):
self.triples + self.home_runs) / self.at_bats


class Team (HasStrictTraits):
class Team(HasStrictTraits):

# Trait definitions:
players = List(Player)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
#-- The Live Search table editor definition ------------------------------


class MatchesColumn1 (ObjectColumn):
class MatchesColumn1(ObjectColumn):

def get_value(self, object):
n = len(self.get_raw_value(object))
Expand All @@ -116,13 +116,13 @@ def get_value(self, object):
return str(n)


class MatchesColumn2 (ObjectColumn):
class MatchesColumn2(ObjectColumn):

def is_editable(self, object):
return (len(object.matches) > 0)


class FileColumn (ObjectColumn):
class FileColumn(ObjectColumn):

def get_drag_value(self, object):
return object.full_name
Expand Down Expand Up @@ -167,7 +167,7 @@ def get_drag_value(self, object):
#-- LiveSearch class -----------------------------------------------------


class LiveSearch (HasTraits):
class LiveSearch(HasTraits):

# The currenty root directory being searched:
root = Directory(getcwd(), entries=10)
Expand Down Expand Up @@ -368,7 +368,7 @@ def _source_files_changed(self):
#-- SourceFile class -----------------------------------------------------


class SourceFile (HasTraits):
class SourceFile(HasTraits):

# The search object this source file is associated with:
live_search = Instance(LiveSearch)
Expand Down
6 changes: 3 additions & 3 deletions examples/demo/Applications/Python_source_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

#-- FileInfo Class Definition --------------------------------------------

class FileInfo (HasPrivateTraits):
class FileInfo(HasPrivateTraits):

file_name = File
name = Property
Expand Down Expand Up @@ -81,7 +81,7 @@ def _get_date(self):
#-- Tabular Adapter Definition -------------------------------------------


class FileInfoAdapter (TabularAdapter):
class FileInfoAdapter(TabularAdapter):

columns = [('File Name', 'name'),
('Size', 'size'),
Expand Down Expand Up @@ -120,7 +120,7 @@ def _get_big_image(self):
#-- PythonBrowser Class Definition ---------------------------------------


class PythonBrowser (HasPrivateTraits):
class PythonBrowser(HasPrivateTraits):

#-- Trait Definitions ----------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion examples/demo/Applications/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
# Converter Class:


class Converter (HasStrictTraits):
class Converter(HasStrictTraits):

# Trait definitions:
input_amount = CFloat(12.0, desc="the input quantity")
Expand Down
Loading

0 comments on commit 1a706f5

Please sign in to comment.