hudman 9.0.0
Local HUD mirror manager
hudman.hud.github.HUDGitHub Class Reference
Inheritance diagram for hudman.hud.github.HUDGitHub:
hudman.hud.HUDCommon

Public Member Functions

 __init__ (self, hud)
 
str archivedir (self)
 
None archivedir (self, str value)
 
bool check (self)
 
bool download (self, str outdir)
 
str filename (self)
 
str gamename (self)
 
None gamename (self, str value)
 
str homepage (self)
 
None homepage (self, str value)
 
str hudname (self)
 
None hudname (self, str value)
 
str installdir (self)
 
None installdir (self, str value)
 
bool isupdated (self)
 
None isupdated (self, bool value)
 
int lastupdate (self)
 
None lastupdate (self, int value)
 
str mainuri (self)
 
None mainuri (self, str value)
 
str mirroruri (self)
 
None mirroruri (self, str value)
 
str repopath (self)
 
None repopath (self, str value)
 
str screenshoturi (self)
 
None screenshoturi (self, str value)
 
str sha512hash (self)
 
None sha512hash (self, str value)
 
None update (self, str outdir)
 
str upstreamuri (self)
 
None upstreamuri (self, str value)
 

Public Attributes

 archivedir = DnManager.findarchivedir(hudfile, self.archivedir)
 
 filename
 
bool isupdated = True
 
int lastupdate = self._checkresult
 
str mainuri
 
str mirroruri
 
str sha512hash = DnManager.sha512hash(hudfile)
 

Protected Member Functions

str _downloadmain (self, str outdir)
 
str _downloadmirror (self, str outdir)
 
str _downloadupstream (self, str outdir)
 
str _genmainuri (self, str filename)
 
str _genmirroruri (self, str filename)
 
int _updatecheck (self)
 

Protected Attributes

str _apiurl
 
 _archivedir = hud.getElementsByTagName('ArchiveDir')[0].firstChild
 
int _checkresult = self._updatecheck()
 
 _gamename = hud.getElementsByTagName('Game')[0].firstChild
 
 _ghtoken
 
 _ghuser = Settings.github_user
 
 _homepage = hud.getElementsByTagName('Site')[0].firstChild
 
 _hudname = hud.getElementsByTagName('Name')[0].firstChild
 
 _installdir = hud.getElementsByTagName('InstallDir')[0].firstChild
 
 _isupdated = hud.getElementsByTagName('IsUpdated')[0].firstChild
 
 _lastupdate = hud.getElementsByTagName('LastUpdate')[0].firstChild
 
 _mainuri = hud.getElementsByTagName('URI')[0].firstChild
 
 _mirroruri = hud.getElementsByTagName('Mirror')[0].firstChild
 
 _repopath = hud.getElementsByTagName('RepoPath')[0].firstChild
 
 _screenshot = hud.getElementsByTagName('Preview')[0].firstChild
 
 _sha512hash = hud.getElementsByTagName('Hash2')[0].firstChild
 
 _upstreamuri = hud.getElementsByTagName('UpURI')[0].firstChild
 

Detailed Description

Class for working with HUDs hosted on GitHub.

Constructor & Destructor Documentation

◆ __init__()

hudman.hud.github.HUDGitHub.__init__ ( self,
hud )
Main constructor of the HUDGitHub class.
:param hud: A single entry from the HUD database.

Member Function Documentation

◆ _downloadmain()

str hudman.hud.HUDCommon._downloadmain ( self,
str outdir )
protectedinherited
Download HUD to the output directory using main URI.
:param outdir: Output directory.
:return: Absolute path of the downloaded HUD file.
:rtype: str

◆ _downloadmirror()

str hudman.hud.HUDCommon._downloadmirror ( self,
str outdir )
protectedinherited
Download HUD to the output directory using mirror URI.
:param outdir: Output directory.
:return: Absolute path of the downloaded HUD file.
:rtype: str

◆ _downloadupstream()

str hudman.hud.HUDCommon._downloadupstream ( self,
str outdir )
protectedinherited
Download HUD to the output directory using upstream URI.
:param outdir: Output directory.
:return: Absolute path of the downloaded HUD file.
:rtype: str

◆ _genmainuri()

str hudman.hud.HUDCommon._genmainuri ( self,
str filename )
protectedinherited
Generate a new URI for the main download.
:param filename: Downloaded archive file name.
:return: Fully-qualified main URI.
:rtype: str

◆ _genmirroruri()

str hudman.hud.HUDCommon._genmirroruri ( self,
str filename )
protectedinherited
Generate a new URI for the mirror download.
:param filename: Downloaded archive file name.
:return: Fully-qualified mirror URI.
:rtype: str

◆ _updatecheck()

int hudman.hud.github.HUDGitHub._updatecheck ( self)
protected
Call GitHub API and fetch last modification time of the
specified HUD.
:return: Last modification time in the unixtime format.
:rtype: int

Reimplemented from hudman.hud.HUDCommon.

◆ archivedir() [1/2]

str hudman.hud.HUDCommon.archivedir ( self)
inherited
Get actual archive dir inside archive.
:return: Archive directory name.

◆ archivedir() [2/2]

None hudman.hud.HUDCommon.archivedir ( self,
str value )
inherited
Set actual archive dir inside archive.
:param value: Archive directory name.

◆ check()

bool hudman.hud.HUDCommon.check ( self)
inherited
Check for the HUD updates.
:return: Return True if the new version is available.
:rtype: bool

◆ download()

bool hudman.hud.HUDCommon.download ( self,
str outdir )
inherited
Download current version of the specified HUD.
:param outdir: Output directory.
:return: Return True if the specified HUD was downloaded successfully.
:rtype: bool

◆ filename()

str hudman.hud.HUDCommon.filename ( self)
inherited
Get final download filename for HUD.
:return: Download filename for HUD.

◆ gamename() [1/2]

str hudman.hud.HUDCommon.gamename ( self)
inherited
Get HUD's game name.
:return: Game name.

◆ gamename() [2/2]

None hudman.hud.HUDCommon.gamename ( self,
str value )
inherited
Set HUD's game name.
:param value: Game name.

◆ homepage() [1/2]

str hudman.hud.HUDCommon.homepage ( self)
inherited
Get homepage of HUD.
:return: Homepage of HUD.

◆ homepage() [2/2]

None hudman.hud.HUDCommon.homepage ( self,
str value )
inherited
Set homepage of HUD.
:param value: Homepage of HUD.

◆ hudname() [1/2]

str hudman.hud.HUDCommon.hudname ( self)
inherited
Get user friendly HUD name.
:return: HUD name.

◆ hudname() [2/2]

None hudman.hud.HUDCommon.hudname ( self,
str value )
inherited
Set user friendly HUD name.
:param value: HUD name.

◆ installdir() [1/2]

str hudman.hud.HUDCommon.installdir ( self)
inherited
Get installation directory of HUD.
:return: HUD installation directory.

◆ installdir() [2/2]

None hudman.hud.HUDCommon.installdir ( self,
str value )
inherited
Set installation directory of HUD.
:param value: HUD installation directory.

◆ isupdated() [1/2]

bool hudman.hud.HUDCommon.isupdated ( self)
inherited
Check if current HUD is up to date.
:return: Update result.

◆ isupdated() [2/2]

None hudman.hud.HUDCommon.isupdated ( self,
bool value )
inherited
Set if current HUD is up to date.
:param value: Update result.

◆ lastupdate() [1/2]

int hudman.hud.HUDCommon.lastupdate ( self)
inherited
Get last update time in Unixtime format.
:return: Last update time.

◆ lastupdate() [2/2]

None hudman.hud.HUDCommon.lastupdate ( self,
int value )
inherited
Set last update time in Unixtime format.
:param value: Last update time.

◆ mainuri() [1/2]

str hudman.hud.HUDCommon.mainuri ( self)
inherited
Get main local mirror URI.
:return: Main local mirror URI.

◆ mainuri() [2/2]

None hudman.hud.HUDCommon.mainuri ( self,
str value )
inherited
Set main local mirror URI.
:param value: Main local mirror URI.

◆ mirroruri() [1/2]

str hudman.hud.HUDCommon.mirroruri ( self)
inherited
Get local secondary server URI.
:return: Mirror URI.

◆ mirroruri() [2/2]

None hudman.hud.HUDCommon.mirroruri ( self,
str value )
inherited
Set local secondary server URI.
:param value: Mirror URI.

◆ repopath() [1/2]

str hudman.hud.HUDCommon.repopath ( self)
inherited
Get upstream repository URL.
:return: Upstream repository URL.

◆ repopath() [2/2]

None hudman.hud.HUDCommon.repopath ( self,
str value )
inherited
Set upstream repository URL.
:param value: Upstream repository URL.

◆ screenshoturi() [1/2]

str hudman.hud.HUDCommon.screenshoturi ( self)
inherited
Get screenshot URI.
:return: Screenshot URI.

◆ screenshoturi() [2/2]

None hudman.hud.HUDCommon.screenshoturi ( self,
str value )
inherited
Set screenshot URI.
:param value: Screenshot URI.

◆ sha512hash() [1/2]

str hudman.hud.HUDCommon.sha512hash ( self)
inherited
Get SHA-512 hash sum of HUD file.
:return: SHA-512 hash sum of HUD file.

◆ sha512hash() [2/2]

None hudman.hud.HUDCommon.sha512hash ( self,
str value )
inherited
Set SHA-512 hash sum of HUD file.
:param value: SHA-512 hash sum of HUD file.

◆ update()

None hudman.hud.HUDCommon.update ( self,
str outdir )
inherited
Download the latest version of the specified HUD.
:param outdir: Output directory.

Reimplemented in hudman.hud.other.HUDOther.

◆ upstreamuri() [1/2]

str hudman.hud.HUDCommon.upstreamuri ( self)
inherited
Get upstream URI.
:return: Upstream URI.

◆ upstreamuri() [2/2]

None hudman.hud.HUDCommon.upstreamuri ( self,
str value )
inherited
Set upstream URI.
:param value: Upstream URI.

Member Data Documentation

◆ _apiurl

str hudman.hud.github.HUDGitHub._apiurl
protected
Initial value:
= self.repopath.replace('https://github.com/',
'https://api.github.com/repos/') + '/commits?per_page=1'