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 zcmV-l0-*hgP)qz*w7TpSVv)2#$V^iCnD&_Pt_)}A;NBPd7<;!vVkTJt(wPOkC% zrtf?I|M@<6d5t8(D)^aRAP*b?YQW8Gs{DlilnLR2pV<%013Mz`0?uSp<(F}=73r_E zfB*)#78N|t>kRuuMBf>=T@AH2p$_0R(BpaD3t%vM`B@zN{p*ic#+YNZTJ1W})078* zlYil{L({V#=azE7TBv>dyfV|VZ+lMC+hj6XjqLmh%p-|(QRcwF*dWlBUl`q;Ul{H0 zy^uT$v;(IkAqm%Y`&`$Za$Pqi36n1B1TYPB0X|??96lIh`XtR7V>*F7lIH9Z7SL94 zs6*iPWD^8P0oe_PNne2a#kcWRiIv7qOv<;CDHT zd(ZiC&-plvh;UT-Qch9C=xZmiZ<*Ob4-?{(4>6uxi_7|wsoz`&rZC)~zhchSriivRpDC8b_Efo%lj z0RRYu1Gg@xm6`YXQZ6wDJlR-Xl?C-$$7#W8^heRNdvJpONli+>IRwP`^0uB-ra!jb zJ!xmXiMix?XfU9`!1iVpkxYn~lsNNc@7?Yt<9bnu^7xV$I+2hh*89N0zP@2j@wu?vxV|#m)1(RPobUh+1o~iR3pN1!0sn&H^`hXPu>b%707*qoM6N<$f~$@n9RL6T 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 zcmV-S0<-;zP)Pg-{@ty9Tdk*Ko zy_PWshY&(AO6kWu&!0q5l%WJtCKzLHJ&A}=60vkIlYkJy6*e^e*aet09lsNAPBw)A+DS= z#BuzT5YpN0cIV=YqClSKb>H_topF^`t929vK`+ZPr`#6+wAOGO=jM1ko`qp}YEw$@ zYpuP}XoNIPkt7MEl<4>SNYfO<;Sf?vFveaBAqa6@_u+cIM!jA~v)ROCGJ#SGjYb2< z$HyRqz!(Fq^>xQ_9@|Ax+$taMUyxG5b=?;>fc2$n0LB;?V{BsE_AdaK&*w;z1dGK2 zVHjdMoq|$|*=&Ydt%gda0%OciYcLpmUaeN$%WC<)52e&QTT1zcbFTjFKfmkU_1a=zY#Rt#5{x9e7>o(Bb#QQC zGDxFF!(^kziLkgB{sZ@_QKMke&B4VO{{f8z2T2455lUMuExlf^z4q?sV5nG4^t(MT zpFGd=%_F3g99AZWKcus0In3s>SoBHlPsD;eNDMH&XCZ-^{+lkB)41f*g(n|n;=vn>BH;b@3wR{Li&fRs?GqYp=UmB|tL z4Y>Z8n*oifY7?A#0XFiqiYv6cU^}GZA(jpR-{;|l_)vs5JNsy@{cV!oI_J|<=w6Lt zp+MI^NG! yJY;kz!n~?*!SzT0M%UwA+2pyDyv}E70{j42#Jhng#r9qR0000$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:
- +