From 1872a2634a458bae98c2095e00a1d955cf9cf3a7 Mon Sep 17 00:00:00 2001 From: Martijn Voncken Date: Tue, 11 Mar 2008 18:40:04 +0000 Subject: [PATCH] use data/pixmaps instead of copied images --- deluge/ui/webui/pages.py | 31 ++++++++---------- deluge/ui/webui/render.py | 1 + deluge/ui/webui/static/images/dht16.png | Bin 607 -> 0 bytes .../ui/webui/static/images/downloading16.png | Bin 662 -> 0 bytes deluge/ui/webui/static/images/inactive16.png | Bin 588 -> 0 bytes deluge/ui/webui/static/images/seeding16.png | Bin 612 -> 0 bytes .../webui/templates/advanced/part_stats.html | 6 ++-- .../templates/advanced/part_torrent_list.html | 2 +- deluge/ui/webui/templates/deluge/index.html | 2 +- deluge/ui/webui/templates/white/index.html | 2 +- .../webui/templates/white/template_style.css | 2 +- 11 files changed, 22 insertions(+), 24 deletions(-) delete mode 100644 deluge/ui/webui/static/images/dht16.png delete mode 100644 deluge/ui/webui/static/images/downloading16.png delete mode 100644 deluge/ui/webui/static/images/inactive16.png delete mode 100644 deluge/ui/webui/static/images/seeding16.png diff --git a/deluge/ui/webui/pages.py b/deluge/ui/webui/pages.py index 0e142e0e1..706e3e552 100644 --- a/deluge/ui/webui/pages.py +++ b/deluge/ui/webui/pages.py @@ -39,6 +39,8 @@ from config import config_page from torrent_options import torrent_options from torrent_move import torrent_move +from deluge.common import get_pixmap + #debugerror from debugerror import deluge_debugerror web.webapi.internalerror = deluge_debugerror @@ -134,7 +136,8 @@ urls = [ "/", "home", "", "home", "/robots.txt","robots", - "/template_style.css","template_style" + "/template_style.css","template_style", + "/pixmaps/(.*)","pixmaps" ] #/routing @@ -472,10 +475,18 @@ class template_style: style = Storage() print render.template_style(style) +class pixmaps: + "use the deluge-images. located in data/pixmaps" + def GET(self, name): + web.header("Content-Type", "image/png") + f = open(get_pixmap(name) ,'rb') + print f.read() + f.close() + #/pages -#for plugins.. -page_classes = dict(globals()) #test-1 +#for plugins: +page_classes = dict(globals()) def register_page(url, klass): urls.append(url) @@ -486,17 +497,3 @@ def unregister_page(url): raise NotImplemenetedError() #page_classes[klass.__name__] = None -""" -class test: - @deco.deluge_page - def GET(self, name): - return "HI" - - -register_page('/test(.*)', test) - - -print urls -print page_classes['index'] -print page_classes['test'] -""" \ No newline at end of file diff --git a/deluge/ui/webui/render.py b/deluge/ui/webui/render.py index 837326538..b738e1bd8 100644 --- a/deluge/ui/webui/render.py +++ b/deluge/ui/webui/render.py @@ -162,6 +162,7 @@ template.Template.globals.update({ '_': _ , #gettext/translations 'str': str, #because % in templetor is broken. 'int':int, + 'len':len, 'deluge_int':deluge_int, 'sorted': sorted, 'altrow':altrow, diff --git a/deluge/ui/webui/static/images/dht16.png b/deluge/ui/webui/static/images/dht16.png deleted file mode 100644 index be59e5e61d3887445f2bc094dc230348a6539582..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 607 zcmeAS@N?(olHy`uVBq!ia0y~yVBlw9U=ZM7V_;x78K%m@z`(##?Bp53!NI{%!;#X# zz`(#+;1OBOz`!sQgc%F^6KWV37$i$vBT9nv(@M${i&7cN%ggmL^RkPR6AM!H@{7`E zzq65IU|_uC>EaloF|l-#VTN#`MBDuTJzSw114IP5&6;&3*xxQ{3ew)%r4e+Jm-Ti- z!Gh#2Z*I{ge2&5~GD0ku*Rr^L@l#xJ!7=2;wRsjI${HTrj{+7&M18i3@mu%t&$9Q` z|NsBAtElW%Ii&StW}E`Q3}e=TvpK8&wEUmK`LJpJP5v{?)=KZ0&ZPuDonE*>^yT_3 z4Ge5M#6)e*zvlVv;&NYddo1r(^M!m5OfNjHyvLnjQ1vrX=Fi{P{o%)EByWv+YjxrB z6!wP6^$#~XU*0VLd|J_gs1>!p_ZVH?m|yL8>2``yWbd0loM)6fO9G!AIB-MZ!nAma zyL00u-oD>E!G?Pa^KunM&g-SWW3JCFiZxf|oUHeX#elbj(Jmoe#!e#nm&#eGWUEHo zNzdL0iCqXQT;crSTZ%A?2jflNHqZEmUq^SJ7CxY!a8vK&0lkgdjBj#3t|(QDy<(Q2 zr4-9LO{dAF)i9d<-O(9#LdzvRZ>a9#cvD~Xr6P@0A~O1KZRY1|zULd;-`|_!&)gsV zU{hzB^nwTJ#~N=7zC71^*tlQs{(n=>Im#Y)l?+lo=JUFdMbhdDy$g%y_#m^@$nS9;iiknWv>qP?c4-PeXi|dtKFH`Pt z)Le1ear-~cl^xcC%8R7$?kITdBoM=C%6-|5t5M85$#>S0nJJSh<-|8G?0ise*&Pyd?q)RgnUsgyX2s>(fu&$Fgv zmuHu;Zd#yce|JxLy--5C?o)5e*l?q#+oH{xJ{>r)V72<4V+rLK&xm#X|6`!KG|s9q zm*oi~14j$lUKrJU zB!y++e*F%gTZujnN{bH#W&hY0C&zbdQ-Dr=>&6943`#b9>Thy4rrVz>j+wCEbnYw; zhPPSrKc*gV$a?(a=8OADymLH7PiM!axU@Wv=Fcxs+yCO1?oG}di*5X>rxtbu9;slm ztDM_+JHljh>!*zA*Sxm-FP-v|ok@6oi-;Wa0=6ghuXcP5XZe+o#%;#%hw*>Yqpyn| T%-_hsz`)??>gTe~DWM4ftBxNX diff --git a/deluge/ui/webui/static/images/inactive16.png b/deluge/ui/webui/static/images/inactive16.png deleted file mode 100644 index 10342be186f9e3f4a2b700a54e6d5346e7b3143a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 588 zcmeAS@N?(olHy`uVBq!ia0y~yVBle3U=ZM7V_;xVN}R{ez`(##?Bp53!NI{%!;#X# zz`(#+;1OBOz`)7^!iAy>EaloF|jqscD1mhi0$r~b8q%@iurqrI+|S*4LYlDzy3OJ zI`6eeRmCHM&;R@`+r2kTgq2}I)Y@mW&ps<#e%W&Gga^Cc{r+3`Kb(gla@s`&j(r@8 z>*g3ADf}}<;L^>vWzQdVFLIdoy!8He`?-Zv!&aAyusG_UHd=m1oMFqg0-5K}Ds1Mp zCRStxd%e$IyZ2&7i;3?<70xA7UVQ)UaarW>LxCVKgJW^riX4Tp-yc@(b=w=~zWL^n z6r;ucFNUi-E5c%j^F*T6ek^6%p(1RW~9D{j{Cb!isEF$sy}oTS^| z^ciNHf9^4frTZvTqC}F_+@_$en>lS!Yumh*G9{n!&o+>#iCY_X_jK0Jef&$WSVw#P zY%5;(Uwzq>LlU2zHNT$9+kX50l%Rf#=ax&qG)*Yxb2{PWRjJ>#=zjbDlEa_(OmCTB teQd^RhM2WqJEweNZde~ElFRsjzuE8#&z4`knhXpK44$rjF6*2UngAzG`)mLJ diff --git a/deluge/ui/webui/static/images/seeding16.png b/deluge/ui/webui/static/images/seeding16.png deleted file mode 100644 index 6994323de6bb3a6c7ef83a6dbd18d8e43be52059..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 612 zcmeAS@N?(olHy`uVBq!ia0y~yVBle3U=ZM7V_;xVN}R{ez`(##?Bp53!NI{%!;#X# zz`(#+;1OBOz`)7^!iEaloF|l{jUVq_2iR1SBU*G+DD=9ulnj=c6M`f2p59g-Rf`SAikHv0> zQx+fV+^|F9AM^KBfr}F^ojrI|;y+_A3%e%^o1j;;j_%&L^?Sd)d!Dc&!uQK=TmAVq z=RcoSUNS`{Os(C1$>t2pGtV|heDQqif27IAgU4WRx?Y&t8Eq?9`JE`TmVjt0uqMp}?{v$zpc3&$G=s{|z5zbfky zlY&2acl?_%o3VFgmhhY^Mzc>_y0o|KPOx6`NO2k;!~N$ETYm(!m|OqOSo=43(mku^ zmxEu#^(HNJxNh&EbK=IO>TP;+QzJWBX5^J}-ng2tve)#O`Xz=XZvKV8X0*lraXHy? zgyFlfWr(U+%CqXT%eH-DI{#K->Gk3zspbV{_miewE3|dv>6P|6o*J`)k?rz#jR^M_ zWpm^DQud_)h(KxhcRl&ip9t>{RAIIK&vUAFwbLp8(e;6W;>~7RJ T`Yn!ufq}u()z4*}Q$iB}g7FN0 diff --git a/deluge/ui/webui/templates/advanced/part_stats.html b/deluge/ui/webui/templates/advanced/part_stats.html index 0a38f0789..4600dbc28 100644 --- a/deluge/ui/webui/templates/advanced/part_stats.html +++ b/deluge/ui/webui/templates/advanced/part_stats.html @@ -7,11 +7,11 @@ $def with (stats) $stats.num_connections ($deluge_int(stats.max_num_connections)) -$stats.download_rate ($deluge_int(stats.max_download)) +$stats.download_rate ($deluge_int(stats.max_download)) -$stats.upload_rate ($deluge_int(stats.max_upload)) +$stats.upload_rate ($deluge_int(stats.max_upload)) -$stats.dht_nodes +$stats.dht_nodes diff --git a/deluge/ui/webui/templates/advanced/part_torrent_list.html b/deluge/ui/webui/templates/advanced/part_torrent_list.html index bd27abb48..92f6168c7 100644 --- a/deluge/ui/webui/templates/advanced/part_torrent_list.html +++ b/deluge/ui/webui/templates/advanced/part_torrent_list.html @@ -42,7 +42,7 @@ $for torrent in torrent_list:
diff --git a/deluge/ui/webui/templates/deluge/index.html b/deluge/ui/webui/templates/deluge/index.html index 462b5a504..5d2627a5c 100644 --- a/deluge/ui/webui/templates/deluge/index.html +++ b/deluge/ui/webui/templates/deluge/index.html @@ -26,7 +26,7 @@ $for torrent in torrent_list:
$torrent.queue diff --git a/deluge/ui/webui/templates/white/index.html b/deluge/ui/webui/templates/white/index.html index e4eaad79a..0767c04b8 100644 --- a/deluge/ui/webui/templates/white/index.html +++ b/deluge/ui/webui/templates/white/index.html @@ -61,7 +61,7 @@ $if organize_filters:
- +