def upload(self, request): form = self.upload_form(request) if form.get_submit() != 'upload': r = TemplateIO(html=True) r += page.pre(request, 'Upload pictures', 'upload') r += page.menupane(request) r += form.render() #r += H(request.dump_html()) r += page.post() return r.getvalue() else: user = request.session.getuser() start = calendar.int_day.rounddown(gmt()) end = calendar.int_day.roundup(gmt()) upload = db.Upload.select(AND(db.Upload.q.import_time >= start, db.Upload.q.import_time < end, db.Upload.q.userID == user.id, db.Upload.q.collectionID == self.collection.db.id)) assert upload.count() == 0 or upload.count() == 1, \ 'Should be only one Upload per day per user' if upload.count() == 1: u = upload[0] else: u = db.Upload(user=user, collection=self.collection.db) c = int(form['camera']) if c == -2: camera = None # new camera elif c == -1: camera = None # guess else: camera = db.Camera.get(c) numfiles = int(form['numfiles']) keywords = form['keywords'] if keywords is not None: keywords = splitKeywords(keywords) print 'self.collection.db=%s' % self.collection.db request.response.buffered=False upload = self.do_upload(request, [ (f.fp, f.base_filename) for f in [ form['file.%d' % n] for n in range(numfiles) ] if f is not None], user, camera, keywords, form['visibility'], u) return quixote.http_response.Stream(upload)
def respond(self, trans=None): ## CHEETAH: main method generated for this template if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)): trans = self.transaction # is None unless self.awake() was called if not trans: trans = DummyTransaction() _dummyTrans = True else: _dummyTrans = False write = trans.response().write SL = self._CHEETAH__searchList _filter = self._CHEETAH__currentFilter ######################################## ## START - generated method body write(u''' <!DOCTYPE html> <html> <!-- # EVE-Central.com Codebase # Copyright (C) 2006-2017 StackFoundry LLC and Yann Ramin ''') write( u'''# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ''') write( u'''# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. ''') write( u'''# You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. --> <head> <link href="/css/normalize.css" rel="stylesheet" type="text/css" /> <link href="/css/style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> (function() { var config = { kitId: \'yvc6jcj\', scriptTimeout: 3000 }; var h=document.getElementsByTagName("html")[0];h.className+=" wf-loading";var t=setTimeout(function(){h.className=h.className.replace(/(\\s|^)wf-loading(\\s|$)/g," ");h.className+=" wf-inactive"},config.scriptTimeout);var tk=document.createElement("script"),d=false;tk.src=\'//use.typekit.net/\'+config.kitId+\'.js\';tk.type="text/javascript";tk.async="true";tk.onload=tk.onreadystatechange=function(){var a=this.readyState;if(d||a&&a!="complete"&&a!="loaded")return;d=true;clearTimeout(t);try{Typekit.load(config)}catch(b){}};var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(tk,s) })(); </script> <script src="//www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-84549-2"; urchinTracker(); </script> <script type="text/javascript" src="/js/jquery.min.js"></script> <script type="text/javascript" src="/js/typeahead.min.js"></script> <script type="text/javascript" src="/js/json2.js"></script> <script type="text/javascript" src="/js/underscore-min.js"></script> <script type="text/javascript" src="/js/backbone-min.js"></script> <script type="text/javascript" src="/js/backbone.queryparams.js"></script> <script type="text/javascript" src="/js/handlebars-1.0.0.beta.6.js"></script> <script type="text/javascript" src="/js/evec.js"></script> <title> ''') self._title(trans=trans) write(u'''</title> </head> <body> ''') timehead = gmt() write(u''' <div class="topbar"> <ul> <li><a href="/"><img src="/images/evec_logo.png" height="40" width="80"></a></li> <li><a href="/">Market</a></li> <li><a href="/tradetool/">Trade Tools</a></li> <li><a href="/home/develop.html">API</a></li> <li class="right"> ''') _v = VFN(VFFSL(SL, "timehead", True), "Format", False)( "%b %e %H:%M" ) # u'$timehead.Format("%b %e %H:%M")' on line 93, col 1 if _v is not None: write(_filter(_v, rawExpr=u'$timehead.Format("%b %e %H:%M")') ) # from line 93, col 1. write(u''' GMT </li> <li class="right"><form method="get" action="/home/typesearch.html"> <input type="text" name="search" placeholder="Item name"> <button type="submit" value="Search">Search</button> </form> </li> </ul> </div> ''') self._banner(trans=trans) write(u''' <div id="bodyText"> ''') _v = VFFSL(SL, "body", True) # u'$body' on line 109, col 1 if _v is not None: write(_filter(_v, rawExpr=u'$body')) # from line 109, col 1. write(u''' </div> <div id="footer"> <table border=0> <tr> <td> <script type="text/javascript"><!-- google_ad_client = "ca-pub-8691225504311148"; /* Big Banner */ google_ad_slot = "8769907779"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="//pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </td> <td> </td></tr></table> <br /> © 2005-2017 <a href="http://www.stackworks.net/">StackFoundry LLC</a> Feedback? Bug reports? Send them to Yann at <a href="mailto:[email protected]">[email protected]</a>. EVE-Central.com uses advertising and affiliate links to help offset the cost of co-location, servers and bandwidth. The EVE-Central.com code base is <a href="http://dev.eve-central.com/eve-central/">made available</a> under the <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">Affero GPL (AGPL) version 3.0 or later. </a> Material related to EVE-Online is used with limited permission of CCP Games hf. No official affiliation or endorsement by CCP Games hf is stated or implied. </div> </body> </html> ''') ######################################## ## END - generated method body return _dummyTrans and trans.response().getvalue() or ""
def respond(self, trans=None): ## CHEETAH: main method generated for this template if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)): trans = self.transaction # is None unless self.awake() was called if not trans: trans = DummyTransaction() _dummyTrans = True else: _dummyTrans = False write = trans.response().write SL = self._CHEETAH__searchList _filter = self._CHEETAH__currentFilter ######################################## ## START - generated method body write(u''' <!DOCTYPE html> <html> <!-- # EVE-Central.com Codebase # Copyright (C) 2006-2012 StackFoundry LLC and Yann Ramin ''') write(u'''# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ''') write(u'''# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. ''') write(u'''# You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. --> <head> <link href="/css/normalize.css" rel="stylesheet" type="text/css" /> <link href="/css/style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> (function() { var config = { kitId: \'yvc6jcj\', scriptTimeout: 3000 }; var h=document.getElementsByTagName("html")[0];h.className+=" wf-loading";var t=setTimeout(function(){h.className=h.className.replace(/(\\s|^)wf-loading(\\s|$)/g," ");h.className+=" wf-inactive"},config.scriptTimeout);var tk=document.createElement("script"),d=false;tk.src=\'//use.typekit.net/\'+config.kitId+\'.js\';tk.type="text/javascript";tk.async="true";tk.onload=tk.onreadystatechange=function(){var a=this.readyState;if(d||a&&a!="complete"&&a!="loaded")return;d=true;clearTimeout(t);try{Typekit.load(config)}catch(b){}};var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(tk,s) })(); </script> <script src="//www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-84549-2"; urchinTracker(); </script> <script type="text/javascript" src="/js/jquery.min.js"></script> <script type="text/javascript" src="/js/typeahead.min.js"></script> <script type="text/javascript" src="/js/json2.js"></script> <script type="text/javascript" src="/js/underscore-min.js"></script> <script type="text/javascript" src="/js/backbone-min.js"></script> <script type="text/javascript" src="/js/backbone.queryparams.js"></script> <script type="text/javascript" src="/js/handlebars-1.0.0.beta.6.js"></script> <script type="text/javascript" src="/js/evec.js"></script> <title> ''') self._title(trans=trans) write(u'''</title> </head> <body> ''') timehead = gmt() write(u''' <div class="topbar"> <ul> <li><a href="/"><img src="/images/evec_logo.png" height="40" width="80"></a></li> <li><a href="/">Market</a></li> <li><a href="/tradetool/">Trade Tools</a></li> <li><a href="/home/develop.html">API</a></li> <li><a href="/home/software.html">Contribute</a></li> <li class="right"> ''') _v = VFN(VFFSL(SL,"timehead",True),"Format",False)("%b %e %H:%M") # u'$timehead.Format("%b %e %H:%M")' on line 99, col 1 if _v is not None: write(_filter(_v, rawExpr=u'$timehead.Format("%b %e %H:%M")')) # from line 99, col 1. write(u''' GMT </li> <li class="right"><form method="get" action="/home/typesearch.html"> <input type="text" name="search" placeholder="Item name"> <button type="submit" value="Search">Search</button> </form> </li> </ul> </div> ''') self._banner(trans=trans) write(u''' <div id="bodyText"> ''') _v = VFFSL(SL,"body",True) # u'$body' on line 116, col 1 if _v is not None: write(_filter(_v, rawExpr=u'$body')) # from line 116, col 1. write(u''' </div> <div id="footer"> <table border=0> <tr> <td> <script type="text/javascript"><!-- google_ad_client = "ca-pub-8691225504311148"; /* Big Banner */ google_ad_slot = "8769907779"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="//pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </td> <td> <!-- Project Wonderful Ad Box Loader --> <!-- Put this after the <body> tag at the top of your page --> <script type="text/javascript"> (function(){function pw_load(){ if(arguments.callee.z)return;else arguments.callee.z=true; var d=document;var s=d.createElement(\'script\'); var x=d.getElementsByTagName(\'script\')[0]; s.type=\'text/javascript\';s.async=true; s.src=\'//www.projectwonderful.com/pwa.js\'; x.parentNode.insertBefore(s,x);} if (window.attachEvent){ window.attachEvent(\'DOMContentLoaded\',pw_load); window.attachEvent(\'onload\',pw_load);} else{ window.addEventListener(\'DOMContentLoaded\',pw_load,false); window.addEventListener(\'load\',pw_load,false);}})(); </script> <!-- End Project Wonderful Ad Box Loader --> <!-- Project Wonderful Ad Box Code --> <div id="pw_adbox_61086_2_0"></div> <!-- End Project Wonderful Ad Box Code --> </td></tr></table> <br /> © 2005-2012 <a href="http://www.stackworks.net/">StackFoundry LLC</a> Feedback? Bug reports? Send them to Yann at <a href="mailto:[email protected]">[email protected]</a>. EVE-Central.com uses advertising and affiliate links to help offset the cost of co-location, servers and bandwidth. The EVE-Central.com code base is <a href="http://dev.eve-central.com/eve-central/">made available</a> under the <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">Affero GPL (AGPL) version 3.0 or later. </a> Material related to EVE-Online is used with limited permission of CCP Games hf. No official affiliation or endorsement by CCP Games hf is stated or implied. </div> </body> </html> ''') ######################################## ## END - generated method body return _dummyTrans and trans.response().getvalue() or ""
def respond(self, trans=None): ## CHEETAH: main method generated for this template if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)): trans = self.transaction # is None unless self.awake() was called if not trans: trans = DummyTransaction() _dummyTrans = True else: _dummyTrans = False write = trans.response().write SL = self._CHEETAH__searchList _filter = self._CHEETAH__currentFilter ######################################## ## START - generated method body write(''' ''') if VFFSL(SL,"isigb",True): # generated from line 22, col 1 write('''<html> ''') else: # generated from line 24, col 1 write('''<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> ''') write(''' <head> ''') if VFFSL(SL,"isigb",True): # generated from line 33, col 1 write(''' ''') else: # generated from line 35, col 1 write(''' <link href="/style.css" rel="stylesheet" type="text/css" /> ''') write(''' <title> ''') self._title(trans=trans) write('''</title> </head> <body> ''') if VFFSL(SL,"isigb",True): # generated from line 50, col 1 write('''<a href="/">EVE-Central.com Home</a> <br /> ''') else: # generated from line 54, col 1 write('''<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-84549-2"; urchinTracker(); </script> ''') write(''' ''') self._banner(trans=trans) write(''' ''') if VFFSL(SL,"isigb",True): # generated from line 69, col 1 write(''' ''') else: # generated from line 71, col 1 write(''' ''') _v = VFFSL(SL,"body",True) # '$body' on line 74, col 1 if _v is not None: write(_filter(_v, rawExpr='$body')) # from line 74, col 1. write(''' <hr noshade="1"/> <p> ''') n = gmt() write(''' <br /> </p> </body> </html> ''') ######################################## ## END - generated method body return _dummyTrans and trans.response().getvalue() or ""
def respond(self, trans=None): ## CHEETAH: main method generated for this template if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)): trans = self.transaction # is None unless self.awake() was called if not trans: trans = DummyTransaction() _dummyTrans = True else: _dummyTrans = False write = trans.response().write SL = self._CHEETAH__searchList _filter = self._CHEETAH__currentFilter ######################################## ## START - generated method body write(u''' <!DOCTYPE html> <html> <!-- # EVE-Central.com Codebase # Copyright (C) 2006-2012 StackFoundry LLC and Yann Ramin ''') write(u'''# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ''') write(u'''# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. ''') write(u'''# You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. --> <head> <link href="/style.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" type="text/css" href="/js/yui/autocomplete/assets/skins/sam/autocomplete.css" /> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-84549-2"; urchinTracker(); </script> <script type="text/javascript" src="/js/jquery.min.js"></script> <script type="text/javascript" src="/js/evec.js"></script> <title> ''') self._title(trans=trans) write(u'''</title> </head> <body> <div id="header"> <a href="/"> <img src="http://cdn.eve-central.com/logo.png" alt="Go Home" /></a> <a href="/home/market.html"><img src="http://cdn.eve-central.com/market.png" alt="View" /></a> <img src="http://cdn.eve-central.com/tenspacer.png" alt="" /> <a href="/tradetool/"><img src="http://cdn.eve-central.com/trade.png" alt="Trade" /></a> <img src="http://cdn.eve-central.com/tenspacer.png" alt="" /> <a href="/home/software.html"><img src="http://cdn.eve-central.com/contr.png" alt="Contribute" /></a> <img src="http://cdn.eve-central.com/tenspacer.png" alt="" /> <a href="/home/develop.html"><img src="http://cdn.eve-central.com/develop.png" alt="Develop" /></a> </div> <div id="linkBar"> <table border="0" width="98%" cellpadding="0" cellspacing="0"> <tr> <td class="alignRight"> <!-- <div class="standout">Crucible updates pending release of database information. Don\'t be alarmed.</div> --> ''') timehead = gmt() write(u''' ''') _v = VFN(VFFSL(SL,"timehead",True),"Format",False)("%b %e %H:%M") # u'$timehead.Format("%b %e %H:%M")' on line 95, col 1 if _v is not None: write(_filter(_v, rawExpr=u'$timehead.Format("%b %e %H:%M")')) # from line 95, col 1. write(u''' GMT </td> </tr> </table> </div> ''') self._banner(trans=trans) write(u''' ''') if VFFSL(SL,"isigb",True): # generated from line 109, col 1 write(u''' ''') else: # generated from line 111, col 1 write(u''' <div id="bodyText"> ''') _v = VFFSL(SL,"body",True) # u'$body' on line 114, col 1 if _v is not None: write(_filter(_v, rawExpr=u'$body')) # from line 114, col 1. write(u''' </div> <div id="footer"> <p class="adLink"> <b><a href="http://www.shatteredcrystal.com/code.php/eve_online/~325">EVE Online Game Time Codes</a></b> - Support EVE-Central by purchasing them at ShatteredCrystal.com through this affiliate link.</p> <p> <table border=0> <tr> <td> <script type="text/javascript"><!-- google_ad_client = "ca-pub-8691225504311148"; /* Big Banner */ google_ad_slot = "8769907779"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </td> <td> <!-- Project Wonderful Ad Box Loader --> <!-- Put this after the <body> tag at the top of your page --> <script type="text/javascript"> (function(){function pw_load(){ if(arguments.callee.z)return;else arguments.callee.z=true; var d=document;var s=d.createElement(\'script\'); var x=d.getElementsByTagName(\'script\')[0]; s.type=\'text/javascript\';s.async=true; s.src=\'//www.projectwonderful.com/pwa.js\'; x.parentNode.insertBefore(s,x);} if (window.attachEvent){ window.attachEvent(\'DOMContentLoaded\',pw_load); window.attachEvent(\'onload\',pw_load);} else{ window.addEventListener(\'DOMContentLoaded\',pw_load,false); window.addEventListener(\'load\',pw_load,false);}})(); </script> <!-- End Project Wonderful Ad Box Loader --> <!-- Project Wonderful Ad Box Code --> <div id="pw_adbox_61086_2_0"></div> <!-- End Project Wonderful Ad Box Code --> </div> </td></tr></table> <br /> EVE-Central.com does not select nor endorse any advertisers which make use of Google AdSense keyword based advertising. <i>Don\'t buy ISK for real cash!</i> It is against the EVE-Online Terms of Service. For more details, please consult the <a href="http://eve-online.com">EVE-Online</a> website. Material related to EVE-Online is used with limited permission of CCP Games hf. No official affiliation or endorsement by CCP Games hf is stated or implied. <br /> <br /> © 2005-2012 <a href="http://www.stackworks.net/">StackFoundry LLC</a> Feedback? Bug reports? Send them to Yann at <a href="mailto:yann [at] stackfoundry.com">yann [at] stackfoundry.com</a>. EVE-Central.com uses advertising and affiliate links to help offset the cost of co-location, servers and bandwidth. The EVE-Central.com code base is <a href="http://dev.eve-central.com/eve-central/">made available</a> under the <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">Affero GPL (AGPL) version 3.0 or later. </a> </p> <p> </body> </html> ''') ######################################## ## END - generated method body return _dummyTrans and trans.response().getvalue() or ""