Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
agent
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
7
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f82c9a94
authored
Jul 24, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs in fix
parent
a38e1fe0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
notify.py
+4
-5
No files found.
notify.py
View file @
f82c9a94
...
...
@@ -98,7 +98,7 @@ def notify(url):
os
.
environ
[
"DISPLAY"
]
=
olddisplay
def
file_already_exists
(
name
):
def
file_already_exists
(
name
,
mode
=
0644
):
"""Return whether file already exists, create it if not.
Other errors are silently ignored as the file will be reopened anyways.
...
...
@@ -106,12 +106,12 @@ def file_already_exists(name):
"""
try
:
fd
=
os
_open
(
name
,
O_CREAT
|
O_EXCL
)
fd
=
os
.
open
(
name
,
os
.
O_CREAT
|
os
.
O_EXCL
,
mode
)
except
OSError
as
e
:
if
e
.
errno
==
EEXIST
:
if
e
.
errno
==
os
.
EEXIST
:
return
True
else
:
close
(
fd
)
os
.
close
(
fd
)
return
False
...
...
@@ -139,7 +139,6 @@ def search_display():
def
main
():
args
=
parse_arguments
()
notify
(
args
.
url
)
...
...
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