Created pydev project, further cleanup, gitignored db.

This commit is contained in:
ultra
2012-03-01 19:37:30 -05:00
parent cd23844bec
commit 7432d55ce0
4 changed files with 33 additions and 6 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
cryptopad.db

17
.project Normal file
View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>cryptopad</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>

10
.pydevproject Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?>
<pydev_project>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/cryptopad</path>
</pydev_pathproperty>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">python2</pydev_property>
</pydev_project>

View File

@@ -1,10 +1,9 @@
#!/usr/bin/python2
from bottle import get, post, request, run, route, static_file, default_app
import json
import anydbm as dbm
import os
import anydbm
data = dbm.open("cryptopad.db", 'c');
data = anydbm.open("cryptopad.db", 'c');
@get("/storage/<key>")
def getItem(key):
@@ -19,7 +18,7 @@ def delete(key):
del data[key]
@post("/storage/<key>")
def set(key):
def setItem(key):
data[key] = request.forms.get("value")
@get("/<filepath:path>")
@@ -33,4 +32,4 @@ def index():
application=default_app()
if __name__ == "__main__":
run(application, host='localhost', port=55580)
run(application, host='localhost', port=55580)