Home | History | Annotate | Download | only in python2.7

Lines Matching full:out_file

29 encode(in_file, out_file [,name, mode])
30 decode(in_file [, out_file, mode])
42 def encode(in_file, out_file, name=None, mode=None):
62 # Open out_file if it is a pathname
64 if out_file == '-':
65 out_file = sys.stdout
66 elif isinstance(out_file, basestring):
67 out_file = open(out_file, 'wb')
68 opened_files.append(out_file)
79 out_file.write('begin %o %s\n' % ((mode&0777),name))
82 out_file.write(binascii.b2a_uu(data))
84 out_file.write(' \nend\n')
90 def decode(in_file, out_file=None, mode=None, quiet=0):
118 if out_file is None:
119 out_file = hdrfields[2].rstrip()
120 if os.path.exists(out_file):
121 raise Error('Cannot overwrite existing file: %s' % out_file)
127 if out_file == '-':
128 out_file = sys.stdout
129 elif isinstance(out_file, basestring):
130 fp = open(out_file, 'wb')
132 os.path.chmod(out_file, mode)
135 out_file = fp
136 opened_files.append(out_file)
150 out_file.write(data)