Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Network Health
sbws
Commits
5b33d3a3
Commit
5b33d3a3
authored
Oct 16, 2018
by
juga
Browse files
Add method to remove latest link
parent
ed520c48
Changes
1
Hide whitespace changes
Inline
Side-by-side
sbws/lib/v3bwfile.py
View file @
5b33d3a3
...
...
@@ -842,6 +842,17 @@ class V3BWFile(object):
ys
=
[[
getattr
(
l
,
k
)
for
l
in
self
.
bw_lines
]
for
k
in
attrs
]
return
x
,
ys
,
attrs
def
rm_link
(
self
,
output
):
""""""
out_dir
=
os
.
path
.
dirname
(
output
)
out_link
=
os
.
path
.
join
(
out_dir
,
'latest.v3bw'
)
log
.
info
(
'Removing %s link.'
,
output
)
with
DirectoryLock
(
out_dir
):
try
:
os
.
unlink
(
out_link
)
except
FileNotFoundError
:
pass
def
write
(
self
,
output
):
if
output
==
'/dev/stdout'
:
log
.
info
(
"Writing to stdout is not supported."
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment