##// END OF EJS Templates
use consisten double quote docstring formatting
marcink -
r3886:a1696507 beta
parent child Browse files
Show More
@@ -87,8 +87,8 b' class ErrorController(BaseController):'
87 87 return fapp(request.environ, self.start_response)
88 88
89 89 def get_error_explanation(self, code):
90 ''' get the error explanations of int codes
91 [400, 401, 403, 404, 500]'''
90 """ get the error explanations of int codes
91 [400, 401, 403, 404, 500]"""
92 92 try:
93 93 code = int(code)
94 94 except Exception:
@@ -144,11 +144,11 b' class ModelGenerator(object):'
144 144 return '\n'.join(out)
145 145
146 146 def genB2AMigration(self, indent=' '):
147 '''Generate a migration from B to A.
147 """Generate a migration from B to A.
148 148
149 149 Was: toUpgradeDowngradePython
150 150 Assume model (A) is most current and database (B) is out-of-date.
151 '''
151 """
152 152
153 153 decls = ['from migrate.changeset import schema',
154 154 'pre_meta = MetaData()',
@@ -244,7 +244,7 b' class SchemaDiff(object):'
244 244 self.tables_different[table_name]=td
245 245
246 246 def __str__(self):
247 ''' Summarize differences. '''
247 """ Summarize differences. """
248 248 out = []
249 249 column_template =' %%%is: %%r' % self.label_width
250 250
@@ -1,4 +1,4 b''
1 '''
1 """
2 2 Module provides a class allowing to wrap communication over subprocess.Popen
3 3 input, output, error streams into a meaningfull, non-blocking, concurrent
4 4 stream processor exposing the output data as an iterator fitting to be a
@@ -21,7 +21,7 b' GNU Lesser General Public License for mo'
21 21 You should have received a copy of the GNU Lesser General Public License
22 22 along with git_http_backend.py Project.
23 23 If not, see <http://www.gnu.org/licenses/>.
24 '''
24 """
25 25 import os
26 26 import subprocess
27 27 from rhodecode.lib.vcs.utils.compat import deque, Event, Thread, _bytes, _bytearray
@@ -143,7 +143,7 b' class InputStreamChunker(Thread):'
143 143
144 144
145 145 class BufferedGenerator():
146 '''
146 """
147 147 Class behaves as a non-blocking, buffered pipe reader.
148 148 Reads chunks of data (through a thread)
149 149 from a blocking pipe, and attaches these to an array (Deque) of chunks.
@@ -153,7 +153,7 b' class BufferedGenerator():'
153 153 to be sent or by not returning until there is some data to send
154 154 When we get EOF from underlying source pipe we raise the marker to raise
155 155 StopIteration after the last chunk of data is yielded.
156 '''
156 """
157 157
158 158 def __init__(self, source, buffer_size=65536, chunk_size=4096,
159 159 starting_values=[], bottomless=False):
@@ -229,29 +229,29 b' class BufferedGenerator():'
229 229
230 230 @property
231 231 def done_reading_event(self):
232 '''
232 """
233 233 Done_reding does not mean that the iterator's buffer is empty.
234 234 Iterator might have done reading from underlying source, but the read
235 235 chunks might still be available for serving through .next() method.
236 236
237 237 @return An Event class instance.
238 '''
238 """
239 239 return self.worker.EOF
240 240
241 241 @property
242 242 def done_reading(self):
243 '''
243 """
244 244 Done_reding does not mean that the iterator's buffer is empty.
245 245 Iterator might have done reading from underlying source, but the read
246 246 chunks might still be available for serving through .next() method.
247 247
248 248 @return An Bool value.
249 '''
249 """
250 250 return self.worker.EOF.is_set()
251 251
252 252 @property
253 253 def length(self):
254 '''
254 """
255 255 returns int.
256 256
257 257 This is the lenght of the que of chunks, not the length of
@@ -265,7 +265,7 b' class BufferedGenerator():'
265 265 the responce's length will be set to that. In order not to
266 266 confuse WSGI PEP3333 servers, we will not implement __len__
267 267 at all.
268 '''
268 """
269 269 return len(self.data)
270 270
271 271 def prepend(self, x):
@@ -282,7 +282,7 b' class BufferedGenerator():'
282 282
283 283
284 284 class SubprocessIOChunker(object):
285 '''
285 """
286 286 Processor class wrapping handling of subprocess IO.
287 287
288 288 In a way, this is a "communicate()" replacement with a twist.
@@ -324,10 +324,10 b' class SubprocessIOChunker(object):'
324 324 # return answer
325 325
326 326
327 '''
327 """
328 328 def __init__(self, cmd, inputstream=None, buffer_size=65536,
329 329 chunk_size=4096, starting_values=[], **kwargs):
330 '''
330 """
331 331 Initializes SubprocessIOChunker
332 332
333 333 :param cmd: A Subprocess.Popen style "cmd". Can be string or array of strings
@@ -335,7 +335,7 b' class SubprocessIOChunker(object):'
335 335 :param buffer_size: (Default: 65536) A size of total buffer per stream in bytes.
336 336 :param chunk_size: (Default: 4096) A max size of a chunk. Actual chunk may be smaller.
337 337 :param starting_values: (Default: []) An array of strings to put in front of output que.
338 '''
338 """
339 339
340 340 if inputstream:
341 341 input_streamer = StreamFeeder(inputstream)
@@ -257,7 +257,7 b' class GitChangesetTest(unittest.TestCase'
257 257 .get_node('index.rst'))
258 258
259 259 def test_branch_and_tags(self):
260 '''
260 """
261 261 rev0 = self.repo.revisions[0]
262 262 chset0 = self.repo.get_changeset(rev0)
263 263 self.assertEqual(chset0.branch, 'master')
@@ -274,7 +274,7 b' class GitChangesetTest(unittest.TestCase'
274 274
275 275 tip = self.repo.get_changeset('tip')
276 276 self.assertTrue('tip' in tip.tags)
277 '''
277 """
278 278 # Those tests would fail - branches are now going
279 279 # to be changed at main API in order to support git backend
280 280 pass
General Comments 0
You need to be logged in to leave comments. Login now