2 new revisions:
Revision: 1c248a30a316
Author: Pekka Klärck
Date: Thu Dec 1 05:54:12 2011
Log: Settings: xxx_configuration() -> xxx_config
http://code.google.com/p/robotframework/source/detail?r=1c248a30a316
Revision: 7459faafa718
Author: Pekka Klärck
Date: Thu Dec 1 06:06:57 2011
Log: cleanup
http://code.google.com/p/robotframework/source/detail?r=7459faafa718
==============================================================================
Revision: 1c248a30a316
Author: Pekka Klärck
Date: Thu Dec 1 05:54:12 2011
Log: Settings: xxx_configuration() -> xxx_config
http://code.google.com/p/robotframework/source/detail?r=1c248a30a316
Modified:
/src/robot/conf/settings.py
/src/robot/reporting/resultwriter.py
=======================================
--- /src/robot/conf/settings.py Thu Dec 1 05:47:38 2011
+++ /src/robot/conf/settings.py Thu Dec 1 05:54:12 2011
@@ -311,7 +311,8 @@
def _escape(self, value):
return value
- def result_configuration(self):
+ @property
+ def result_config(self):
opts = dict((opt, self[setting]) for opt, setting in
[('name', 'Name'),
('doc', 'Doc'),
@@ -330,12 +331,14 @@
opts['metadata'] = dict(opts['metadata'])
return opts
- def statistics_configuration(self):
+ @property
+ def statistics_config(self):
return (self['SuiteStatLevel'], self['TagStatInclude'],
self['TagStatExclude'], self['TagStatCombine'],
self['TagDoc'], self['TagStatLink'])
- def log_configuration(self):
+ @property
+ def log_config(self):
if not self.log:
return {}
return {
@@ -344,7 +347,8 @@
'splitLogBase': os.path.basename(os.path.splitext(self.log)[0])
}
- def report_configuration(self):
+ @property
+ def report_config(self):
if not self.report:
return {}
return {
=======================================
--- /src/robot/reporting/resultwriter.py Thu Dec 1 05:44:17 2011
+++ /src/robot/reporting/resultwriter.py Thu Dec 1 05:54:12 2011
@@ -31,8 +31,8 @@
result = Result(settings, data_sources)
self._write_output(result, settings.output)
self._write_xunit(result, settings.xunit)
- self._write_log(result, settings.log, settings.log_configuration())
- self._write_report(result, settings.report,
settings.report_configuration())
+ self._write_log(result, settings.log, settings.log_config)
+ self._write_report(result, settings.report, settings.report_config)
return result.return_code
def _write_output(self, result, output):
@@ -71,9 +71,9 @@
if self._model is None:
self._model = ResultFromXML(*self._data_sources)
# TODO: configure and configure_statistics really should be
combined somehow
-
self._model.configure_statistics(*self._settings.statistics_configuration())
+
self._model.configure_statistics(*self._settings.statistics_config)
self._model.configure(status_rc=self._settings.status_rc,
- **self._settings.result_configuration())
+ **self._settings.result_config)
return self._model
@property
==============================================================================
Revision: 7459faafa718
Author: Pekka Klärck
Date: Thu Dec 1 06:06:57 2011
Log: cleanup
http://code.google.com/p/robotframework/source/detail?r=7459faafa718
Modified:
/src/robot/conf/settings.py
/src/robot/reporting/resultwriter.py
/src/robot/result/executionresult.py
=======================================
--- /src/robot/conf/settings.py Thu Dec 1 05:54:12 2011
+++ /src/robot/conf/settings.py Thu Dec 1 06:06:57 2011
@@ -313,29 +313,33 @@
@property
def result_config(self):
- opts = dict((opt, self[setting]) for opt, setting in
- [('name', 'Name'),
- ('doc', 'Doc'),
- ('metadata', 'Metadata'),
- ('set_tags', 'SetTag'),
- ('include_tags', 'Include'),
- ('exclude_tags', 'Exclude'),
- ('include_suites', 'SuiteNames'),
- ('include_tests', 'TestNames'),
- ('remove_keywords', 'RemoveKeywords'),
- ('log_level', 'LogLevel'),
- ('critical', 'Critical'),
- ('noncritical', 'NonCritical'),
- ('starttime', 'StartTime'),
- ('endtime', 'EndTime')])
- opts['metadata'] = dict(opts['metadata'])
- return opts
+ return {
+ 'name': self['Name'],
+ 'doc': self['Doc'],
+ 'metadata': dict(self['Metadata']),
+ 'set_tags': self['SetTag'],
+ 'include_tags': self['Include'],
+ 'exclude_tags': self['Exclude'],
+ 'include_suites': self['SuiteNames'],
+ 'include_tests': self['TestNames'],
+ 'remove_keywords': self['RemoveKeywords'],
+ 'log_level': self['LogLevel'],
+ 'critical': self['Critical'],
+ 'noncritical': self['NonCritical'],
+ 'starttime': self['StartTime'],
+ 'endtime': self['EndTime']
+ }
@property
def statistics_config(self):
- return (self['SuiteStatLevel'], self['TagStatInclude'],
- self['TagStatExclude'], self['TagStatCombine'],
- self['TagDoc'], self['TagStatLink'])
+ return {
+ 'suite_stat_level': self['SuiteStatLevel'],
+ 'tag_stat_include': self['TagStatInclude'],
+ 'tag_stat_include': self['TagStatExclude'],
+ 'tag_stat_combine': self['TagStatCombine'],
+ 'tag_stat_link': self['TagStatLink'],
+ 'tag_doc': self['TagDoc'],
+ }
@property
def log_config(self):
=======================================
--- /src/robot/reporting/resultwriter.py Thu Dec 1 05:54:12 2011
+++ /src/robot/reporting/resultwriter.py Thu Dec 1 06:06:57 2011
@@ -71,7 +71,7 @@
if self._model is None:
self._model = ResultFromXML(*self._data_sources)
# TODO: configure and configure_statistics really should be
combined somehow
-
self._model.configure_statistics(*self._settings.statistics_config)
+
self._model.configure_statistics(**self._settings.statistics_config)
self._model.configure(status_rc=self._settings.status_rc,
**self._settings.result_config)
return self._model
=======================================
--- /src/robot/result/executionresult.py Thu Dec 1 04:11:16 2011
+++ /src/robot/result/executionresult.py Thu Dec 1 06:06:57 2011
@@ -26,11 +26,11 @@
self.errors = ExecutionErrors()
self.generator = None
self.should_return_status_rc = True
- self._stat_opts = ()
+ self._stat_opts = {}
@property
def statistics(self):
- return Statistics(self.suite, *self._stat_opts)
+ return Statistics(self.suite, **self._stat_opts)
@property
def return_code(self):
@@ -42,8 +42,8 @@
self.should_return_status_rc = status_rc
SuiteConfigurer(**suite_opts).configure(self.suite)
- # TODO: 1) Use **kwargs. 2) Combine with configure?
- def configure_statistics(self, *stat_opts):
+ # TODO: Combine with configure
+ def configure_statistics(self, **stat_opts):
self._stat_opts = stat_opts
def visit(self, visitor):