mirror of
https://github.com/google/blockly.git
synced 2026-01-06 16:40:07 +01:00
Delete unneeded code.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user