コード例 #1
0
 def get_target(cls, obj):
     objtype = obj.__class__.__name__
     group = sanitize_identifier(obj.group)
     label = ('.' + sanitize_identifier(obj.label) if obj.label else '')
     target = '{objtype}.{group}{label}'.format(objtype=objtype,
                                                group=group,
                                                label=label)
     return (None, target) if hasattr(obj, 'values') else (target, None)
コード例 #2
0
ファイル: pprint.py プロジェクト: CaptainAL/Spyder
 def get_target(cls, obj):
     objtype=obj.__class__.__name__
     group = sanitize_identifier(obj.group)
     label = ('.'+sanitize_identifier(obj.label) if obj.label else '')
     target = '{objtype}.{group}{label}'.format(objtype=objtype,
                                                group=group,
                                                label=label)
     return (None, target) if hasattr(obj, 'values') else (target, None)
コード例 #3
0
 def test_arabic_five_sanitized_py3(self):
     """
     Note: There would be a clash if you mixed the languages of
     your digits! E.g arabic ٥ five and urdu ۵ five
     """
     try:
         sanitize_identifier('٥', version=3)
     except SyntaxError as e:
         assert str(e).startswith("String '٥' cannot be sanitized")
コード例 #4
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_arabic_five_sanitized_py3(self):
     """
     Note: There would be a clash if you mixed the languages of
     your digits! E.g arabic ٥ five and urdu ۵ five
     """
     try:
         sanitize_identifier('٥', version=3)
     except SyntaxError as e:
         assert str(e).startswith("String '٥' cannot be sanitized")
コード例 #5
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_urdu_a_five_sanitized_py3(self):
     """
     Note: There would be a clash if you mixed the languages of
     your digits! E.g arabic ٥ five and urdu ۵ five
     """
     sanitized = sanitize_identifier('a ۵', version=3)
     self.assertEqual(sanitized, 'A_۵')
コード例 #6
0
 def test_urdu_a_five_sanitized_py3(self):
     """
     Note: There would be a clash if you mixed the languages of
     your digits! E.g arabic ٥ five and urdu ۵ five
     """
     sanitized = sanitize_identifier('a ۵', version=3)
     self.assertEqual(sanitized, 'A_۵')
コード例 #7
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_urdu_five_sanitized_py3(self):
     try:
         sanitize_identifier('۵', version=3)
     except SyntaxError as e:
         assert str(e).startswith("String '۵' cannot be sanitized")
コード例 #8
0
 def test_simple_a_pound_sanitized_py2(self):
     sanitized = sanitize_identifier('a £', version=2)
     self.assertEqual(sanitized, 'A_pound')
コード例 #9
0
 def test_custom_dollar_removal_py2(self):
     sanitize_identifier.eliminations.extend(['dollar'])
     sanitized = sanitize_identifier('$E$', version=3)
     self.assertEqual(sanitized, 'E')
     sanitize_identifier.eliminations.remove('dollar')
コード例 #10
0
 def test_capital_delta_sanitized_py2(self):
     sanitized = sanitize_identifier('Δ', version=2)
     self.assertEqual(sanitized, 'Delta')
コード例 #11
0
 def test_simple_alpha_sanitized_py2(self):
     sanitized = sanitize_identifier('α', version=2)
     self.assertEqual(sanitized, 'alpha')
コード例 #12
0
 def test_simple_digit_sanitized_py2(self):
     sanitized = sanitize_identifier('0', version=2)
     self.assertEqual(sanitized, 'A_0')
コード例 #13
0
 def test_simple_alpha_beta_mixed_underscore_space_sanitized_py3(self):
     sanitized = sanitize_identifier('α__  β', version=3)
     self.assertEqual(sanitized, 'α__β')
コード例 #14
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_simple_alpha_beta_double_underscore_sanitized_py2(self):
     sanitized = sanitize_identifier('α__β', version=2)
     self.assertEqual(sanitized, 'alpha__beta')
コード例 #15
0
 def test_simple_alpha_beta_double_underscore_sanitized_py2(self):
     sanitized = sanitize_identifier('α__β', version=2)
     self.assertEqual(sanitized, 'alpha__beta')
コード例 #16
0
 def test_simple_dollar_sanitized_py3(self):
     sanitized = sanitize_identifier('$', version=3)
     self.assertEqual(sanitized, 'dollar')
コード例 #17
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_umlaut_sanitized_py2(self):
     sanitized = sanitize_identifier('Festkörperphysik', version=2)
     self.assertEqual(sanitized, 'Festkorperphysik')
コード例 #18
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_alpha_times_two_py3(self):
     sanitized = sanitize_identifier('α*2', version=3)
     self.assertEqual(sanitized,  'α_times_2')
コード例 #19
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_simple_alpha_beta_mixed_underscore_space_sanitized_py3(self):
     sanitized = sanitize_identifier('α__  β', version=3)
     self.assertEqual(sanitized, 'α__β')
コード例 #20
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_simple_alpha_beta_sanitized_py3(self):
     sanitized = sanitize_identifier('α β', version=3)
     self.assertEqual(sanitized, 'α_β')
コード例 #21
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_simple_dollar_sanitized_py3(self):
     sanitized = sanitize_identifier('$', version=3)
     self.assertEqual(sanitized, 'dollar')
コード例 #22
0
 def test_umlaut_sanitized_py2(self):
     sanitized = sanitize_identifier('Festkörperphysik', version=2)
     self.assertEqual(sanitized, 'Festkorperphysik')
コード例 #23
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_power_umlaut_sanitized_py3(self):
     sanitized = sanitize_identifier('^Festkörperphysik', version=3)
     self.assertEqual(sanitized, 'power_Festkörperphysik')
コード例 #24
0
 def test_simple_alpha_beta_sanitized_py3(self):
     sanitized = sanitize_identifier('α β', version=3)
     self.assertEqual(sanitized, 'α_β')
コード例 #25
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_simple_digit_sanitized_py2(self):
     sanitized = sanitize_identifier('0', version=2)
     self.assertEqual(sanitized, 'A_0')
コード例 #26
0
 def test_alpha_times_two_py3(self):
     sanitized = sanitize_identifier('α*2', version=3)
     self.assertEqual(sanitized, 'α_times_2')
コード例 #27
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_simple_underscore_sanitized_py2(self):
     sanitized = sanitize_identifier('_test', version=2)
     self.assertEqual(sanitized, 'A__test')
コード例 #28
0
 def test_urdu_five_sanitized_py3(self):
     try:
         sanitize_identifier('۵', version=3)
     except SyntaxError as e:
         assert str(e).startswith("String '۵' cannot be sanitized")
コード例 #29
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_simple_alpha_sanitized_py2(self):
     sanitized = sanitize_identifier('α', version=2)
     self.assertEqual(sanitized, 'alpha')
コード例 #30
0
 def test_power_umlaut_sanitized_py3(self):
     sanitized = sanitize_identifier('^Festkörperphysik', version=3)
     self.assertEqual(sanitized, 'power_Festkörperphysik')
コード例 #31
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_simple_a_dollar_sanitized_py2(self):
     sanitized = sanitize_identifier('a $', version=2)
     self.assertEqual(sanitized, 'A_dollar')
コード例 #32
0
 def test_simple_underscore_sanitized_py2(self):
     sanitized = sanitize_identifier('_test', version=2)
     self.assertEqual(sanitized, 'A__test')
コード例 #33
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_capital_delta_sanitized_py2(self):
     sanitized = sanitize_identifier('Δ', version=2)
     self.assertEqual(sanitized, 'Delta')
コード例 #34
0
 def test_simple_a_dollar_sanitized_py2(self):
     sanitized = sanitize_identifier('a $', version=2)
     self.assertEqual(sanitized, 'A_dollar')
コード例 #35
0
ファイル: testutils.py プロジェクト: aashish24/holoviews
 def test_lowercase_delta_sanitized_py2(self):
     sanitized = sanitize_identifier('δ', version=2)
     self.assertEqual(sanitized, 'delta')
コード例 #36
0
 def test_lowercase_delta_sanitized_py2(self):
     sanitized = sanitize_identifier('δ', version=2)
     self.assertEqual(sanitized, 'delta')
コード例 #37
0
 def test_simple_pound_sanitized_py3(self):
     sanitized = sanitize_identifier('£', version=3)
     self.assertEqual(sanitized, 'pound')