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
Labels
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
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():
...
@@ -1180,14 +1180,12 @@ def main():
elif
DURATION_S_FORMAT
in
args
.
logformat
:
elif
DURATION_S_FORMAT
in
args
.
logformat
:
getDuration
=
lambda
x
:
int
(
x
.
group
(
'duration_s'
))
*
US_PER_S
getDuration
=
lambda
x
:
int
(
x
.
group
(
'duration_s'
))
*
US_PER_S
else
:
else
:
print
>>
sys
.
stderr
,
'Neither %D nor %T are present in logformat, apdex '
\
parser
.
error
(
'Neither %D nor %T are present in logformat, apdex '
'cannot be computed.'
'cannot be computed.'
)
sys
.
exit
(
1
)
if
args
.
match_servername
is
not
None
and
\
if
args
.
match_servername
is
not
None
and
\
args
.
match_servername
not
in
args
.
logformat
:
args
.
match_servername
not
in
args
.
logformat
:
print
>>
sys
.
stderr
,
'--match-servername %s requested, but missing '
\
parser
.
error
(
'--match-servername %s requested, but missing '
'from logformat.'
%
args
.
match_servername
'from logformat.'
%
args
.
match_servername
)
sys
.
exit
(
1
)
get_url_prefix
=
server_name_group_dict
.
get
(
args
.
match_servername
,
get_url_prefix
=
server_name_group_dict
.
get
(
args
.
match_servername
,
lambda
_
:
''
)
lambda
_
:
''
)
line_regex
=
''
line_regex
=
''
...
@@ -1239,9 +1237,8 @@ def main():
...
@@ -1239,9 +1237,8 @@ def main():
if
default_site
is
None
:
if
default_site
is
None
:
default_action
=
None
default_action
=
None
if
not
[
None
for
_
,
_
,
x
in
site_list
if
x
is
not
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 '
\
parser
.
error
(
'None of --default, --erp5-base and --base were '
'specified, nothing to do.'
'specified, nothing to do.'
)
sys
.
exit
(
1
)
else
:
else
:
default_action
=
partial
(
GenericSiteStats
,
suffix
=
lambda
x
:
x
)
default_action
=
partial
(
GenericSiteStats
,
suffix
=
lambda
x
:
x
)
site_caption_dict
[
None
]
=
default_site
site_caption_dict
[
None
]
=
default_site
...
@@ -1252,8 +1249,7 @@ def main():
...
@@ -1252,8 +1249,7 @@ def main():
file_count
=
len
(
infile_list
)
file_count
=
len
(
infile_list
)
per_site
=
{}
per_site
=
{}
if
'-'
in
args
.
state_file
and
'-'
in
infile_list
:
if
'-'
in
args
.
state_file
and
'-'
in
infile_list
:
print
>>
sys
.
stderr
,
'stdin cannot be used both as log and state input.'
parser
.
error
(
'stdin cannot be used both as log and state input.'
)
sys
.
exit
(
1
)
loading_start_time
=
time
.
time
()
loading_start_time
=
time
.
time
()
for
state_file_name
in
args
.
state_file
:
for
state_file_name
in
args
.
state_file
:
print
>>
sys
.
stderr
,
'Loading'
,
state_file_name
,
'...'
,
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