mirror of https://gitlab.com/pamhyr/pamhyr2
ListedSubWindow: Switch to logging.
parent
e925a95987
commit
c1b3d42a6a
|
|
@ -1,7 +1,10 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import logging
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
|
||||||
|
logger = logging.getLogger()
|
||||||
|
|
||||||
class ListedSubWindow(object):
|
class ListedSubWindow(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(ListedSubWindow, self).__init__()
|
super(ListedSubWindow, self).__init__()
|
||||||
|
|
@ -17,7 +20,7 @@ class ListedSubWindow(object):
|
||||||
def sub_win_add(self, name, win):
|
def sub_win_add(self, name, win):
|
||||||
self.sub_win_list.append((name, win))
|
self.sub_win_list.append((name, win))
|
||||||
self.sub_win_cnt += 1
|
self.sub_win_cnt += 1
|
||||||
print(f"+ {name} ({self.sub_win_cnt})")
|
logger.info(f"Open window: {name} ({self.sub_win_cnt})")
|
||||||
|
|
||||||
def sub_win_del(self, name):
|
def sub_win_del(self, name):
|
||||||
self.sub_win_list = list(
|
self.sub_win_list = list(
|
||||||
|
|
@ -27,7 +30,7 @@ class ListedSubWindow(object):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.sub_win_cnt = len(self.sub_win_list)
|
self.sub_win_cnt = len(self.sub_win_list)
|
||||||
print(f"- {name} ({self.sub_win_cnt})")
|
logger.info(f"Close window: {name} ({self.sub_win_cnt})")
|
||||||
|
|
||||||
def sub_win_exists(self, name):
|
def sub_win_exists(self, name):
|
||||||
return reduce(
|
return reduce(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue