hudman 8.0.0
Local HUD mirror manager
hudman.dnmanager.DnManager Class Reference

Static Public Member Functions

str downloadfile (str url, str name, str outdir)
 
str findarchivedir (str fname, str archivedir)
 
str findrealurl (str url, int depth=5)
 
str renamefile (str fname, str nfname)
 
str renamefilehash (str fname, str chash)
 
str sha256hash (str fname)
 
str sha512hash (str fname)
 

Detailed Description

Static class with methods for working with HUD downloads.

Member Function Documentation

◆ downloadfile()

str hudman.dnmanager.DnManager.downloadfile ( str  url,
str  name,
str  outdir 
)
static
Download HUD archive file from the Internet and save it to the specified
directory.
:param url: URL of the remote file.
:param name: HUD directory name.
:param outdir: Output directory.
:return: Full local path of the downloaded file.
:rtype: str

◆ findarchivedir()

str hudman.dnmanager.DnManager.findarchivedir ( str  fname,
str  archivedir 
)
static
Open downloaded archive and find the base directory with HUD files.
:param fname: Archive file name.
:param archivedir: Current directory path.
:exception ArchiveNotValid: Downloaded archive validation failed.
:return: Base directory relative path.
:rtype: str

◆ findrealurl()

str hudman.dnmanager.DnManager.findrealurl ( str  url,
int   depth = 5 
)
static
Recursively follow redirects and find the real URL.
:param url: Current URL.
:param depth: Maximum recursion depth.
:return: URL after the all redirects.
:rtype: str

◆ renamefile()

str hudman.dnmanager.DnManager.renamefile ( str  fname,
str  nfname 
)
static
Rename file with specified name.
:param fname: Full path to the source file.
:param nfname: New file name.
:return: Full local path of the renamed file.
:rtype: str

◆ renamefilehash()

str hudman.dnmanager.DnManager.renamefilehash ( str  fname,
str  chash 
)
static
Rename file using its hash.
:param fname: Source file name.
:param chash: Source file hash sum.
:return: Full local path of the renamed file.
:rtype: str

◆ sha256hash()

str hudman.dnmanager.DnManager.sha256hash ( str  fname)
static
Calculate SHA-256 hash sum of the specified file.
:param fname: Source file name.
:return: SHA1 hash of the source file.
:rtype: str

◆ sha512hash()

str hudman.dnmanager.DnManager.sha512hash ( str  fname)
static
Calculate SHA-512 hash sum of the specified file.
:param fname: Source file name.
:return: SHA-512 hash of the source file.
:rtype: str