no crash on invalid daemon+cosmetics

This commit is contained in:
Martijn Voncken 2008-06-22 19:25:23 +00:00
parent aad8a926d6
commit b6a300f687
6 changed files with 13 additions and 12 deletions

View File

@ -43,7 +43,6 @@ config_page = component.get("ConfigPageManager")
class NetworkPorts(config_forms.CfgForm ):
title = _("Ports")
info = _("Restart daemon after changing these values.")
_port_from = forms.IntegerField(label= _("From"),min_value = 0, max_value=65535)
_port_to = forms.IntegerField(label = _("To"),min_value = 0, max_value=65535)
random_port = forms.CheckBox(label = _("Random"))

View File

@ -296,10 +296,11 @@ class connect:
def POST(self):
vars = web.input(uri = None, other_uri = None)
uri = ''
if vars.uri == 'other_uri':
if not vars.other:
print "URI=",uri
if vars.uri == 'other':
if not vars.other_uri:
return error_page(_("no uri"))
uri = vars.other
uri = vars.other_uri
else:
uri = vars.uri
#TODO: more error-handling

View File

@ -43,7 +43,7 @@ $fspeed(torrent.download_payload_rate)</td></td></tr>
<td class="info_value">$ftime(torrent.eta) </td></tr>
<tr><td class="info_label">$_('Pieces'):</td>
<td class="info_value">$torrent.num_pieces x $fsize(torrent.piece_length) </td>
<td class="info_value">$torrent.num_pieces ($fsize(torrent.piece_length)) </td>
</tr>
</table>

View File

@ -23,7 +23,7 @@ $def with (torrent_list, organize_filters)
</td><td>
</td><td align="right" width="320px">
</td><td align="right" width="450px">
$:part_stats()
</td></tr></table>
@ -34,8 +34,7 @@ $if organize_filters:
$:render.part_organize(organize_filters)
<table id="torrent_list_block" width="70%">
<table id="torrent_list_block" width="80%">
<tr><td>
<div id="toolbar">
$:render.part_toolbar()
@ -50,7 +49,7 @@ $if organize_filters:
</td></tr>
</table>
<div class="panel" id="info_panel_div" style="width:740px;">
<div class="panel" id="info_panel_div" style="width:740px;margin-left:180px">
<iframe
style="border-style:hidden;width:740px;height:200px;"
id="torrent_info">
@ -58,7 +57,6 @@ $if organize_filters:
</div>
<br />

View File

@ -228,7 +228,7 @@ div.progress_bar{
td.info_label {
width:100px;
/*width:80px;*/
}
#torrent_tab tr.head {

View File

@ -285,7 +285,10 @@ def set_config_defaults():
def apply_config():
#etc, mostly for apache:
from render import render
try:
sclient.set_core_uri(config.get('daemon'))
except:
print "error setting core uri:",config.get('daemon')
render.set_global('base', config.get('base'))
render.apply_cfg()