Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
erp5
Commits
15ea6655
Commit
15ea6655
authored
Jan 31, 2012
by
Tatuya Kamada
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the header section configuration format.
parent
1106f02e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
erp5/util/webchecker/__init__.py
erp5/util/webchecker/__init__.py
+9
-6
No files found.
erp5/util/webchecker/__init__.py
View file @
15ea6655
...
@@ -315,13 +315,13 @@ class HTTPCacheCheckerTestSuite(object):
...
@@ -315,13 +315,13 @@ class HTTPCacheCheckerTestSuite(object):
re.MULTILINE | re.IGNORECASE)
re.MULTILINE | re.IGNORECASE)
if content_type_regex.search(fetched_data) is not None:
if content_type_regex.search(fetched_data) is not None:
for header, value in self.conditional_header_dict[section]:
for header, value in self.conditional_header_dict[section]:
conditional_header_dict
.setdefault(header, []).append
(value)
conditional_header_dict
[header] = _formatConfiguration
(value)
continue
continue
if url_regex_str_match is not None:
if url_regex_str_match is not None:
url_regex_str = url_regex_str_match.group(1)
url_regex_str = url_regex_str_match.group(1)
if re.compile(url_regex_str).match(url) is not None:
if re.compile(url_regex_str).match(url) is not None:
for header, value in self.conditional_header_dict[section]:
for header, value in self.conditional_header_dict[section]:
conditional_header_dict
.setdefault(header, []).append
(value)
conditional_header_dict
[header] = _formatConfiguration
(value)
return conditional_header_dict
return conditional_header_dict
validator_dict = {}
validator_dict = {}
...
@@ -545,6 +545,12 @@ class HTTPCacheCheckerTestSuite(object):
...
@@ -545,6 +545,12 @@ class HTTPCacheCheckerTestSuite(object):
from optparse import OptionParser
from optparse import OptionParser
import ConfigParser
import ConfigParser
def _formatConfiguration(configuration):
""" format the configuration"""
if configuration in ('True', 'true', 'yes'):
return True
return configuration.splitlines()
def web_checker_utility():
def web_checker_utility():
usage = "
usage
:
%
prog
[
options
]
config_path
"
usage = "
usage
:
%
prog
[
options
]
config_path
"
parser = OptionParser(usage=usage)
parser = OptionParser(usage=usage)
...
@@ -577,10 +583,7 @@ def web_checker_utility():
...
@@ -577,10 +583,7 @@ def web_checker_utility():
# defaults are shared for all sections.
# defaults are shared for all sections.
# so discard them from header_list
# so discard them from header_list
continue
continue
if configuration in ('True', 'true', 'yes'):
value = _formatConfiguration(configuration)
value = True
else:
value = configuration.splitlines()
header_list[header] = value
header_list[header] = value
conditional_header_dict = {}
conditional_header_dict = {}
no_header_dict = {}
no_header_dict = {}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment