Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apachedex
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
apachedex
Commits
407d20fe
Commit
407d20fe
authored
Apr 11, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace print + sys.exit with parser.error .
parent
a11c5e4f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
apachedex/__init__.py
apachedex/__init__.py
+7
-11
No files found.
apachedex/__init__.py
View file @
407d20fe
...
...
@@ -1180,14 +1180,12 @@ def main():
elif
DURATION_S_FORMAT
in
args
.
logformat
:
getDuration
=
lambda
x
:
int
(
x
.
group
(
'duration_s'
))
*
US_PER_S
else
:
print
>>
sys
.
stderr
,
'Neither %D nor %T are present in logformat, apdex '
\
'cannot be computed.'
sys
.
exit
(
1
)
parser
.
error
(
'Neither %D nor %T are present in logformat, apdex '
'cannot be computed.'
)
if
args
.
match_servername
is
not
None
and
\
args
.
match_servername
not
in
args
.
logformat
:
print
>>
sys
.
stderr
,
'--match-servername %s requested, but missing '
\
'from logformat.'
%
args
.
match_servername
sys
.
exit
(
1
)
parser
.
error
(
'--match-servername %s requested, but missing '
'from logformat.'
%
args
.
match_servername
)
get_url_prefix
=
server_name_group_dict
.
get
(
args
.
match_servername
,
lambda
_
:
''
)
line_regex
=
''
...
...
@@ -1239,9 +1237,8 @@ def main():
if
default_site
is
None
:
default_action
=
None
if
not
[
None
for
_
,
_
,
x
in
site_list
if
x
is
not
None
]:
print
>>
sys
.
stderr
,
'None of --default, --erp5-base and --base were '
\
'specified, nothing to do.'
sys
.
exit
(
1
)
parser
.
error
(
'None of --default, --erp5-base and --base were '
'specified, nothing to do.'
)
else
:
default_action
=
partial
(
GenericSiteStats
,
suffix
=
lambda
x
:
x
)
site_caption_dict
[
None
]
=
default_site
...
...
@@ -1252,8 +1249,7 @@ def main():
file_count
=
len
(
infile_list
)
per_site
=
{}
if
'-'
in
args
.
state_file
and
'-'
in
infile_list
:
print
>>
sys
.
stderr
,
'stdin cannot be used both as log and state input.'
sys
.
exit
(
1
)
parser
.
error
(
'stdin cannot be used both as log and state input.'
)
loading_start_time
=
time
.
time
()
for
state_file_name
in
args
.
state_file
:
print
>>
sys
.
stderr
,
'Loading'
,
state_file_name
,
'...'
,
...
...
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