Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
ef6a2180
Commit
ef6a2180
authored
Nov 06, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch callback errors for settings set
parent
05bbf376
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
pronsole.py
printrun/pronsole.py
+10
-3
No files found.
printrun/pronsole.py
View file @
ef6a2180
...
...
@@ -25,6 +25,7 @@ import codecs
import
argparse
import
locale
import
logging
import
traceback
from
.
import
printcore
from
printrun.printrun_utils
import
install_locale
,
run_command
,
\
...
...
@@ -364,9 +365,15 @@ class Settings(object):
if
t
==
bool
and
value
==
"False"
:
setattr
(
self
,
key
,
False
)
else
:
setattr
(
self
,
key
,
t
(
value
))
try
:
getattr
(
self
,
"_
%
s_cb"
%
key
)(
key
,
value
)
except
AttributeError
:
pass
cb
=
None
try
:
cb
=
getattr
(
self
,
"_
%
s_cb"
%
key
)
except
AttributeError
:
pass
if
cb
is
not
None
:
cb
(
key
,
value
)
except
:
logging
.
warning
((
_
(
"Failed to run callback after setting
\"
%
s
\"
:"
)
%
key
)
+
"
\n
"
+
traceback
.
format_exc
())
return
value
def
_tabcomplete
(
self
,
key
):
...
...
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