Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
settingsd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
settingsd
Commits
642c4574
Commit
642c4574
authored
Jan 27, 2011
by
Devaev Maxim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log exceptions at file creating in PlainConfig
parent
2ed738ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
editors.py
settingsd/tools/editors.py
+11
-7
No files found.
settingsd/tools/editors.py
View file @
642c4574
...
...
@@ -50,13 +50,17 @@ class PlainEditor(object) :
if
not
os
.
access
(
config_file_path
,
os
.
F_OK
)
:
logger
.
debug
(
"{submod}: Config file
\"
%
s
\"
does not exist"
%
(
config_file_path
))
if
sample_config_file_path
!=
None
and
os
.
access
(
sample_config_file_path
,
os
.
F_OK
)
:
shutil
.
copy2
(
sample_config_file_path
,
config_file_path
)
logger
.
debug
(
"{submod}: Config file
\"
%
s
\"
has been created from sample
\"
%
s
\"
"
%
(
config_file_path
,
sample_config_file_path
))
else
:
open
(
config_file_path
,
"w"
)
.
close
()
logger
.
debug
(
"{submod}: Created empty file
\"
%
s
\"
"
%
(
config_file_path
))
try
:
if
sample_config_file_path
!=
None
and
os
.
access
(
sample_config_file_path
,
os
.
F_OK
)
:
shutil
.
copy2
(
sample_config_file_path
,
config_file_path
)
logger
.
debug
(
"{submod}: Config file
\"
%
s
\"
has been created from sample
\"
%
s
\"
"
%
(
config_file_path
,
sample_config_file_path
))
else
:
open
(
config_file_path
,
"w"
)
.
close
()
logger
.
debug
(
"{submod}: Created empty file
\"
%
s
\"
"
%
(
config_file_path
))
except
:
logger
.
error
(
"Cannot create config file
\"
%
s
\"
"
%
(
config_file_path
))
logger
.
attachException
()
config_file
=
open
(
config_file_path
,
"r"
)
self
.
__config_file_data_list
=
config_file
.
read
()
.
split
(
"
\n
"
)
...
...
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