mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Make python console less noisy without --debug.
This commit is contained in:
parent
71eae1f223
commit
5adf54a5ec
@ -1,14 +1,13 @@
|
|||||||
import sys
|
import sys
|
||||||
import gnucash._sw_app_utils as _sw_app_utils
|
import gnucash._sw_app_utils as _sw_app_utils
|
||||||
from gnucash import *
|
from gnucash import *
|
||||||
from gnucash._sw_core_utils import gnc_prefs_is_extra_enabled
|
from gnucash._sw_core_utils import gnc_prefs_is_extra_enabled, gnc_prefs_is_debugging_enabled
|
||||||
from gi import require_version
|
from gi import require_version
|
||||||
require_version('Gtk', '3.0')
|
require_version('Gtk', '3.0')
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
import os
|
import os
|
||||||
sys.path.append(os.path.dirname(__file__))
|
sys.path.append(os.path.dirname(__file__))
|
||||||
noisy = gnc_prefs_is_extra_enabled()
|
if gnc_prefs_is_extra_enabled():
|
||||||
if noisy:
|
|
||||||
print("woop", os.path.dirname(__file__))
|
print("woop", os.path.dirname(__file__))
|
||||||
# Importing the console class causes SIGTTOU to be thrown if GnuCash is
|
# Importing the console class causes SIGTTOU to be thrown if GnuCash is
|
||||||
# started in the background. This causes a hang if it is not handled,
|
# started in the background. This causes a hang if it is not handled,
|
||||||
@ -21,7 +20,7 @@ import pycons.console as cons
|
|||||||
# Restore the SIGTTOU handler
|
# Restore the SIGTTOU handler
|
||||||
signal.signal(signal.SIGTTOU, old_sigttou)
|
signal.signal(signal.SIGTTOU, old_sigttou)
|
||||||
|
|
||||||
if noisy:
|
if gnc_prefs_is_extra_enabled() and gnc_prefs_is_debugging_enabled():
|
||||||
print("Hello from python!")
|
print("Hello from python!")
|
||||||
print("test", sys.modules.keys())
|
print("test", sys.modules.keys())
|
||||||
print("test2", dir(_sw_app_utils))
|
print("test2", dir(_sw_app_utils))
|
||||||
|
Loading…
Reference in New Issue
Block a user