Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos.buildout
Commits
c442973e
Commit
c442973e
authored
Aug 24, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Follow another spec changes in simulation of sha.
parent
080959a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
src/zc/buildout/testing.py
src/zc/buildout/testing.py
+22
-0
No files found.
src/zc/buildout/testing.py
View file @
c442973e
...
...
@@ -34,6 +34,7 @@ import threading
import
time
import
urllib2
import
json
import
hashlib
import
zc.buildout.buildout
import
zc.buildout.easy_install
...
...
@@ -554,6 +555,27 @@ class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
print '%s %s %s' % (self.command, code, self.path)
class NCHandler(Handler):
def do_POST(self):
path = os.path.abspath(os.path.join(self.tree, *self.path.split('/')))
d = os.path.dirname(path)
if not os.path.exists(d):
os.makedirs(d)
data = self.rfile.read(int(self.headers.getheader('content-length')))
sha512 = hashlib.sha512(data).hexdigest()
try:
d = json.loads(data)
except ValueError:
pass
else:
data = json.dumps([d])
open(path, 'wb').write(data)
self.send_response(201)
self.send_header('Content-Length', str(len(sha512)))
self.send_header('Content-Type', 'text/html')
self.end_headers()
self.wfile.write(sha512)
return
def do_PUT(self):
path = os.path.abspath(os.path.join(self.tree, *self.path.split('/')))
d = os.path.dirname(path)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment