Skip to content

Commit

Permalink
Replace Unicode with Str for atom 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
frmdstryr committed Dec 18, 2020
1 parent 62efaf5 commit 032dac6
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 60 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name='enaml-web',
version='0.9.1',
version='0.10.0',
author='CodeLV',
author_email='frmdstryr@gmail.com',
url='https://github.com/codelv/enaml-web',
Expand Down
6 changes: 3 additions & 3 deletions web/components/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@author: jrm
"""
from atom.api import Enum, Unicode, Typed, ForwardTyped, observe
from atom.api import Str, Typed, ForwardTyped, observe
from enaml.core.declarative import d_
from .raw import Raw, ProxyRawNode

Expand All @@ -34,10 +34,10 @@ class Code(Raw):
proxy = Typed(ProxyCode)

#: Language to parse if none is given it will guess which to use
language = d_(Unicode())
language = d_(Str())

#: Highlighter style to use
highlight_style = d_(Unicode()).tag(attr=False)
highlight_style = d_(Str()).tag(attr=False)

@observe('language', 'highlight_style')
def _update_proxy(self, change):
Expand Down
106 changes: 53 additions & 53 deletions web/components/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from __future__ import print_function
from atom.api import (
Atom, Event, Enum, ContainerList, Value, Int, Unicode, Dict, Instance,
Atom, Event, Enum, ContainerList, Value, Int, Str, Dict, Instance,
ForwardTyped, Typed, Coerced, observe, set_default
)

Expand All @@ -37,10 +37,10 @@ class Tag(ToolkitObject):
proxy = Typed(ProxyTag)

#: Object ID
id = d_(Unicode())
id = d_(Str())

#: Tag name
tag = d_(Unicode()).tag(attr=False)
tag = d_(Str()).tag(attr=False)

#: CSS classes
cls = d_(Instance((list, object))).tag(attr=False)
Expand All @@ -49,19 +49,19 @@ class Tag(ToolkitObject):
style = d_(Instance((dict, object))).tag(attr=False)

#: Node text
text = d_(Unicode()).tag(attr=False)
text = d_(Str()).tag(attr=False)

#: Node tail text
tail = d_(Unicode()).tag(attr=False)
tail = d_(Str()).tag(attr=False)

#: Alt attribute
alt = d_(Unicode())
alt = d_(Str())

#: Custom attributes not explicitly defined
attrs = d_(Dict()).tag(attr=False)

#: JS onclick definition
onclick = d_(Unicode())
onclick = d_(Str())

#: Used to tell js to send click events back to the server
clickable = d_(Coerced(bool))
Expand All @@ -74,13 +74,13 @@ class Tag(ToolkitObject):
draggable = d_(Coerced(bool)).tag(attr=False)

#: JS ondragstart definition
ondragstart = d_(Unicode())
ondragstart = d_(Str())

#: JS ondragover definition
ondragover = d_(Unicode())
ondragover = d_(Str())

#: JS ondrop definition
ondrop = d_(Unicode())
ondrop = d_(Str())

#: Event triggered when a drop occurs
dropped = d_(Event(ToolkitObject))
Expand Down Expand Up @@ -352,7 +352,7 @@ class A(Tag):
tag = set_default('a')

#: Set the url
href = d_(Unicode())
href = d_(Str())

#: Set the target options
target = d_(Enum("", "_blank", "_self", "_parent", "_top", "framename"))
Expand Down Expand Up @@ -421,7 +421,7 @@ class Blockquote(Tag):
#: Set the tag name
tag = set_default('blockquote')

cite = d_(Unicode())
cite = d_(Str())

@observe('cite')
def _update_proxy(self, change):
Expand All @@ -447,16 +447,16 @@ class Bdo(Tag):
#: Set the tag name
tag = set_default('bdo')

dir = d_(Unicode())
dir = d_(Str())


class Img(Tag):
#: Set the tag name
tag = set_default('img')

src = d_(Unicode())
width = d_(Unicode())
height = d_(Unicode())
src = d_(Str())
width = d_(Str())
height = d_(Str())

@observe('src', 'width', 'height')
def _update_proxy(self, change):
Expand All @@ -472,10 +472,10 @@ class Link(Tag):
#: Set the tag name
tag = set_default('link')

type = d_(Unicode())
rel = d_(Unicode())
href = d_(Unicode())
media = d_(Unicode())
type = d_(Str())
rel = d_(Str())
href = d_(Str())
media = d_(Str())

@observe('type', 'rel', 'href', 'media')
def _update_proxy(self, change):
Expand All @@ -486,7 +486,7 @@ class Map(Tag):
#: Set the tag name
tag = set_default('map')

name = d_(Unicode())
name = d_(Str())

@observe('name')
def _update_proxy(self, change):
Expand All @@ -497,9 +497,9 @@ class Area(Tag):
#: Set the tag name
tag = set_default('area')

shape = d_(Unicode())
coords = d_(Unicode())
href = d_(Unicode())
shape = d_(Str())
coords = d_(Str())
href = d_(Str())

@observe('shape', 'coords', 'href')
def _update_proxy(self, change):
Expand All @@ -520,8 +520,8 @@ class Td(Tag):
#: Set the tag name
tag = set_default('td')

colspan = d_(Unicode())
rowspan = d_(Unicode())
colspan = d_(Str())
rowspan = d_(Str())

@observe('colspan', 'rowspan')
def _update_proxy(self, change):
Expand All @@ -532,8 +532,8 @@ class Th(Tag):
#: Set the tag name
tag = set_default('th')

colspan = d_(Unicode())
rowspan = d_(Unicode())
colspan = d_(Str())
rowspan = d_(Str())

@observe('colspan', 'rowspan')
def _update_proxy(self, change):
Expand Down Expand Up @@ -600,10 +600,10 @@ class IFrame(Tag):
#: Set the tag name
tag = set_default('iframe')

src = d_(Unicode())
height = d_(Unicode())
width = d_(Unicode())
target = d_(Unicode())
src = d_(Str())
height = d_(Str())
width = d_(Str())
target = d_(Str())

@observe('src', 'height', 'width', 'target')
def _update_proxy(self, change):
Expand All @@ -613,8 +613,8 @@ def _update_proxy(self, change):
class Script(Tag):
#: Set the tag name
tag = set_default('script')
src = d_(Unicode())
type = d_(Unicode())
src = d_(Str())
type = d_(Str())

@observe('type', 'src')
def _update_proxy(self, change):
Expand All @@ -630,8 +630,8 @@ class Meta(Tag):
#: Set the tag name
tag = set_default('meta')

name = d_(Unicode())
content = d_(Unicode())
name = d_(Str())
content = d_(Str())

@observe('name', 'content')
def _update_proxy(self, change):
Expand All @@ -642,7 +642,7 @@ class Base(Tag):
#: Set the tag name
tag = set_default('base')

href = d_(Unicode())
href = d_(Str())
target = d_(Enum("", "_blank", "_self", "_parent", "_top", "framename"))

@observe('href', 'target')
Expand Down Expand Up @@ -694,7 +694,7 @@ class Form(Tag):
#: Set the tag name
tag = set_default('form')

action = d_(Unicode())
action = d_(Str())
method = d_(Enum("post", "get"))

@observe('action', 'method')
Expand All @@ -721,8 +721,8 @@ class Select(Tag):
#: Set the tag name
tag = set_default('select')

name = d_(Unicode())
value = d_(Unicode())
name = d_(Str())
value = d_(Str())

def _default_name(self):
return u'{}'.format(self.id)
Expand All @@ -736,7 +736,7 @@ class Option(Tag):
#: Set the tag name
tag = set_default('option')

value = d_(Unicode())
value = d_(Str())
selected = d_(Coerced(bool))

@observe('value', 'selected')
Expand All @@ -748,7 +748,7 @@ class OptGroup(Tag):
#: Set the tag name
tag = set_default('optgroup')

label = d_(Unicode())
label = d_(Str())
disabled = d_(Coerced(bool))

@observe('label', 'disabled')
Expand All @@ -760,9 +760,9 @@ class Input(Tag):
#: Set the tag name
tag = set_default('input')

name = d_(Unicode())
type = d_(Unicode())
placeholder = d_(Unicode())
name = d_(Str())
type = d_(Str())
placeholder = d_(Str())
disabled = d_(Coerced(bool))
checked = d_(Coerced(bool))
value = d_(Value())
Expand All @@ -779,9 +779,9 @@ class Textarea(Tag):
#: Set the tag name
tag = set_default('textarea')

name = d_(Unicode())
rows = d_(Unicode())
cols = d_(Unicode())
name = d_(Str())
rows = d_(Str())
cols = d_(Str())

def _default_name(self):
return u'{}'.format(self.id)
Expand All @@ -795,9 +795,9 @@ class Button(Tag):
#: Set the tag name
tag = set_default('button')

name = d_(Unicode())
type = d_(Unicode())
value = d_(Unicode('1'))
name = d_(Str())
type = d_(Str())
value = d_(Str('1'))

def _default_name(self):
return u'{}'.format(self.id)
Expand All @@ -822,8 +822,8 @@ class Source(Tag):
#: Set the tag name
tag = set_default('source')

src = d_(Unicode())
type = d_(Unicode())
src = d_(Str())
type = d_(Str())

@observe('src', 'type')
def _update_proxy(self, change):
Expand Down
2 changes: 1 addition & 1 deletion web/components/ipynb.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@author: jrm
"""
from atom.api import Enum, Unicode, Int, Typed, ForwardTyped, observe
from atom.api import Int, Typed, ForwardTyped, observe
from enaml.core.declarative import d_
from .raw import Raw, ProxyRawNode

Expand Down
4 changes: 2 additions & 2 deletions web/components/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@author: jrm
"""
from atom.api import Unicode, Typed, ForwardTyped, set_default, observe
from atom.api import Str, Typed, ForwardTyped, set_default, observe
from enaml.core.declarative import d_
from .html import Tag, ProxyTag

Expand All @@ -35,7 +35,7 @@ class Raw(Tag):
tag = set_default("div")

#: Raw source to parse and display
source = d_(Unicode()).tag(attr=False)
source = d_(Str()).tag(attr=False)

@observe('source')
def _update_proxy(self, change):
Expand Down

0 comments on commit 032dac6

Please sign in to comment.