Lines Matching +full:upload +full:- +full:build
1 # -*- coding: utf-8 -*-
4 Implements a Distutils 'upload_docs' subcommand (upload documentation to
25 from .upload import upload
29 return s.encode('utf-8', 'surrogateescape')
32 class upload_docs(upload):
37 description = 'Upload documentation to sites other than PyPi such as devpi'
41 "url of repository [default: %s]" % upload.DEFAULT_REPOSITORY),
42 ('show-response', None,
44 ('upload-dir=', None, 'directory to upload'),
46 boolean_options = upload.boolean_options
57 upload.initialize_options(self)
62 upload.finalize_options(self)
68 build = self.get_finalized_command('build')
69 self.target_dir = os.path.join(build.build_base, 'docs')
75 self.announce('Using upload directory %s' % self.target_dir)
83 tmpl = "no files found in upload directory '%s'"
116 title = '\nContent-Disposition: form-data; name="%s"' % key
130 if value and value[-1:] == b'\r':
136 Build up the MIME payload for the POST data
138 boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
139 sep_boundary = b'\n--' + boundary.encode('ascii')
140 end_boundary = sep_boundary + b'--'
149 content_type = 'multipart/form-data; boundary=%s' % boundary
171 # build the Request
189 conn.putheader('Content-type', content_type)
190 conn.putheader('Content-length', str(len(body)))
206 msg = 'Upload successful. Visit %s' % location
209 msg = 'Upload failed (%s): %s' % (r.status, r.reason)
212 print('-' * 75, r.read(), '-' * 75)