diff options
| author | 2010-03-31 14:27:31 +0200 | |
|---|---|---|
| committer | 2010-03-31 14:27:31 +0200 | |
| commit | 53865e7411fa0528093cbfa5f4ba7591e71f2ef8 (patch) | |
| tree | 11f463c460755c96700e0feba5e68e31052c9195 | |
| parent | freespace for windows (diff) | |
| download | pyload-53865e7411fa0528093cbfa5f4ba7591e71f2ef8.tar.xz | |
parser fix
| -rw-r--r-- | module/XMLConfigParser.py | 2 | ||||
| -rw-r--r-- | module/web/media/default/css/default.css | 69 | ||||
| -rw-r--r-- | module/web/pyload/views.py | 4 | ||||
| -rw-r--r-- | module/web/templates/default/settings.html | 121 | ||||
| -rwxr-xr-x | pyLoadCore.py | 19 | 
5 files changed, 202 insertions, 13 deletions
| diff --git a/module/XMLConfigParser.py b/module/XMLConfigParser.py index 87b863d28..50214c49a 100644 --- a/module/XMLConfigParser.py +++ b/module/XMLConfigParser.py @@ -42,7 +42,7 @@ class XMLConfigParser():          file = self.file          if self.forceDefault:              file = self.file_default -        if not exists(self.file) or self.forceDefault: +        if not exists(self.file):              self._copyConfig()          with open(file, 'r') as fh:              self.xml = parse(fh) diff --git a/module/web/media/default/css/default.css b/module/web/media/default/css/default.css index 24bb9febf..398cb03b6 100644 --- a/module/web/media/default/css/default.css +++ b/module/web/media/default/css/default.css @@ -1227,12 +1227,13 @@ label.simple {  label.block input.edit {
  	width:50%;
  }
 -fieldset {
 +/*fieldset {
  	width:300px;
  	text-align:center;
  	padding:0.5em;
  	margin:auto;
  }
 +*/
  div.editor {
  	margin:0 0 0 0;
  }
 @@ -1513,4 +1514,68 @@ div.codearea pre span.Preprc {  .header, .header th{
  	text-align: left;
  	font-weight: normal;
 -}
\ No newline at end of file +}
 +
 +#horizontalForm fieldset
 +{
 +	display: block;
 +	margin: 0 0 3em 0;
 +	padding: 0 1em 1em 1em;
 +}
 +
 +#horizontalForm fieldset.radio
 +{
 +	margin: 1em 0 2em 0;
 +}
 +
 +#horizontalForm fieldset.radio input
 +{
 +	clear: both;
 +	float: left;
 +	width: auto;
 +}
 +
 +#horizontalForm fieldset.radio label
 +{
 +	font-weight: normal;
 +}
 +
 +#horizontalForm input
 +{
 +	display: block;
 +	width: 15em;
 +}
 +
 +#horizontalForm input.submit
 +{
 +	clear: both;
 +}
 +
 +#horizontalForm label
 +{
 +	float: left;
 +	display: block;
 +	margin: 1em 1em 0 0;
 +	font-weight: bold;
 +}
 +
 +#horizontalForm select
 +{
 +	display: block;
 +}
 +
 +.clearer
 +{
 +	clear: both;
 +	height: 1px;
 +}
 +
 +.left
 +{
 +	float: left;
 +}
 +
 +.right
 +{
 +	float: right;
 +}
 diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index e8df50596..6dbbd22c6 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -169,4 +169,6 @@ def collector(request):  @permission('pyload.can_change_status')  @check_server  def config(request): -    return render_to_response(join(settings.TEMPLATE, 'settings.html'), RequestContext(request, {}, [status_proc])) +    conf = settings.PYLOAD.get_config_data() + +    return render_to_response(join(settings.TEMPLATE, 'settings.html'), RequestContext(request, {'conf': conf}, [status_proc])) diff --git a/module/web/templates/default/settings.html b/module/web/templates/default/settings.html index ab144bed6..d3d906c47 100644 --- a/module/web/templates/default/settings.html +++ b/module/web/templates/default/settings.html @@ -27,6 +27,127 @@  {% block content %} +{{ conf }} + +  <h3>Coming Soon.</h3> +<form id="horizontalForm" action=""> + +    {% for key, section in conf.items  %} + +    <fieldset> +        <legend> +        {{section.name}} +        </legend> + +    {% for key, option in section.options.items %} + +    <label for="{{option.name}}"> +        {{option.name}} +        <input id="{{option.name}}" name="{{option.name}}" type="text" value="{{option.value}}"/> +    </label> +    {% endfor %} +    </fieldset> +    {% endfor %} + +    <fieldset> +            <legend> +                    Name +            </legend> +            <label class="first" for="title1"> +                    Title +                    <select id="title1" name="title1"> +                            <option selected="selected">Mr.</option> + +                            <option>Mrs.</option> +                            <option>Ms.</option> +                            <option>Dr.</option> +                            <option>Viscount</option> +                    </select> +            </label> +            <label for="firstName1"> + +                    First name +                    <input id="firstName1" name="firstName1" type="text" value="First name" /> +            </label> +            <label for="lastName1"> +                    Last name +                    <input id="lastName1" name="lastName1" type="text" value="Last name" /> +            </label> +            <div class="clearer"></div> +    </fieldset> +    <fieldset> + +            <legend> +                    Address +            </legend> +            <label class="first" for="street1"> +                    Street +                    <input id="street1" name="street1" type="text" value="Street" /> +            </label> +            <label for="city1"> +                    City +                    <input id="city1" name="city1" type="text" value="City" /> + +            </label> +            <label for="state1"> +                    State +                    <input id="state1" name="state1" type="text" value="State" /> +            </label> +            <label for="postcode1"> +                    Postcode +                    <input id="postcode1" name="postcode1" type="text" value="Postcode" /> +            </label> +            <label for="country1"> + +                    Country +                    <input id="country1" name="country1" type="text" value="Country" /> +            </label> +            <div class="clearer"></div> +    </fieldset> +    <fieldset> +            <legend> +                    Payment details +            </legend> +            <fieldset class="radio"> + +                    <legend> +                            Credit card +                    </legend> +                    <label for="cardType1A"> +                            <input id="cardType1A" name="card1" type="radio" /> +                            American Express +                    </label> +                    <label for="cardType1B"> +                            <input id="cardType1B" name="card1" type="radio" /> +                            Mastercard +                    </label> + +                    <label for="cardType1C"> +                            <input id="cardType1C" name="card1" type="radio" /> +                            Visa +                    </label> +                    <label for="cardType1D"> +                            <input id="cardType1D" name="card1" type="radio" /> +                            Blockbuster Card +                    </label> +                    <div class="clearer"></div> +            </fieldset> + +            <label for="cardNum1"> +                    Card number +                    <input id="cardNum1" name="cardNum1" type="text" value="Card number" /> +            </label> +            <label for="expiry1"> +                    Expiry date +                    <input id="expiry1" name="city1" type="text" value="City" /> +            </label> +            <input class="submit" type="submit" value="Submit my details" /> +            <div class="clearer"></div> + +    </fieldset> +</form> + +  {% endblock %}
\ No newline at end of file diff --git a/pyLoadCore.py b/pyLoadCore.py index e2682c990..643156d25 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -22,7 +22,7 @@  """  CURRENT_VERSION = '0.3.2' -import signal +from copy import deepcopy  from getopt import GetoptError  from getopt import getopt  import gettext @@ -31,13 +31,13 @@ from imp import find_module  import logging  import logging.handlers  from operator import attrgetter +from os import _exit  from os import chdir -from os import name as platform  from os import execv  from os import makedirs +from os import name as platform  from os import remove  from os import sep -from os import _exit  from os import statvfs  from os.path import abspath  from os.path import basename @@ -46,11 +46,12 @@ from os.path import exists  from os.path import isabs  from os.path import join  from re import sub +import signal  import subprocess +import sys  from sys import argv  from sys import executable  from sys import exit -import sys  from sys import path  from sys import stdout  from sys import version_info @@ -436,7 +437,7 @@ class Core(object):      def check_update(self):          try:              if self.config['updates']['search_updates']: -                version_check = getURL("http://get.pyload.org/check/%s/" % (CURRENT_VERSION, )) +                version_check = getURL("http://get.pyload.org/check/%s/" % (CURRENT_VERSION,))                  if version_check == "":                      self.logger.info(_("No Updates for pyLoad"))                      return False @@ -454,9 +455,9 @@ class Core(object):          try:              if self.config['updates']['search_updates']:                  if self.core.config['updates']['install_updates']: -                    version_check = getURL("http://get.pyload.org/get/update/%s/" % (CURRENT_VERSION, )) +                    version_check = getURL("http://get.pyload.org/get/update/%s/" % (CURRENT_VERSION,))                  else: -                    version_check = getURL("http://get.pyload.org/check/%s/" % (CURRENT_VERSION, )) +                    version_check = getURL("http://get.pyload.org/check/%s/" % (CURRENT_VERSION,))                  if version_check == "":                      return False                  else: @@ -526,13 +527,13 @@ class ServerMethods():              raise Exception("not allowed!")      def get_config(self): -        d = self.core.xmlconfig.getConfigDict() +        d = deepcopy(self.core.xmlconfig.getConfigDict())          del d["remote"]["username"]          del d["remote"]["password"]          return d      def get_config_data(self): -        d = self.core.xmlconfig.getDataDict() +        d = deepcopy(self.core.xmlconfig.getDataDict())          del d["remote"]["options"]["username"]          del d["remote"]["options"]["password"]          return d | 
