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 
common.utilities.deAccent
def deAccent(str)
Definition: utilities.py:22
common.utilities.convert_etree
def convert_etree(etostr)
Definition: utilities.py:25
common.utilities.Lyrics.lyrics
lyrics
Definition: utilities.py:17
common.utilities.Lyrics.syncronized
syncronized
Definition: utilities.py:20
common.utilities.Lyrics.source
source
Definition: utilities.py:18
print
static void print(const QList< uint > &raw_minimas, const QList< uint > &raw_maximas, const QList< float > &minimas, const QList< float > &maximas)
Definition: vbi608extractor.cpp:30
musicbrainzngs.compat.unicode
unicode
Definition: compat.py:50
common.utilities.Lyrics.artist
artist
Definition: utilities.py:13
common.utilities.Lyrics.album
album
Definition: utilities.py:14
common.utilities.Lyrics.filename
filename
Definition: utilities.py:16
common.utilities.log
def log(debug, txt)
Definition: utilities.py:7
common.utilities.Lyrics.title
title
Definition: utilities.py:15
common.utilities.Lyrics.list
list
Definition: utilities.py:19
return
return
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1247
common.utilities.Lyrics
Definition: utilities.py:11
common.utilities.Lyrics.__init__
def __init__(self)
Definition: utilities.py:12