From 1711747333c7666b644f6124de39c49cd0b26526 Mon Sep 17 00:00:00 2001 From: Date: Fri, 14 Sep 2007 15:22:57 -0400 Subject: [PATCH 1/1] first working version --- ruler_web.py | 163 --------- static/images/bl.png | Bin 0 -> 399 bytes static/images/br.png | Bin 0 -> 240 bytes static/images/r.png | Bin 0 -> 72 bytes static/images/tl.png | Bin 0 -> 3345 bytes static/images/tr.png | Bin 0 -> 247 bytes static/images/trash.png | Bin 655 -> 0 bytes static/images/yourule_banner.png | Bin 0 -> 21875 bytes static/images/yourule_banner.svg | 556 +++++++++++++++++++++++++++++++ static/style.css | 137 ++++++++ ruler.py => svgruler.py | 6 +- templates/_form_elements.tmpl | 6 +- templates/gallery.tmpl | 12 +- templates/index.tmpl | 18 +- templates/show_ruler.tmpl | 26 +- templates/site.tmpl | 24 ++ yourule.py | 220 ++++++++++++ 17 files changed, 978 insertions(+), 190 deletions(-) delete mode 100755 ruler_web.py create mode 100644 static/images/bl.png create mode 100644 static/images/br.png create mode 100644 static/images/r.png create mode 100644 static/images/tl.png create mode 100644 static/images/tr.png delete mode 100644 static/images/trash.png create mode 100644 static/images/yourule_banner.png create mode 100644 static/images/yourule_banner.svg create mode 100644 static/style.css rename ruler.py => svgruler.py (97%) create mode 100755 yourule.py diff --git a/ruler_web.py b/ruler_web.py deleted file mode 100755 index 2738f8f..0000000 --- a/ruler_web.py +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/env python - -from __future__ import division -import web -import sys, os, re -from storm.locals import * -from ruler import RulerImage - -# the url map for the application -urls = ( '/', 'index', - '/ruler_([0-9\.]+)px_([0-9\.]+)([A-Za-z]+).(svg|png|jpg)', 'ruler_img', - '/show/(.*(svg|png|jpg))', 'ruler', - '/gallery(.*)', 'gallery', - '/delete/(\d+)', 'delete', - '/undelete/(\d+)', 'undelete') - -database = create_database("sqlite:ruler_web.db") -store = Store(database) - -class SavedRuler(object): - __storm_table__ = "gallery" - id = Int(primary=True) - pixel_width = Float() - unit_width = Float() - model = Unicode() - units = Unicode() - show = Int() - - def __init__(self, **kw): - self.pixel_width = kw['pixel_width'] - self.unit_width = kw['unit_width'] - self.units = kw['units'] - self.model = kw['model'] - - def cm_width(self): - if self.units == 'centimeters': - return self.unit_width - elif self.units == 'inches': - return(self.unit_width * 2.54) - - def in_width(self): - if self.units == 'inches': - return self.unit_width - elif self.units == 'centimeters': - return(self.unit_width * 0.3937) - - -class index: - def GET(self): - web.header("Content-Type","text/html; charset=utf-8") - web.render('index.tmpl') - - def POST(self): - input = web.input() - - pixel_width = input['pixel_width'] - unit_width = input['unit_width'] - units = input['units'] - ruler_url = 'ruler_%spx_%s%s.png' % (pixel_width, unit_width, units) - web.redirect('/show/%s' % ruler_url) - -class ruler: - def GET(self, ruler_url, ext): - web.debug('test test') - if web.input().has_key('fromgallery'): - fromgallery = True - else: - fromgallery = False - - other_unit, other_unit_url = get_other_units(ruler_url) - - web.header("Content-Type","text/html; charset=utf-8") - web.render('show_ruler.tmpl') - - -class ruler_img: - def GET(self, pixel_width=None, unit_width=None, units=None, ext=None): - - # TODO check to see if it's a format that we support - - # set ruler height to be 200 px always - pixel_width = float(pixel_width) - unit_width = float(unit_width) - - ruler_height = 200 - - scale = pixel_width / unit_width - ruler_length = int(unit_width) - - ruler = Ruler(scale, units, ruler_height, ruler_length) - - # print the header - if ext == 'svg': ext = 'svg+xml' - web.header("Content-Type", "image/%s" % ext) - - if ext == 'svg+xml': - sys.stdout.write(ruler.output()) - else: - pin, pout = os.popen2('convert -size %sx%s - %s:-' % \ - (pixel_width, ruler_height, ext)) - - pin.write(ruler.output()) - pin.close() - sys.stdout.write(pout.read()) - -class gallery: - def GET(self, ruler_url): - - if ruler_url: - pixel_width, unit_width, units = process_ruler_url(ruler_url)[0:3] - - rulers = store.find(SavedRuler, SavedRuler.show == 1) - rulers.order_by(SavedRuler.model) - - web.render('gallery.tmpl') - - def POST(self): - input = web.input() - - new_ruler = SavedRuler(pixel_width=float(input['pixel_width']), - unit_width=float(input['unit_width']), - units=unicode(input['units']), - model=unicode(input['model'])) - - store.add(new_ruler) - store.commit() - - web.redirect('gallery') - -class delete: - def GET(self, id): - ruler = store.get(SavedRuler, int(id)) - ruler.show = 0 - store.commit() - web.redirect('/gallery') - - -class undelete: - def GET(self, id): - ruler = store.get(SavedRuler, int(id)) - ruler.show = 1 - store.commit() - web.redirect('/gallery') - -def get_other_units(url): - pixel_width, unit_width, units = process_ruler_url(url)[0:3] - ruler = SavedRuler(pixel_width=float(pixel_width), - unit_width=float(unit_width), - units=unicode(units), - model=unicode(model)) - -def process_ruler_url(url): - url = re.sub(r'^/?(ruler.*)$', r'\1', url) - return(re.match( r'ruler_([\d\.]+)px_([\d\.]+)(\w+).(png|svg|jpg)', - url).groups()) - -# render the site template here so that i can use it later -web.render('site.tmpl', None, True, 'site') - -web.webapi.internalerror = web.debugerror -if __name__ == "__main__": - web.run(urls, globals(), web.reloader) - diff --git a/static/images/bl.png b/static/images/bl.png new file mode 100644 index 0000000000000000000000000000000000000000..f0970aea5e95cad7406b7e061aeb7494d133b9ea GIT binary patch literal 399 zcmeAS@N?(olHy`uVBq!ia0y~yU;#223 z;_m47i5sPEwaip#V%0TE)Z=IiOGwZ;<`#8)k3(ewYPf2Of6d?wN z1M6Q$^8?M>=ME$slt4xc2?B`;9YCVN1!SX&5|B_3WCW6(96-Xu1xS#t^yT!^sV*{n z?bp142EY1sF+)V~`|rJ9fo@o^tIlk;>ye)|d3%BOtyrhM)MxqS+i$nse}DaT>1$h{ zWv;a@IcBpvB-$2!l>n+=w{D7%VE55SC01vje?I;6Qfch#P@pQ&_Y4(w^Vi=$Aox&M zfPvx9s&a-sd)_g|J%3wfE!Q8uI&^U&P!;Rb%LY7?PcHeY0W_(rU%H`w_uY3@d+p@< iAAkJu*B7Wlwf@El|BjjFQo%rvGI+ZBxvX&2huAvyMk)W;{|7(M(+v@_y>JFDHwN%3Y@iP5Q!BK7YYNV!(g* z_rLX4UX${dKdz|xT*iO`pl*z>cE`=#rpyoVJsWsci*F8nQD z^}Lep!tHIkr#~$?zc=4%Ns!n7_vtUiH(r}nY_>Ub*1qlL8|G|@kTYD)0rUccr>mdK II;Vst0AvMjpa1{> literal 0 HcmV?d00001 diff --git a/static/images/r.png b/static/images/r.png new file mode 100644 index 0000000000000000000000000000000000000000..fab4ac01a9c370b04ed1eec072ac60cc311f8603 GIT binary patch literal 72 zcmeAS@N?(olHy`uVBq!ia0vp^OhC-Y0V1m%Ufcyz{GKk3Ar*6y6Tko{z|O!Ju9zeV PWHETU`njxgN@xNA%&!hW literal 0 HcmV?d00001 diff --git a/static/images/tl.png b/static/images/tl.png new file mode 100644 index 0000000000000000000000000000000000000000..04576f8f1e1065410f66a25c1f4a38e8fe2fee3c GIT binary patch literal 3345 zcmeAS@N?(olHy`uVBq!ia0y~yU;#3jA~=|URB;h=2?GPq4Nn)xkcv5P?{4%}4rFk> znBQ&GA*1Z1WYr*Yv9Y^=(LvZxP;g;(!<9uWyZQ1N4z9aVQnuwz@gnICWFv@yCya+i%Cl#qHa_|NLHdpx}j~o{xY2*c`i&V^-YH$iT2{>z%yq z^78WAw{PF~o1LLSK7Z%^_s1o!U%y_g50qBhZX?5&+;cU{^t%uPLqbu!_`g42>kj~( z!oPV=H85B{yypOt9D+bXKnX}FxBv-<4j|DW0MyT*2nstVP&l@XDjW@-(L^zt6-G;n v(eiP$Rv4``N1FmB3tM}H=;rOx2#>gTe~DWM4fr?GR0 literal 0 HcmV?d00001 diff --git a/static/images/tr.png b/static/images/tr.png new file mode 100644 index 0000000000000000000000000000000000000000..e4ac949ba7e4c2fd6cc45614a97ce1950d7e6d56 GIT binary patch literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^azI?c!2~3;{$Je$r1p8bIEGZrd3$LiZ?l1b+r#@a zo4almc|PS75Y^tmoy5WB(DPW*hJ8BINw2OY4^Mq(`|+-1*8=vlpYN2$dSymVQ$M#q zsps{sTjiVB=RV(=8!c_nw^;hFRo`OX63`|33X!u=w00FU@}?_rFidT6^%!ov#8-D*x9;UmyzXuVS7M!RpKL;rKS7 PPZ&I1{an^LB{Ts5+lzb| literal 0 HcmV?d00001 diff --git a/static/images/trash.png b/static/images/trash.png deleted file mode 100644 index 0e0953c73c60adbbc762d0553f95a586f3054aa6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 655 zcmV;A0&x9_P)Cml&2>S!-Vj|(%DY|xv2rmiUs+--iLl+4{ z?G|A~=Ohg>vv9>N%M}DMW!>HPeV%zbm|I~4O9R8eF!SL%Uk3g&6hQCgwr&w;ys}lf zIX1F%*Xv2Q_jYug8SU>IsAzqBV(1P`&UnCRf8PMZ!;e^5{(|GUxUTch+I8+M7rU?V zW_t34vrC+PH%AZz1VKm`?q)<3MMP26&l(YiA-R=YS&0X*u<(|l`}Zn3VP^W}j)^_# z_6NY#uC7z$Rx^mTh**raXl*fCh+`p13_7uhfHnqW4A$CV1<;djx7Tl^S>Kr5@mDOH z8zq#g#&c^~-&kgAv%q#=W$W-maC!CHfe5XaxietSj|8I1&`<#3&|j$e*lNa`-i+0@!$Xe002ovPDHLkV1g_FA-@0s diff --git a/static/images/yourule_banner.png b/static/images/yourule_banner.png new file mode 100644 index 0000000000000000000000000000000000000000..877889cf5218f32d40f2ba0eef49654dc0b67eeb GIT binary patch literal 21875 zcmeEuRa9JCux;b63GNagxVwg+fdmWg1lLA_yE_DTx8NkWyIXK+tRc92u)9yrxu5Uj z{y)Y5n$=s@u2rjQ)|}OZD}9u~KqW>6fj}5?vhP(uAUGG`bp$fvKO@v8VBipme zWZ=sS`AZn^H;RL-mJ{&q!av_I?-(-NfI%W>DNScpdoyQOBS%w^tE(%krJc2tiIIaT ztG%On#)&X72t)~zdoQ8pmU#qm)g_TxMmk%sqKyl}Zof5yL)7is2=P3vC8Gy>7#nz; z{5o-Tcamd0c660Haoleg`1nKhsA;ghzkS7zgOI)5m6rDS0jZyn=~&(m`R4M;%h9~j z%-oFW!NSa(Fb3KcYDDM@N&~3~y?lV%u)PvVlz+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88uJkwMC`UetMq_uJF`ogSk@ZwD zf6)YWs`jGCXSmxkO}X=@$7k62Qn5RkDv{Tz5p>rabIltfPTP!p zj!ao$-rR(X<=ME(m?_)l`kx#T)Tzl3LEWs_i_-U0^-}L!NDkY#(6+))cx^}FqpS_{ z>&s<`ppGwtV=sy^Rk!0X?dQT?=2=kp@=Gsa*REXv@VErP48TJj7b(Wv5C{YUfj}S- z2m}Jb{KaCiVE69bln~+pV3sJQHUK+7$4St30^qFuBM=A#0)apv5C{ZkpB2)QO(3SUxzJT05C{YUfj}S-2n1nREEa6rwiRZx8H5lQrF8q$ zvFV_WQhJpTax;K^)YrQ?(D^=*_UzeBhlhs=CZ5o3r<6`Fs7iQiW)VWR1K0x~b$XvEjS1|OS(su)nSm!}Io$e@ zg~nKoDX7dyqaQZoj$T>nMWY{M%_2GmD`Ha`9o0R2Dit_+pQ5U-fBKYZiei<+7Z9s! zus#uoM)Athb-G|n#_wOM9u`Yi5bNYb?_b)2qiR;QtMQ%)V(`|ed^Gw>F<<8Pwt- zq8UWd!+5WK`kQ46#c;{fSC6R_wIxQQMofZc;(8geSoD{jD3Kd~y!NZi&KG6rIPaTc zYBE9*eFHrcejlBT2-h-Q2csya!!dM?!3^5mgpBy(hgi>@k?&1oj2m=Ti1yCeZtq81 zTU)3EA)d)^==L$S)fTxXgyaCY7r^b4|H=SlMWMPtAP@)y0)apv5D4Oc5Hd(9JrAIE g@}GG!$tA=80b@WJ&zfNMM*si-07*qoM6N<$f`VIUYybcN literal 0 HcmV?d00001 diff --git a/static/images/yourule_banner.svg b/static/images/yourule_banner.svg new file mode 100644 index 0000000..3b46682 --- /dev/null +++ b/static/images/yourule_banner.svg @@ -0,0 +1,556 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + YouRule + Onscreen Ruler Generator + diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..b589157 --- /dev/null +++ b/static/style.css @@ -0,0 +1,137 @@ +@charset "UTF-8"; + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +dl, dt, dd, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-family: inherit; + vertical-align: baseline; +} + +body { + font: Arial, Helvetica, sans-serif; +} + +label { + font-weight: bold; +} + +em { + font-style: italic; +} + +#wrapper { + padding: 1em 0 0 0; + margin: 0 auto 0 auto; + width: 885px; +} + +#header { + width: 885px; + height: 138px; + background: url(/static/images/yourule_banner.png); +} + +#header h1, #header h2 { + display: none; +} + +.mainbox { + margin-top: 1em; + background: url(/static/images/tl.png) no-repeat top left; +} + +.mainbox_top { + background: url(/static/images/tr.png) no-repeat top right; +} + +.mainbox_bottom { + background: url(/static/images/bl.png) no-repeat bottom left; +} + +.mainbox_bottom div { + background: url(/static/images/br.png) no-repeat bottom right; +} + +.mainbox_content { + background: url(/static/images/r.png) top right repeat-y; +} + + +.mainbox_top div, .mainbox_top, .mainbox_bottom div, .mainbox_bottom { + width: 100%; + height: 30px; + font-size: 1px; +} + +.mainbox_content, .mainbox_bottom { + margin-top: -19px; +} + +.mainbox_content { + padding: 0em 3em 2em 3em; + line-height: 1.5em; +} + +.mainbox_content h2 { + border-bottom: 3px #1e3d7b solid; + margin: 19px 0 0.8em 0; + font-weight: bold; +} + +.mainbox_content p { + margin-bottom: 0.5em; +} + +#gallery { + border: 1px solid #1e3d7b; + width: 100%; + border-collapse: collapse; +} + +#gallery th { + background: #1e3d7b; + color: white; +} + +#gallery td { + text-align: center; +} + +#menu { + text-align: right; + margin: 0.5em; +} + +#rulerimg { + margin: 0.5em; +} + +.errormsg { + background-color: #f7fb70; + color: #4c4c4c; + text-align: center; + border: 1px #fdff00 solid; + width: 20em; + margin: 1em; +} + +strong { + font-weight: bold; +} + +#footer { + margin-top: 3em; + font-size: 0.8em; + text-align: center; +} diff --git a/ruler.py b/svgruler.py similarity index 97% rename from ruler.py rename to svgruler.py index 39bcd3d..7c66050 100644 --- a/ruler.py +++ b/svgruler.py @@ -2,7 +2,7 @@ from __future__ import division import SVGdraw -class Ruler: +class SVGRuler: def __init__(self, scale=None, units=None, ruler_height=None, ruler_length=None): @@ -49,14 +49,14 @@ class Ruler: self.__drawline(0.3) self.__drawline(0.6) - self.svg.addElement(SVGdraw.text((self.point - font_height * 1.4), + self.svg.addElement(SVGdraw.text((self.point - font_height * 1.15), (self.ruler_height * 0.6 - 5), str(i + 1), font_height)) self.drawing.setSVG(self.svg) - def output(self): + def getxml(self): import cStringIO xml = cStringIO.StringIO() xml.write("\n") diff --git a/templates/_form_elements.tmpl b/templates/_form_elements.tmpl index 18c57c8..b365ce0 100644 --- a/templates/_form_elements.tmpl +++ b/templates/_form_elements.tmpl @@ -1,14 +1,14 @@ -

Units: +

-

+

-

+

+
+ + +
+
+
+ #filter Filter $body #end filter +
+
+
+ + + +
+ diff --git a/yourule.py b/yourule.py new file mode 100755 index 0000000..9010217 --- /dev/null +++ b/yourule.py @@ -0,0 +1,220 @@ +#!/usr/bin/env python + +from __future__ import division +import web +import sys, os, re +from storm.locals import * +from svgruler import SVGRuler + +# the url map for the application +urls = ( '/', 'index', + '/ruler_([0-9\.]+)px_([0-9\.]+)([A-Za-z]+).(svg|png|jpg)', 'ruler_img', + '/show/(.*(svg|png|jpg))', 'show_ruler', + '/gallery(.*)', 'gallery', + '/delete/(\d+)', 'delete', + '/undelete/(\d+)', 'undelete') + +database = create_database("sqlite:yourule.db") +store = Store(database) + +class Ruler(object): + __storm_table__ = "gallery" + id = Int(primary=True) + pixel_width = Float() + unit_width = Float() + model = Unicode() + units = Unicode() + show = Int() + cm_in_ratio = 0.3937 + + def __init__(self, **kw): + self.pixel_width = float(kw['pixel_width']) + self.unit_width = float(kw['unit_width']) + self.units = unicode(kw['units']) + if kw.has_key('model'): + self.model = unicode(kw['model']) + else: + self.model = u'' + + def cm_width(self): + if self.units == 'centimeters': + return self.unit_width + elif self.units == 'inches': + return(round(self.unit_width / self.cm_in_ratio, 2)) + + def in_width(self): + if self.units == 'inches': + return self.unit_width + elif self.units == 'centimeters': + return(round(self.unit_width * self.cm_in_ratio, 2)) + + def url(self): + return('ruler_%spx_%s%s.png' % (self.pixel_width, + self.unit_width, self.units)) + + +class index: + def GET(self): + web.header("Content-Type","text/html; charset=utf-8") + web.render('index.tmpl') + + def POST(self): + input = web.input() + + errormsg = validate_input(input) + + if errormsg: + pixel_width = input['pixel_width'] + unit_width = input['unit_width'] + units = input['units'] + web.render('index.tmpl') + else: + ruler = Ruler(pixel_width = input['pixel_width'], + unit_width = input['unit_width'], + units = input['units']) + + web.redirect('/show/%s' % ruler.url()) + +class show_ruler: + def GET(self, ruler_url, ext): + web.debug('test test') + if web.input().has_key('fromgallery'): + fromgallery = True + else: + fromgallery = False + + other_unit, other_unit_url = get_other_unit(ruler_url) + + web.header("Content-Type","text/html; charset=utf-8") + web.render('show_ruler.tmpl') + + +class ruler_img: + def GET(self, pixel_width=None, unit_width=None, units=None, ext=None): + + # TODO check to see if it's a format that we support + + # set ruler height to be 200 px always + pixel_width = float(pixel_width) + unit_width = float(unit_width) + + ruler_height = 200 + + scale = pixel_width / unit_width + ruler_length = int(unit_width) + + ruler = SVGRuler(scale, units, ruler_height, ruler_length) + + # print the header + if ext == 'svg': ext = 'svg+xml' + web.header("Content-Type", "image/%s" % ext) + + if ext == 'svg+xml': + sys.stdout.write(ruler.getxml()) + else: + pin, pout = os.popen2('convert -size %sx%s - %s:-' % \ + (pixel_width, ruler_height, ext)) + + pin.write(ruler.getxml()) + pin.close() + sys.stdout.write(pout.read()) + +class gallery: + def GET(self, ruler_url): + + if ruler_url: + pixel_width, unit_width, units = process_ruler_url(ruler_url)[0:3] + + rulers = store.find(Ruler, Ruler.show == 1) + rulers.order_by(Ruler.model) + web.render('gallery.tmpl') + + def POST(self, ruler_url): + input = web.input() + + errormsg = valid_input(input) + if not input.model: + errormsg = 'Please fill out all fields.' + + if errormsg: + pixel_width = input['pixel_width'] + unit_width = input['unit_width'] + units = input['units'] + model = input['model'] + else: + new_ruler = Ruler(pixel_width = input['pixel_width'], + unit_width = input['unit_width'], + units = input['units'], + model = input['model']) + + store.add(new_ruler) + store.commit() + + rulers = store.find(Ruler, Ruler.show == 1) + rulers.order_by(Ruler.model) + web.render('gallery.tmpl') + +class delete: + def GET(self, id): + ruler = store.get(Ruler, int(id)) + ruler.show = 0 + store.commit() + web.redirect('/gallery') + + +class undelete: + def GET(self, id): + ruler = store.get(Ruler, int(id)) + ruler.show = 1 + store.commit() + web.redirect('/gallery') + +def get_other_unit(url): + pixel_width, unit_width, units = process_ruler_url(url)[0:3] + + ruler = Ruler(pixel_width=pixel_width, unit_width=unit_width, units=units) + pixel_width, unit_width, units = process_ruler_url(url)[0:3] + + if units == 'centimeters': + units = 'inches' + unit_width = ruler.in_width() + elif units == 'inches': + units = 'centimeters' + unit_width = ruler.cm_width() + + new_ruler = Ruler(pixel_width=pixel_width, unit_width=unit_width, + units=units) + + web.debug(units) + return(units, new_ruler.url()) + + +def process_ruler_url(url): + url = re.sub(r'^/?(ruler.*)$', r'\1', url) + return(re.match( r'ruler_([\d\.]+)px_([\d\.]+)(\w+).(png|svg|jpg)', + url).groups()) + +def validate_input(input): + errormsg = False + + if not input.pixel_width \ + or not input.unit_width: + errormsg = 'Please fill out all fields.' + elif not re.match('^[\d\.]+$', input.pixel_width) \ + or not re.match('^[\d\.]+$', input.unit_width): + errormsg = "Widths must be numbers." + elif input['pixel_width'] < 0 \ + or input['unit_width'] < 0: + errormsg = 'Widths must be greater than postive.' + + return(errormsg) + +# render the site template here so that i can use it later +web.render('site.tmpl', None, True, 'site') + +web.webapi.internalerror = web.debugerror +if __name__ == "__main__": + web.run(urls, globals(), web.reloader) + +application = web.wsgifunc(web.webpyfunc(urls, globals())) + -- 2.39.5