diff --git a/INSTALL b/INSTALL index 72856076359cfbfdb6abcb51340a8f1546ff5548..3b799b4a8b26d7c13e8632b801670bd1834c1fb6 100644 --- a/INSTALL +++ b/INSTALL @@ -132,6 +132,10 @@ Now run the tests: MUTALYZER_ENV=test nosetests +Note: Currently it is not advised to run the tests on a production server +since they need write access to the main Mutalyzer cache and log. A separate +cache and log for local users and tests is planned functionality. + Upgrade Mutalyzer ----------------- diff --git a/README b/README index 0774f9801c51e3b560d02e27807b28d15e661ab9..dc7d6ad1e0256389379f8cfaf41a2ef9bb791ae4 100644 --- a/README +++ b/README @@ -32,6 +32,10 @@ Or, if you are in a hurry, skip the long-running tests with: MUTALYZER_ENV=test MUTALYZER_QUICK_TEST=1 nosetests -v +Note: Currently it is not advised to run the tests on a production server +since they need write access to the main Mutalyzer cache and log. A separate +cache and log for local users and tests is planned functionality. + Development notes ----------------- @@ -45,8 +49,6 @@ Todo list: - Test all uses of mkstemp(). - Use naming conventions for modules Crossmap, Db, File, GenRecord, Mapper, Retriever, Scheduler. -- Integrate fuzzy offsets from this branch: - https://www.mutalyzer.nl/projects/mutalyzer2/changeset?old_path=%2Ftrunk&old=228&new_path=%2Fbranches%2Fexon-deletions-branch&new=228#file5 - Use standard logging module, with rotating functionality. Race conditions on the log file are probably a problem in the current setup. Instead of that rotating, we could also use logrotate: @@ -71,8 +73,6 @@ Todo list: - In deployment, remove old versions of Mutalyzer package? - Use https protocol. - Check for os.path.join vulnerabilities. -- Use web.config.debug=False on production server and perhaps put this in - the configuration file. - Solution for database schema migration on version updates. Code style guide: diff --git a/extras/config.example b/extras/config.example index dfc8a1350e89e375fa4f8903a8150201097368bc..05e01241f77d7afca542030483d8ec452c7d0952 100644 --- a/extras/config.example +++ b/extras/config.example @@ -78,6 +78,9 @@ loglevel = 3 # Level of output messages. outputlevel = 1 +# Show debug info in the web interface. +debug = yes + # # These settings are used by the Mutator module. diff --git a/mutalyzer/config.py b/mutalyzer/config.py index 2d8837af8a0dbd009351ab3cdc0c98892187120c..4f222c97e12a689590e6a9f3b4802f75a75f5187 100644 --- a/mutalyzer/config.py +++ b/mutalyzer/config.py @@ -61,6 +61,7 @@ class Config(): overwrite the base configuration. For example, a normal user could use a different cache directory (writable by the user) than the system wide Mutalyzer config. + We could use the 'merge' method from configobj. """ if filename is None: base = os.environ.get('XDG_CONFIG_HOME', None) @@ -105,6 +106,7 @@ class Config(): self.Output.datestring = config["datestring"] self.Output.loglevel = int(config["loglevel"]) self.Output.outputlevel = int(config["outputlevel"]) + self.Output.debug = config.as_bool('debug') # Set the variables needed by the Mutator module. self.Mutator.flanksize = int(config["flanksize"]) @@ -133,7 +135,6 @@ class Config(): self.GenRecord.spliceAlarm = int(config["spliceAlarm"]) self.GenRecord.spliceWarn = int(config["spliceWarn"]) - # If we are in a testing environment, use a temporary file for # logging and a temporary directory for the cache. # We don't remove these after the tests, since they might be diff --git a/mutalyzer/website.py b/mutalyzer/website.py index be9c833b4362d8716ee0a53344e2cd02b5473e90..faa358539f450ee43114a6200c2e854ddd50e03b 100644 --- a/mutalyzer/website.py +++ b/mutalyzer/website.py @@ -42,13 +42,14 @@ from mutalyzer import Retriever from mutalyzer import File -web.config.debug = True - - # Load configuration from configuration file config = Config() +# Show web.py debugging information. +web.config.debug = config.Output.debug + + # URL dispatch table urls = ( '', 'RedirectHome',