MythTV  master
utilities.py
Go to the documentation of this file.
1 import sys
2 import os
3 import unicodedata
4 
5 IS_PY2 = sys.version_info[0] == 2
6 
7 def log(debug, txt):
8  if debug:
9  print(txt)
10 
11 class Lyrics:
12  def __init__(self):
13  self.artist = ""
14  self.album = ""
15  self.title = ""
16  self.filename = ""
17  self.lyrics = ""
18  self.source = ""
19  self.list = None
20  self.syncronized = False
21 
22 def deAccent(str):
23  return unicodedata.normalize('NFKD', unicode(str, 'utf-8'))
24 
25 def convert_etree(etostr):
26  """lxml.etree.tostring is a bytes object in python3, and a str in python2.
27  """
28  if IS_PY2:
29  return(etostr)
30  else:
31  return(etostr.decode())
32 
static void print(const QList< uint > &raw_minimas, const QList< uint > &raw_maximas, const QList< float > &minimas, const QList< float > &maximas)
def convert_etree(etostr)
Definition: utilities.py:25
def log(debug, txt)
Definition: utilities.py:7
def deAccent(str)
Definition: utilities.py:22