Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Warden Connectors
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
713
Warden
Warden Connectors
Commits
1d673a65
Commit
1d673a65
authored
7 years ago
by
Pavel Eis
Browse files
Options
Downloads
Patches
Plain Diff
changes in Tipping point connector - little reorganisation of cone in main
parent
a5a7a80e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hp-tipping-point/tpToIdea.py
+36
-39
36 additions, 39 deletions
hp-tipping-point/tpToIdea.py
with
36 additions
and
39 deletions
hp-tipping-point/tpToIdea.py
+
36
−
39
View file @
1d673a65
...
...
@@ -403,52 +403,49 @@ def reload_me(signum, frame):
def
main
():
global
running_flag
global
reload_flag
logging
.
basicConfig
(
format
=
'
%(levelname)s:%(message)s
'
,
level
=
logging
.
DEBUG
,
filename
=
'
tipping_point_
daemon_
log.log
'
,
filemode
=
'
w
'
)
logging
.
basicConfig
(
format
=
'
%(levelname)s:%(message)s
'
,
level
=
logging
.
DEBUG
,
filename
=
'
tipping_point_log.log
'
,
filemode
=
'
w
'
)
optp
=
get_args
()
opts
,
args
=
optp
.
parse_args
()
if
not
args
or
opts
.
name
is
None
or
opts
.
dir
is
None
:
optp
.
print_help
()
sys
.
exit
()
try
:
if
opts
.
oneshot
:
signal
.
signal
(
signal
.
SIGINT
,
terminate_me
)
signal
.
signal
(
signal
.
SIGTERM
,
terminate_me
)
files
=
[
open
(
arg
)
for
arg
in
args
]
else
:
daemonize
(
pidfile
=
opts
.
pid
,
uid
=
opts
.
uid
,
gid
=
opts
.
gid
,
signals
=
{
signal
.
SIGINT
:
terminate_me
,
signal
.
SIGTERM
:
terminate_me
,
signal
.
SIGHUP
:
reload_me
})
files
=
[
FileWatcher
(
arg
)
for
arg
in
args
]
filer
=
Filer
(
opts
.
dir
)
idea_gen
=
IdeaGen
(
opts
.
name
,
opts
.
test
)
while
running_flag
:
for
log_file
in
files
:
while
True
:
line
=
log_file
.
readline
()
if
line
is
None
or
not
line
.
strip
():
logging
.
info
(
"
no line
"
)
break
logging
.
info
(
"
readline
"
)
process_data
(
line
,
filer
,
opts
.
origdata
,
idea_gen
)
if
not
running_flag
:
if
opts
.
oneshot
:
signal
.
signal
(
signal
.
SIGINT
,
terminate_me
)
signal
.
signal
(
signal
.
SIGTERM
,
terminate_me
)
files
=
[
open
(
arg
)
for
arg
in
args
]
else
:
daemonize
(
pidfile
=
opts
.
pid
,
uid
=
opts
.
uid
,
gid
=
opts
.
gid
,
signals
=
{
signal
.
SIGINT
:
terminate_me
,
signal
.
SIGTERM
:
terminate_me
,
signal
.
SIGHUP
:
reload_me
})
files
=
[
FileWatcher
(
arg
)
for
arg
in
args
]
filer
=
Filer
(
opts
.
dir
)
idea_gen
=
IdeaGen
(
opts
.
name
,
opts
.
test
)
while
running_flag
:
for
log_file
in
files
:
while
True
:
line
=
log_file
.
readline
()
if
line
is
None
or
not
line
.
strip
():
logging
.
info
(
"
no line
"
)
break
if
reload_flag
:
for
f
in
files
:
f
.
close
()
f
.
open
()
reload_flag
=
False
if
opts
.
oneshot
:
logging
.
info
(
"
readline
"
)
process_data
(
line
,
filer
,
opts
.
origdata
,
idea_gen
)
if
not
running_flag
:
break
else
:
time
.
sleep
(
opts
.
poll
)
except
Exception
as
e
:
logging
.
exception
(
e
)
if
reload_flag
:
for
f
in
files
:
f
.
close
()
f
.
open
()
reload_flag
=
False
if
opts
.
oneshot
:
break
else
:
time
.
sleep
(
opts
.
poll
)
if
__name__
==
"
__main__
"
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment