Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D-GENIES
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
Container Registry
Model registry
Operate
Environments
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
genotoul-bioinfo
d-genies
D-GENIES
Commits
e2e9427e
Commit
e2e9427e
authored
7 years ago
by
Floreal Cabanettes
Browse files
Options
Downloads
Patches
Plain Diff
Add clear logs script
parent
b5c70cc6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/clear_logs.py
+20
-0
20 additions, 0 deletions
bin/clear_logs.py
srv/config_reader.py
+4
-1
4 additions, 1 deletion
srv/config_reader.py
with
24 additions
and
1 deletion
bin/clear_logs.py
0 → 100755
+
20
−
0
View file @
e2e9427e
#!/usr/bin/env python3
import
os
import
sys
from
glob
import
glob
app_folder
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))),
"
srv
"
)
sys
.
path
.
insert
(
0
,
app_folder
)
from
config_reader
import
AppConfigReader
config
=
AppConfigReader
()
if
hasattr
(
config
,
"
log_dir
"
):
log_files
=
glob
(
os
.
path
.
join
(
config
.
log_dir
,
"
*.log
"
))
for
file
in
log_files
:
os
.
remove
(
file
)
else
:
print
(
"
No log dir defined!
"
)
This diff is collapsed.
Click to expand it.
srv/config_reader.py
+
4
−
1
View file @
e2e9427e
...
...
@@ -27,7 +27,10 @@ class AppConfigReader:
for
attr
in
dir
(
self
):
attr_o
=
getattr
(
self
,
attr
)
if
attr
.
startswith
(
"
get_
"
)
and
callable
(
attr_o
):
setattr
(
self
,
attr
[
4
:],
attr_o
())
try
:
setattr
(
self
,
attr
[
4
:],
attr_o
())
except
:
pass
@staticmethod
def
replace_vars
(
path
):
...
...
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