Skip to content

Commit

Permalink
CLN : Remove u-string prefixes (#192)
Browse files Browse the repository at this point in the history
The u-string prefixes arent needed on python 3

	modified:   apptools/help/help_plugin/help_submenu_manager.py
	modified:   apptools/logger/agent/tests/test_attachments.py
	modified:   apptools/persistence/tests/test_state_pickler.py
	modified:   apptools/preferences/tests/test_preferences_helper.py
	modified:   setup.py
  • Loading branch information
Poruri Sai Rahul committed Nov 9, 2020
1 parent 75453bd commit a693c79
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions apptools/help/help_plugin/help_submenu_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class DocumentsMenuManager(HelpSubmenuManager):

# The menu manager's name (if the manager is a sub-menu, this is what its
# label will be).
name = u'&Documents'
name = '&Documents'

#### 'DocMenuManager' interface ##########################################

Expand Down Expand Up @@ -151,7 +151,7 @@ class DemosMenuManager(HelpSubmenuManager):

# The menu manager's name (if the manager is a sub-menu, this is what its
# label will be).
name = u'D&emos'
name = 'D&emos'

#### 'DemoMenuManager' interface ##########################################

Expand Down Expand Up @@ -191,7 +191,7 @@ class ExamplesMenuManager(HelpSubmenuManager):

# The menu manager's name (if the manager is a sub-menu, this is what its
# label will be).
name = u'&Examples'
name = '&Examples'

#### 'ExampleMenuManager' interface ##########################################

Expand Down Expand Up @@ -236,7 +236,7 @@ class DownloadsMenuManager(HelpSubmenuManager):

# The menu manager's name (if the manager is a sub-menu, this is what its
# label will be).
name = u'&Downloads'
name = '&Downloads'

#### 'DocMenuManager' interface ##########################################

Expand Down
2 changes: 1 addition & 1 deletion apptools/logger/agent/tests/test_attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def setUp(self):

self.tmpfile = os.path.join(self.tmpdir, "dummy_file.txt")
with io.open(self.tmpfile, 'w', encoding='utf8') as filehandle:
filehandle.write(u"Dummy data in dummy file for dummies")
filehandle.write("Dummy data in dummy file for dummies")

def test_attaching_workspace(self):
class DummyWorkspace(object):
Expand Down
8 changes: 4 additions & 4 deletions apptools/persistence/tests/test_state_pickler.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self):
self.c = complex(1.01234, 2.3)
self.n = None
self.s = 'String'
self.u = u'Unicode'
self.u = 'Unicode'
self.inst = A()
self.tuple = (1, 2, 'a', A())
self.list = [1, 1.1, 'a', 1j, self.inst]
Expand All @@ -69,7 +69,7 @@ class TestTraits(HasTraits):
c = Complex(complex(1.01234, 2.3))
n = Any
s = Str('String')
u = Str(u'Unicode')
u = Str('Unicode')
inst = Instance(A)
tuple = Tuple
list = List
Expand All @@ -95,7 +95,7 @@ def set_object(self, obj):
obj.b = True
obj.i = 8
obj.s = 'string'
obj.u = u'unicode'
obj.u = 'unicode'
obj.inst.a = 'b'
obj.list[0] = 2
obj.tuple[-1].a = 't'
Expand Down Expand Up @@ -334,7 +334,7 @@ def test_state_setter(self):
# Rest are unchanged.
self.assertEqual(t1.i, 7)
self.assertEqual(t1.s, 'String')
self.assertEqual(t1.u, u'Unicode')
self.assertEqual(t1.u, 'Unicode')
self.assertEqual(t1.inst.a, 'a')
self.assertEqual(t1.list[0], 1)
self.assertEqual(t1.tuple[-1].a, 'a')
Expand Down
20 changes: 10 additions & 10 deletions apptools/preferences/tests/test_preferences_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class AcmeUIPreferencesHelper(PreferencesHelper):
self.assertEqual(50, helper.width)
self.assertEqual(1.0, helper.ratio)
self.assertTrue(helper.visible)
self.assertEqual(u'acme ui', helper.description)
self.assertEqual('acme ui', helper.description)
self.assertEqual([1, 2, 3, 4], helper.offsets)
self.assertEqual(['joe', 'fred', 'jane'], helper.names)

Expand Down Expand Up @@ -150,7 +150,7 @@ class AcmeUIPreferencesHelper(PreferencesHelper):
self.assertEqual(50, helper.width)
self.assertEqual(1.0, helper.ratio)
self.assertTrue(helper.visible)
self.assertEqual(u'acme ui', helper.description)
self.assertEqual('acme ui', helper.description)
self.assertEqual([1, 2, 3, 4], helper.offsets)
self.assertEqual(['joe', 'fred', 'jane'], helper.names)

Expand Down Expand Up @@ -192,7 +192,7 @@ class AcmeUIPreferencesHelper(PreferencesHelper):
width = Int(50)
ratio = Float(1.0)
visible = Bool(True)
description = Str(u'description')
description = Str('description')
offsets = List(Int, [1, 2, 3, 4])
names = List(Str, ['joe', 'fred', 'jane'])

Expand All @@ -203,7 +203,7 @@ class AcmeUIPreferencesHelper(PreferencesHelper):
self.assertEqual(50, helper.width)
self.assertEqual(1.0, helper.ratio)
self.assertTrue(helper.visible)
self.assertEqual(u'description', helper.description)
self.assertEqual('description', helper.description)
self.assertEqual([1, 2, 3, 4], helper.offsets)
self.assertEqual(['joe', 'fred', 'jane'], helper.names)

Expand All @@ -224,21 +224,21 @@ class AcmeUIPreferencesHelper(PreferencesHelper):
width = Int(50)
ratio = Float(1.0)
visible = Bool(True)
description = Str(u'')
description = Str('')
offsets = List(Int, [1, 2, 3, 4])
names = List(Str, ['joe', 'fred', 'jane'])

helper = AcmeUIPreferencesHelper()

first_unicode_str = u'U\xdc\xf2ser'
first_unicode_str = 'U\xdc\xf2ser'
first_utf8_str = 'U\xc3\x9c\xc3\xb2ser'

original_description = helper.description
helper.description = first_unicode_str
self.assertEqual(first_unicode_str, helper.description)


second_unicode_str = u'caf\xe9'
second_unicode_str = 'caf\xe9'
second_utf8_str = 'caf\xc3\xa9'
helper.description = second_unicode_str
self.assertEqual(second_unicode_str, helper.description)
Expand All @@ -252,7 +252,7 @@ class AcmeUIPreferencesHelper(PreferencesHelper):
p = Preferences()
p.load(tmp)
self.assertEqual(second_unicode_str, p.get('acme.ui.description'))
self.assertEqual(u'True', p.get('acme.ui.visible'))
self.assertEqual('True', p.get('acme.ui.visible'))
self.assertTrue(helper.visible)

def test_no_preferences_path(self):
Expand Down Expand Up @@ -313,7 +313,7 @@ class AcmeUIPreferencesHelper(PreferencesHelper):
self.assertEqual(50, helper.width)
self.assertEqual(1.0, helper.ratio)
self.assertTrue(helper.visible)
self.assertEqual(u'acme ui', helper.description)
self.assertEqual('acme ui', helper.description)
self.assertEqual([1, 2, 3, 4], helper.offsets)
self.assertEqual(['joe', 'fred', 'jane'], helper.names)

Expand Down Expand Up @@ -497,7 +497,7 @@ def _width_changed(self, trait_name, old, new):
self.assertEqual(50, helper.width)
self.assertEqual(1.0, helper.ratio)
self.assertTrue(helper.visible)
self.assertEqual(u'acme ui', helper.description)
self.assertEqual('acme ui', helper.description)
self.assertEqual([1, 2, 3, 4], helper.offsets)
self.assertEqual(['joe', 'fred', 'jane'], helper.names)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
GIT_DIRECTORY = os.path.join(HERE, ".git")

# Template for the autogenerated version file.
VERSION_FILE_TEMPLATE = u'''\
VERSION_FILE_TEMPLATE = '''\
# (C) Copyright 2008-2020 Enthought, Inc., Austin, TX
# All rights reserved.
#
Expand Down

0 comments on commit a693c79

Please sign in to comment.