MythTV  master
Public Member Functions | Public Attributes | List of all members
giantbomb.giantbomb_api.gamedbQueries Class Reference

Public Member Functions

def __init__ (self, apikey, debug=False)
 
def massageText (self, text)
 
def textUtf8 (self, text)
 
def ampReplace (self, text)
 
def htmlToString (self, context, html)
 
def getHtmlData (self, context, *args)
 
def pubDate (self, context, *inputArgs)
 
def futureReleaseDate (self, context, gameElement)
 
def findImages (self, context, *args)
 
def getImages (self, context, arg)
 
def supportedJobs (self, context, *inputArgs)
 
def translateName (self, context, *inputArgs)
 
def buildFuncDict (self)
 
def gameSearch (self, gameTitle)
 
def gameData (self, gameId)
 

Public Attributes

 config
 
 error_messages
 
 baseProcessingDir
 
 pubDateFormat
 
 xmlParser
 
 supportedJobList
 
 tagTranslations
 
 imageElements
 
 FuncDict
 

Detailed Description

Methods that query api.giantbomb.com for metadata and outputs the results to stdout any errors are output
to stderr.

Definition at line 85 of file giantbomb_api.py.

Constructor & Destructor Documentation

◆ __init__()

def giantbomb.giantbomb_api.gamedbQueries.__init__ (   self,
  apikey,
  debug = False 
)
apikey (str/unicode):
    Specify the api.giantbomb.com API key. Applications need their own key.
    See http://api.giantbomb.com to get your own API key

debug (True/False):
     shows verbose debugging information

Definition at line 89 of file giantbomb_api.py.

Member Function Documentation

◆ massageText()

def giantbomb.giantbomb_api.gamedbQueries.massageText (   self,
  text 
)
Removes HTML markup from a text string.
@param text The HTML source.
@return The plain text.  If the HTML source contains non-ASCII
entities or character references, this is a Unicode string.

Definition at line 135 of file giantbomb_api.py.

Referenced by giantbomb.giantbomb_api.gamedbQueries.htmlToString().

◆ textUtf8()

def giantbomb.giantbomb_api.gamedbQueries.textUtf8 (   self,
  text 
)

◆ ampReplace()

def giantbomb.giantbomb_api.gamedbQueries.ampReplace (   self,
  text 
)
Replace all "&" characters with "&"

Definition at line 181 of file giantbomb_api.py.

Referenced by giantbomb.giantbomb_api.gamedbQueries.massageText().

◆ htmlToString()

def giantbomb.giantbomb_api.gamedbQueries.htmlToString (   self,
  context,
  html 
)
 Remove HTML tags and LFs from a string
return the string without HTML tags or LFs

Definition at line 189 of file giantbomb_api.py.

◆ getHtmlData()

def giantbomb.giantbomb_api.gamedbQueries.getHtmlData (   self,
  context,
args 
)
 Take a HTML string and convert it to an HTML element. Then apply a filter and return
the results.
return filter array
return an empty array if the filter failed to find any values.

Definition at line 198 of file giantbomb_api.py.

◆ pubDate()

def giantbomb.giantbomb_api.gamedbQueries.pubDate (   self,
  context,
inputArgs 
)
Convert a date/time string in a specified format into a pubDate. The default is the
MNV item format
return the formatted pubDate string
return on error return the original date string

Definition at line 224 of file giantbomb_api.py.

◆ futureReleaseDate()

def giantbomb.giantbomb_api.gamedbQueries.futureReleaseDate (   self,
  context,
  gameElement 
)
Convert the "expected" release date into the default MNV item format.
return the formatted pubDate string
return If there is not enough information to make a date then return an empty string

Definition at line 265 of file giantbomb_api.py.

◆ findImages()

def giantbomb.giantbomb_api.gamedbQueries.findImages (   self,
  context,
args 
)
Parse the "image" and "description" elements for images and put in a persistant array
return True when there are images available
return False if there are no images

Definition at line 298 of file giantbomb_api.py.

◆ getImages()

def giantbomb.giantbomb_api.gamedbQueries.getImages (   self,
  context,
  arg 
)
Return an array of image elements that was created be a previous "findImages" function call
return the array of image elements

Definition at line 342 of file giantbomb_api.py.

◆ supportedJobs()

def giantbomb.giantbomb_api.gamedbQueries.supportedJobs (   self,
  context,
inputArgs 
)
Validate that the job category is supported by the
Universal Metadata Format item format
return True is supported
return False if not supported

Definition at line 349 of file giantbomb_api.py.

◆ translateName()

def giantbomb.giantbomb_api.gamedbQueries.translateName (   self,
  context,
inputArgs 
)
Translate a tag name into the Universal Metadata Format item equivalent
return the translated tag equivalent
return the input name as the name does not need translating and is already been validated

Definition at line 365 of file giantbomb_api.py.

◆ buildFuncDict()

def giantbomb.giantbomb_api.gamedbQueries.buildFuncDict (   self)
 Build a dictionary of the XPath extention function for the XSLT stylesheets
Returns nothing

Definition at line 377 of file giantbomb_api.py.

Referenced by giantbomb.giantbomb_api.gamedbQueries.gameData(), and giantbomb.giantbomb_api.gamedbQueries.gameSearch().

◆ gameSearch()

def giantbomb.giantbomb_api.gamedbQueries.gameSearch (   self,
  gameTitle 
)
Display a Game query in XML format:
http://www.mythtv.org/wiki/MythTV_Universal_Metadata_Format
Returns nothing

Definition at line 394 of file giantbomb_api.py.

◆ gameData()

def giantbomb.giantbomb_api.gamedbQueries.gameData (   self,
  gameId 
)
Display a Game details in XML format:
http://www.mythtv.org/wiki/MythTV_Universal_Metadata_Format
Returns nothing

Definition at line 425 of file giantbomb_api.py.

Member Data Documentation

◆ config

giantbomb.giantbomb_api.gamedbQueries.config

◆ error_messages

giantbomb.giantbomb_api.gamedbQueries.error_messages

Definition at line 105 of file giantbomb_api.py.

◆ baseProcessingDir

giantbomb.giantbomb_api.gamedbQueries.baseProcessingDir

◆ pubDateFormat

giantbomb.giantbomb_api.gamedbQueries.pubDateFormat

Definition at line 109 of file giantbomb_api.py.

Referenced by giantbomb.giantbomb_api.gamedbQueries.pubDate().

◆ xmlParser

giantbomb.giantbomb_api.gamedbQueries.xmlParser

◆ supportedJobList

giantbomb.giantbomb_api.gamedbQueries.supportedJobList

◆ tagTranslations

giantbomb.giantbomb_api.gamedbQueries.tagTranslations

◆ imageElements

giantbomb.giantbomb_api.gamedbQueries.imageElements

Definition at line 315 of file giantbomb_api.py.

Referenced by giantbomb.giantbomb_api.gamedbQueries.getImages().

◆ FuncDict

giantbomb.giantbomb_api.gamedbQueries.FuncDict

The documentation for this class was generated from the following file: