File: more-six.u.patch

package info (click to toggle)
python-wsme 0.6-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 956 kB
  • ctags: 1,831
  • sloc: python: 8,452; makefile: 138
file content (173 lines) | stat: -rw-r--r-- 6,972 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 python-wsme (0.6-2) experimental; urgency=medium
 .
   * New upstream release.
   * Removed debian/patches/Fix_SyntaxWarning_under_Python_3.patch now applied
     upstream.
   * Adds a patch to fix a unicode string not compatible with Python 3.2.
Author: Thomas Goirand <zigo@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- python-wsme-0.6.orig/wsmeext/sphinxext.py
+++ python-wsme-0.6/wsmeext/sphinxext.py
@@ -206,7 +206,7 @@ class TypeDocumenter(autodoc.ClassDocume
         return self.object.__name__
 
     def format_signature(self):
-        return u''
+        return six.u('')
 
     def add_directive_header(self, sig):
         super(TypeDocumenter, self).add_directive_header(sig)
@@ -237,26 +237,26 @@ class TypeDocumenter(autodoc.ClassDocume
             if protocols:
                 sample_obj = make_sample_object(self.object)
                 content.extend([
-                    l_(u'Data samples:'),
-                    u'',
-                    u'.. cssclass:: toggle',
-                    u''
+                    l_(six.u('Data samples:')),
+                    six.u(''),
+                    six.u('.. cssclass:: toggle'),
+                    six.u('')
                 ])
                 for name, protocol in protocols:
                     language, sample = protocol.encode_sample_value(
                         self.object, sample_obj, format=True)
                     content.extend([
                         name,
-                        u'    .. code-block:: ' + language,
-                        u'',
+                        six.u('    .. code-block:: ') + language,
+                        six.u(''),
                     ])
                     content.extend(
-                        u' ' * 8 + line
+                        six.u(' ') * 8 + line
                         for line in six.text_type(sample).split('\n'))
             for line in content:
-                self.add_line(line, u'<wsmeext.sphinxext')
+                self.add_line(line, six.u('<wsmeext.sphinxext'))
 
-            self.add_line(u'', '<wsmeext.sphinxext>')
+            self.add_line(six.u(''), '<wsmeext.sphinxext>')
 
         if samples_slot == 'after-docstring':
             add_docstring()
@@ -284,10 +284,10 @@ class AttributeDocumenter(autodoc.Attrib
 
     def add_content(self, more_content, no_docstring=False):
         self.add_line(
-            u':type: %s' % datatypename(self.datatype),
+            six.u(':type: %s') % datatypename(self.datatype),
             '<wsmeext.sphinxext>'
         )
-        self.add_line(u'', '<wsmeext.sphinxext>')
+        self.add_line(six.u(''), '<wsmeext.sphinxext>')
         super(AttributeDocumenter, self).add_content(
             more_content, no_docstring)
 
@@ -357,7 +357,7 @@ class ServiceDocumenter(autodoc.ClassDoc
             self.directive.result.pop()
 
     def format_signature(self):
-        return u''
+        return six.u('')
 
     def format_name(self):
         path = find_service_path(self.env, self.object)
@@ -391,11 +391,11 @@ def document_function(funcdef, docstring
 
     for arg in funcdef.arguments:
         content = [
-            u':type  %s: :wsme:type:`%s`' % (
+            six.u(':type  %s: :wsme:type:`%s`') % (
                 arg.name, datatypename(arg.datatype))
         ]
         if arg.name not in found_params:
-            content.insert(0, u':param %s: ' % (arg.name))
+            content.insert(0, six.u(':param %s: ') % (arg.name))
             pos = next_param_pos
         else:
             for si, docstring in enumerate(docstrings):
@@ -411,7 +411,7 @@ def document_function(funcdef, docstring
 
     if funcdef.return_type:
         content = [
-            u':rtype: %s' % datatypename(funcdef.return_type)
+            six.u(':rtype: %s') % datatypename(funcdef.return_type)
         ]
         pos = None
         for si, docstring in enumerate(docstrings):
@@ -436,38 +436,38 @@ def document_function(funcdef, docstring
                 make_sample_object(arg.datatype)
             ))
         codesamples.extend([
-            u':%s:' % l_(u'Parameters samples'),
-            u'    .. cssclass:: toggle',
-            u''
+            six.u(':%s:') % l_(six.u('Parameters samples')),
+            six.u('    .. cssclass:: toggle'),
+            six.u('')
         ])
         for name, protocol in protocols:
             language, sample = protocol.encode_sample_params(
                 params, format=True)
             codesamples.extend([
-                u' ' * 4 + name,
-                u'        .. code-block:: ' + language,
-                u'',
+                six.u(' ') * 4 + name,
+                six.u('        .. code-block:: ') + language,
+                six.u(''),
             ])
             codesamples.extend((
-                u' ' * 12 + line for line in sample.split('\n')))
+                six.u(' ') * 12 + line for line in sample.split('\n')))
 
         if funcdef.return_type:
             codesamples.extend([
-                u':%s:' % l_(u'Return samples'),
-                u'    .. cssclass:: toggle',
-                u''
+                six.u(':%s:') % l_(u'Return samples'),
+                six.u('    .. cssclass:: toggle'),
+                six.u('')
             ])
             sample_obj = make_sample_object(funcdef.return_type)
             for name, protocol in protocols:
                 language, sample = protocol.encode_sample_result(
                     funcdef.return_type, sample_obj, format=True)
                 codesamples.extend([
-                    u' ' * 4 + name,
-                    u'        .. code-block:: ' + language,
-                    u'',
+                    six.u(' ') * 4 + name,
+                    six.u('        .. code-block:: ') + language,
+                    six.u(''),
                 ])
                 codesamples.extend((
-                    u' ' * 12 + line for line in sample.split('\n')))
+                    six.u(' ') * 12 + line for line in sample.split('\n')))
 
     docstrings[0:0] = [codesamples]
     return docstrings