File tree Expand file tree Collapse file tree
gui/Controls/ControlPlayer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # !/usr/bin/python3
2+ # -*- coding: utf-8 -*-
3+
4+ """ pyForms
5+
6+ """
7+ import logging
8+
9+ __author__ = "Ricardo Ribeiro"
10+ __copyright__ = "Copyright 2016 Champalimaud Foundation"
11+ __credits__ = "Ricardo Ribeiro"
12+ __license__ = "MIT"
13+ __maintainer__ = ["Ricardo Ribeiro" , "Carlos Mão de Ferro" ]
14+ __email__ = ["ricardojvr at gmail.com" , "cajomferro at gmail.com" ]
15+ __status__ = "Development"
116
217PYFORMS_MODE = 'GUI'
18+ PYFORMS_LOG_LEVEL = logging .INFO
19+
20+ def setup_pyforms_logger ():
21+ """ Setup logger for this app """
22+ # create logger
23+ logger = logging .getLogger ('pyforms' )
24+ logger .setLevel (PYFORMS_LOG_LEVEL )
25+
26+ # create file handler which logs even debug messages
27+ # fh = logging.FileHandler('{0}.log'.format(APP_NAME))
28+ # fh.setLevel(logging.DEBUG)
29+ # create console handler with a higher log level
30+ ch = logging .StreamHandler ()
31+ ch .setLevel (PYFORMS_LOG_LEVEL )
332
33+ # create formatter and add it to the handlers
34+ formatter = logging .Formatter ('%(asctime)s | %(levelname)s | %(name)s | %(module)s | %(message)s' , datefmt = '%d/%m/%Y %I:%M:%S' )
35+ # fh.setFormatter(formatter)
36+ ch .setFormatter (formatter )
37+
38+ # add the handlers to the logger
39+ # logger.addHandler(fh)
40+ logger .addHandler (ch )
441
542try :
643 from settings import *
744except :
845 pass
46+
47+ setup_pyforms_logger ()
48+
49+
Original file line number Diff line number Diff line change 77
88import math
99import os
10+ import logging
1011from PyQt4 import uic
1112from PyQt4 import QtCore , QtGui
1213from pyforms .gui .Controls .ControlBase import ControlBase
@@ -38,7 +39,8 @@ class ControlPlayer(ControlBase, QtGui.QFrame):
3839 def __init__ (self , * args ):
3940 QtGui .QFrame .__init__ (self )
4041 ControlBase .__init__ (self , * args )
41-
42+
43+ self .logger = logging .getLogger ('pyforms' )
4244
4345 def initForm (self ):
4446 # Get the current path of the file
@@ -272,8 +274,7 @@ def value(self, value):
272274 self ._value = value
273275
274276 self .fps = self ._value .get (5 )
275- print ("Open video with" , self ._value .get ( 5 ), 'fps' )
276-
277+ self .logger .debug ("Open video with %s fps" , '{0}' .format (self ._value .get ( 5 )))
277278
278279 if self ._value and value != 0 :
279280 self .videoProgress .setMinimum (0 )
Original file line number Diff line number Diff line change 1515setup (
1616
1717 name = 'PyForms' ,
18- version = '0.1.4' ,
18+ version = '0.1.4.dev0 ' ,
1919 description = """Pyforms is a Python 2.7 and 3.0 framework to develop GUI application,
2020 which promotes modular software design and code reusability with minimal effort.""" ,
2121 author = 'Ricardo Ribeiro' ,
You can’t perform that action at this time.
0 commit comments