To do one better, here is the entirety of the Python code:
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import wsgiref.handlers
import datetime, time
from google.appengine.ext import webapp, db
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.api import taskqueue
class AdhocHandler2(webapp.RequestHandler):
def get(self):
task_create_time = datetime.datetime.now()
import string
task_create_time_s = task_create_time.strftime("%Y-%m-%d %H:%M:%S") + "." +
string.zfill(task_create_time.microsecond, 6)
t = taskqueue.Task(url='/batch/adhoc', params={'task_create_time':
task_create_time_s}, target='overnight-external-data',
method='GET')
t.add(queue_name = 'overnight-tasks')
def main():
application = webapp.WSGIApplication([ \
('/batch/adhoc2', AdhocHandler2), \
],
debug=True)
run_wsgi_app(application)
if __name__ == '__main__':
main()
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine/-/ELiNYLg4B9cJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.