Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: commits

[3783] cherokee/trunk/admin: Covers a few extra cases about the new " config!*" configuration entry.

 

 

Cherokee commits RSS feed   Index | Next | Previous | View Threaded


cherokee at cherokee-project

Nov 5, 2009, 12:33 PM

Post #1 of 1 (31 views)
Permalink
[3783] cherokee/trunk/admin: Covers a few extra cases about the new " config!*" configuration entry.

Revision: 3783
http://svn.cherokee-project.com/changeset/3783
Author: alo
Date: 2009-11-05 21:33:39 +0100 (Thu, 05 Nov 2009)

Log Message:
-----------
Covers a few extra cases about the new "config!*" configuration entry.

Modified Paths:
--------------
cherokee/trunk/admin/CherokeeManagement.py
cherokee/trunk/admin/PageNewConfig.py
cherokee/trunk/admin/config.py
cherokee/trunk/admin/config_version.py
cherokee/trunk/admin/server.py

Modified: cherokee/trunk/admin/CherokeeManagement.py
===================================================================
--- cherokee/trunk/admin/CherokeeManagement.py 2009-11-05 19:23:50 UTC (rev 3782)
+++ cherokee/trunk/admin/CherokeeManagement.py 2009-11-05 20:33:39 UTC (rev 3783)
@@ -7,6 +7,7 @@

from consts import *
from configured import *
+from config_version import *

DEFAULT_DELAY = 2
WAIT_SERVER_STOP = 10
@@ -136,11 +137,13 @@
except:
return False

+ content = "config!version = %s\n" %(config_version_get_current())
+
conf_sample = os.path.join(CHEROKEE_ADMINDIR, template_file)
if os.path.exists (conf_sample):
- content = open(conf_sample, 'r').read()
+ content += open(conf_sample, 'r').read()
else:
- content = CHEROKEE_MIN_DEFAULT_CONFIG
+ content += CHEROKEE_MIN_DEFAULT_CONFIG

try:
f = open(file, 'w+')

Modified: cherokee/trunk/admin/PageNewConfig.py
===================================================================
--- cherokee/trunk/admin/PageNewConfig.py 2009-11-05 19:23:50 UTC (rev 3782)
+++ cherokee/trunk/admin/PageNewConfig.py 2009-11-05 20:33:39 UTC (rev 3783)
@@ -57,16 +57,19 @@
return None
cherokee_management_reset()
return "/"
+
elif uri == "/performance":
manager = cherokee_management_get (self._cfg)
if not manager.create_config (self._cfg.file, "performance.conf.sample"):
return None
cherokee_management_reset()
return "/"
+
elif uri == "/development":
manager = cherokee_management_get (self._cfg)
if not manager.create_config (self._cfg.file, "cherokee.conf.sample"):
return None
+
self._tweak_config_for_dev()
cherokee_management_reset()
return "/"

Modified: cherokee/trunk/admin/config.py
===================================================================
--- cherokee/trunk/admin/config.py 2009-11-05 19:23:50 UTC (rev 3782)
+++ cherokee/trunk/admin/config.py 2009-11-05 20:33:39 UTC (rev 3783)
@@ -288,7 +288,7 @@

tmp = self.root.serialize().split('\n')
tmp.sort(sorter)
- return '\n'.join(tmp)
+ return '\n'.join (filter (lambda x: len(x) > 1, tmp))

def save (self):
# Try to make a copy

Modified: cherokee/trunk/admin/config_version.py
===================================================================
--- cherokee/trunk/admin/config_version.py 2009-11-05 19:23:50 UTC (rev 3782)
+++ cherokee/trunk/admin/config_version.py 2009-11-05 20:33:39 UTC (rev 3783)
@@ -9,8 +9,8 @@
micro = int(v3)

return "%03d%03d%03d" %(major, minor, micro)
-

+
def config_version_cfg_is_up_to_date (cfg):
# Cherokee's version
ver_cherokee = config_version_get_current()
@@ -24,7 +24,7 @@
# Compare both of them
if int(ver_config) > int(ver_cherokee):
print "WARNING!! Running a new configuration file (version %s)" % (ver_config)
- print "with anolder version of Cherokee (version %s)" % (ver_cherokee)
+ print " with anolder version of Cherokee (version %s)" % (ver_cherokee)
return True

elif int(ver_config) == int(ver_cherokee):
@@ -35,6 +35,10 @@


def config_version_update_cfg (cfg):
+ # Do not proceed if it's empty
+ if not cfg.has_tree():
+ return
+
# Update only when it's outdated
if config_version_cfg_is_up_to_date (cfg):
return

Modified: cherokee/trunk/admin/server.py
===================================================================
--- cherokee/trunk/admin/server.py 2009-11-05 19:23:50 UTC (rev 3782)
+++ cherokee/trunk/admin/server.py 2009-11-05 20:33:39 UTC (rev 3783)
@@ -56,6 +56,7 @@
status = "200 OK"
uri = self.env['REQUEST_URI']

+ # Translation
if (not SELECTED_LANGUAGE and
self.env.has_key('HTTP_ACCEPT_LANGUAGE')):
try:

Cherokee commits RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.