[Pypi-checkins] r815 - in trunk/appengine: . templates
martin.von.loewis
python-checkins at python.org
Sun Jul 25 07:57:03 CEST 2010
Author: martin.von.loewis
Date: Sun Jul 25 07:57:02 2010
New Revision: 815
Added:
trunk/appengine/
trunk/appengine/app.yaml
trunk/appengine/mirror.py
trunk/appengine/model.py
trunk/appengine/templates/
trunk/appengine/templates/index.html
Log:
Beginnings of an Appengine mirror. Nothing working yet.
Added: trunk/appengine/app.yaml
==============================================================================
--- (empty file)
+++ trunk/appengine/app.yaml Sun Jul 25 07:57:02 2010
@@ -0,0 +1,8 @@
+application: pypi
+version: 3
+runtime: python
+api_version: 1
+
+handlers:
+- url: .*
+ script: mirror.py
\ No newline at end of file
Added: trunk/appengine/mirror.py
==============================================================================
--- (empty file)
+++ trunk/appengine/mirror.py Sun Jul 25 07:57:02 2010
@@ -0,0 +1,17 @@
+import wsgiref.handlers
+from google.appengine.ext import webapp
+from handlers import *
+
+application = webapp.WSGIApplication(
+ [('/', Index),
+ ('/simple/(.*)', Simple),
+ ('/package/(.*)', File),
+ ('/serversig/(.*)', Serversig),
+ ('/local-stats/days/(.*)', Stats),
+ debug=True)
+
+def main():
+ wsgiref.handlers.CGIHandler().run(application)
+
+if __name__ == "__main__":
+ main()
Added: trunk/appengine/model.py
==============================================================================
--- (empty file)
+++ trunk/appengine/model.py Sun Jul 25 07:57:02 2010
@@ -0,0 +1,16 @@
+from google.appengine.ext import db
+
+class MirrorState(db.Model):
+ # singleton object
+ todo = db.BlobProperty()
+ last_modified = db.StringProperty()
+
+class Project(db.Model):
+ name = db.StringProperty()
+ simple = db.BlobProperty()
+
+class File(db.Model):
+ contents = db.BlobProperty()
+ etag = db.StringProperty()
+ project = db.ReferenceProperty(Project)
+ path = db.StringProperty()
Added: trunk/appengine/templates/index.html
==============================================================================
--- (empty file)
+++ trunk/appengine/templates/index.html Sun Jul 25 07:57:02 2010
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html> <head>
+<title>PyPI mirror</title>
+</head>
+<body>
+<a href="simple/">simple<a><br>
+<a href="serversig/">serversig<a><br>
+<a href="local-stats/days/">stats<a><br>
+</body> </html>
More information about the Pypi-checkins
mailing list