Delete unneeded code.

This commit is contained in:
Neil Fraser
2020-02-03 16:00:49 -08:00
parent 85641fd1fb
commit 7dad4c48f6
2 changed files with 8 additions and 11 deletions

View File

@@ -14,14 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
"""
import cgi
import storage
from google.cloud import ndb
# Datastore model.
class Grid(ndb.Model):
data = ndb.StringProperty(required=True)
# Route to requested handler.

View File

@@ -26,6 +26,12 @@ from random import randint
from google.cloud import ndb
class Xml(ndb.Model):
# A row in the database.
xml_hash = ndb.IntegerProperty()
xml_content = ndb.TextProperty()
def keyGen():
# Generate a random string of length KEY_LEN.
KEY_LEN = 6
@@ -33,10 +39,6 @@ def keyGen():
max_index = len(CHARS) - 1
return "".join([CHARS[randint(0, max_index)] for x in range(KEY_LEN)])
class Xml(ndb.Model):
# A row in the database.
xml_hash = ndb.IntegerProperty()
xml_content = ndb.TextProperty()
def xmlToKey(xml_content):
# Store XML and return a generated key.
@@ -61,6 +63,7 @@ def xmlToKey(xml_content):
row.put()
return xml_key
def keyToXml(key_provided):
# Retrieve stored XML based on the provided key.
# Normalize the string.
@@ -75,6 +78,7 @@ def keyToXml(key_provided):
xml = result.xml_content
return xml
def app(environ, start_response):
forms = cgi.FieldStorage(fp=environ['wsgi.input'], environ=environ)
if "xml" in forms: