• Home
  • Raw
  • Download

Lines Matching +full:open +full:- +full:source

1 # -*- coding: utf-8 -*-
25 return open(fn, mode, encoding=encoding or TEXT_ENCODING)
29 return open(fn, mode)
41 return (("%s-%s-%s.txt" % (name, TEXT_ENCODING, NEWLINES), size)
106 for i in xrange(0, size - 1):
116 for i in xrange(0, size - 1, 1000):
138 def write_bytewise(f, source): argument
140 for i in xrange(0, len(source)):
141 f.write(source[i:i+1])
145 def write_small_chunks(f, source): argument
147 for i in xrange(0, len(source), 20):
148 f.write(source[i:i+20])
152 def write_medium_chunks(f, source): argument
154 for i in xrange(0, len(source), 4096):
155 f.write(source[i:i+4096])
159 def write_large_chunks(f, source): argument
161 for i in xrange(0, len(source), 1000000):
162 f.write(source[i:i+1000000])
167 def modify_bytewise(f, source): argument
170 for i in xrange(0, len(source)):
171 f.write(source[i:i+1])
175 def modify_small_chunks(f, source): argument
178 for i in xrange(0, len(source), 20):
179 f.write(source[i:i+20])
183 def modify_medium_chunks(f, source): argument
186 for i in xrange(0, len(source), 4096):
187 f.write(source[i:i+4096])
191 def modify_seek_forward_bytewise(f, source): argument
194 for i in xrange(0, len(source), 2):
195 f.write(source[i:i+1])
200 def modify_seek_forward_blockwise(f, source): argument
203 for i in xrange(0, len(source), 2000):
204 f.write(source[i:i+1000])
210 def read_modify_bytewise(f, source): argument
213 for i in xrange(0, len(source), 2):
215 f.write(source[i+1:i+2])
219 def read_modify_blockwise(f, source): argument
222 for i in xrange(0, len(source), 2000):
224 f.write(source[i+1000:i+2000])
254 if _t() - start_timestamp > duration:
257 real = (end[4] if start[4] else time.time()) - real_start
258 return n, real, sum(end[0:2]) - sum(start[0:2])
261 with open(filename, "rb") as f:
267 name = re.split(r'[-.]', filename)[0]
314 text = "UCS-4 (wide build)"
316 text = "UTF-16 (narrow build)"
326 print("Text unit = one character (%s-decoded)" % TEXT_ENCODING)
331 run_test_family(read_tests, "t", binary_files, lambda fn: open(fn, "rb"))
342 with open(name, "rb") as f:
345 lambda fn: open(os.devnull, "wb"), make_test_source)
360 with open(name, "rb") as f:
363 lambda fn: open(fn, "r+b"), make_test_source)
381 with open(name, "wb") as f:
412 tail = tail[:-1]
413 with open(name, "wb") as f:
420 usage = "usage: %prog [-h|--help] [options]"
422 parser.add_option("-b", "--binary",
425 parser.add_option("-t", "--text",
428 parser.add_option("-r", "--read",
431 parser.add_option("-w", "--write",
434 parser.add_option("-E", "--encoding",
437 parser.add_option("-N", "--newlines",
441 parser.add_option("-m", "--io-module",
443 help="io module to test (default: builtin open())")
469 globals()['open'] = __import__(options.io_module, {}, {}, ['open']).open
478 # -- This part to exercise text reading. Don't change anything! --
525 skyli-t maðr hræsinn vera,
553 …gion, mais la liberté, la justice ! voilà, qui que vous soyez, ce qui n'est pas au-dessous de vous.
554-même, j'ai dû me borner à raisonner ; m'échauffer eût été m'avilir. J'aurai donc trouvé grâce en …