Browse Source

Replace logging with better logger

master
Nils 4 years ago
parent
commit
1ab9ffd348
  1. 1
      engine/__init__.py
  2. 2
      engine/api.py
  3. 2
      engine/block.py
  4. 10
      engine/ccsubtrack.py
  5. 2
      engine/cursor.py
  6. 2
      engine/items.py
  7. 2
      engine/lilypond.py
  8. 2
      engine/main.py
  9. 2
      engine/tempotrack.py
  10. 2
      engine/track.py
  11. 2
      qtgui/conductor.py
  12. 2
      qtgui/constantsAndConfigs.py
  13. 2
      qtgui/cursor.py
  14. 2
      qtgui/graphs.py
  15. 4
      qtgui/grid.py
  16. 3
      qtgui/items.py
  17. 2
      qtgui/mainwindow.py
  18. 2
      qtgui/menu.py
  19. 2
      qtgui/musicstructures.py
  20. 2
      qtgui/scorescene.py
  21. 2
      qtgui/scoreview.py
  22. 2
      qtgui/submenus.py
  23. 2
      qtgui/trackEditor.py
  24. 1
      template/qtgui/debugScript.py

1
engine/__init__.py

@ -20,7 +20,6 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
#This file only exists as a reminder to _not_ create it again wrongly in the future.

2
engine/api.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Python Standard Library
import sys

2
engine/block.py

@ -19,6 +19,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logger = logging.getLogger(__name__); logger.info("import")
from weakref import WeakSet
from weakref import ref as weakref_ref
from .items import * #loading from file needs all items.

10
engine/ccsubtrack.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Standard Library Modules
from weakref import WeakValueDictionary, WeakSet
@ -469,13 +469,13 @@ class GraphTrackCC(object):
block = graphBlock
if len(self.blocks) == 1:
logging.info("CC Block merge aborted: only one block in the track")
logger.info("CC Block merge aborted: only one block in the track")
return False
blockIndex = self.blocks.index(block)
if blockIndex+1 == len(self.blocks):
logging.info("CC Block merge aborted: not for the last block")
logger.info("CC Block merge aborted: not for the last block")
return False
nextIndex = blockIndex + 1
@ -505,10 +505,10 @@ class GraphTrackCC(object):
#Further testing required:
for firstBlock, secondBlock in zip(block.linkedContentBlocksInScore(), nextBlock.linkedContentBlocksInScore()):
if firstBlock.data is secondBlock.data: #content link of itself in succession. Very common usecase, but not compatible with merging.
logging.info("CC Block merge aborted: content link follows itself")
logger.info("CC Block merge aborted: content link follows itself")
return False
elif not self.blocks.index(firstBlock) + 1 == self.blocks.index(secondBlock): #all first blocks must be followed directly by a content link of the second block. linkedContentBlocksInScore() returns a blocklist in order so we can compare.
logging.info("CC Block merge aborted: not all content link blocks-pairs are next to each other")
logger.info("CC Block merge aborted: not all content link blocks-pairs are next to each other")
return False
#Test complete without exit. All blocks can be paired up.

2
engine/cursor.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Standard Library Modules

2
engine/items.py

@ -18,7 +18,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Standard Library Modules
from collections import deque

2
engine/lilypond.py

@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Use generated music data and build a complete lilypond file from it"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Standard Library Modules
import os.path

2
engine/main.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Standar Library
import sys

2
engine/tempotrack.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Standard Library Modules
from weakref import WeakValueDictionary, WeakSet

2
engine/track.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Standard Library Modules
from weakref import WeakKeyDictionary, WeakValueDictionary

2
qtgui/conductor.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
from PyQt5 import QtCore, QtGui, QtSvg, QtWidgets
from .constantsAndConfigs import constantsAndConfigs

2
qtgui/constantsAndConfigs.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
from template.qtgui.constantsAndConfigs import ConstantsAndConfigs as TemplateConstantsAndConfigs

2
qtgui/cursor.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
from PyQt5 import QtCore, QtGui, QtWidgets, QtWidgets
from .constantsAndConfigs import constantsAndConfigs

2
qtgui/graphs.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
from PyQt5 import QtCore, QtGui, QtSvg, QtWidgets
from .constantsAndConfigs import constantsAndConfigs
from template.qtgui.helper import stringToColor, removeInstancesFromScene, callContextMenu, stretchLine, stretchRect

4
qtgui/grid.py

@ -20,7 +20,9 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
#Standar Library
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Standard Library
#Third Party
from PyQt5 import QtCore, QtGui, QtWidgets

3
qtgui/items.py

@ -20,7 +20,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
from PyQt5 import QtCore, QtGui, QtSvg, QtWidgets
from itertools import groupby
from engine.items import Chord, KeySignature

2
qtgui/mainwindow.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Standard Library Modules
import os.path

2
qtgui/menu.py

@ -20,6 +20,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Standard Library Modules
import os.path
from pathlib import Path

2
qtgui/musicstructures.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Standard Library
from math import log

2
qtgui/scorescene.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Standard Library

2
qtgui/scoreview.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Third Party

2
qtgui/submenus.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Standard Library
from sys import maxsize

2
qtgui/trackEditor.py

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Standard Library

1
template/qtgui/debugScript.py

@ -25,7 +25,6 @@ import logging; logger = logging.getLogger(__name__); logger.info("import")
import os.path
#from code import InteractiveInterpreter
import logging
import engine.api as api
class DebugScriptRunner(object):

Loading…
Cancel
Save