bump version to 0.7

support relative paths
--tmdinfo no longer fails when an IOS-tmd is check
don't enforce decrypt=false on unpacking CLI
This commit is contained in:
Christopher Roy Bratusek 2013-06-17 10:00:37 +02:00
parent 138af060a3
commit e573cd1f2f
6 changed files with 103 additions and 77 deletions

View File

@ -1,3 +1,9 @@
-- 0.7 --
* cli-options now can properly handle relative paths
* --tmdinfo does now longer fail when checking an IOS
* don't enforce decrypt=false on unpacking cli
* automatic whitespace fixes
-- 0.6 -- -- 0.6 --
* fixed a string in german translation * fixed a string in german translation
* fixed selecting file in TMD-Viewer * fixed selecting file in TMD-Viewer

View File

@ -10,7 +10,7 @@ from PyQt4.QtCore import pyqtSignature
from Ui_AboutQwad import Ui_Dialog from Ui_AboutQwad import Ui_Dialog
def Version(): def Version():
return "0.5" return "0.7"
def Author(): def Author():
return "Christopher Roy Bratusek <nano@tuxfamily.org>" return "Christopher Roy Bratusek <nano@tuxfamily.org>"

View File

@ -342,6 +342,18 @@ class UnpackingCLI(Thread):
print e print e
print "Done" print "Done"
class UnpackingCLIX(Thread):
def __init__(self, wadpath, dirpath):
Thread.__init__(self)
self.wadpath = wadpath
self.dirpath = dirpath
def run(self):
try:
WAD.loadFile(self.wadpath).dumpDir(self.dirpath)
except Exception, e:
print e
print "Done"
class Packing(Unpacking): class Packing(Unpacking):
def __init__(self, dirpath, wadpath, QMW, deletedir = False): def __init__(self, dirpath, wadpath, QMW, deletedir = False):
Unpacking.__init__(self, wadpath, dirpath, QMW) Unpacking.__init__(self, wadpath, dirpath, QMW)
@ -349,9 +361,9 @@ class Packing(Unpacking):
def run(self): def run(self):
self.qobject.emit(SIGNAL("working"),PACKING) self.qobject.emit(SIGNAL("working"),PACKING)
try: try:
print self.dirpath
print self.wadpath print self.wadpath
WAD.loadDir(self.dirpath).dumpFile(self.wadpath) print self.dirpath
WAD.loadDir(self.dirpath).dumpFile(self.wadpath)
if self.deletedir: if self.deletedir:
print "Cleaning temporary files" print "Cleaning temporary files"
self.qobject.emit(SIGNAL("working"),CLEANING) self.qobject.emit(SIGNAL("working"),CLEANING)
@ -393,6 +405,8 @@ class nusDownloading(Unpacking):
self.version = None self.version = None
self.decrypt = decrypt self.decrypt = decrypt
self.titleid = titleid self.titleid = titleid
print self.titleid
print self.version
def run(self): def run(self):
self.qobject.emit(SIGNAL("working"),DOWNLOADING) self.qobject.emit(SIGNAL("working"),DOWNLOADING)
try: try:
@ -425,7 +439,7 @@ class nusDownloadingCLI(UnpackingCLI):
try: try:
if self.pack: if self.pack:
self.dirpath = tempfile.gettempdir() + "/NUS_"+ str(time.time()).replace(".","") self.dirpath = tempfile.gettempdir() + "/NUS_"+ str(time.time()).replace(".","")
NUS(self.titleid, self.version).download(self.dirpath, decrypt = False) NUS(self.titleid, self.version).download(self.dirpath, decrypt = self.decrypt)
self.packing = PackingCLI(self.dirpath, str(self.outputdir), True) self.packing = PackingCLI(self.dirpath, str(self.outputdir), True)
self.packing.start() self.packing.start()
else: else:
@ -446,7 +460,10 @@ def ShowTMD(tmdpath):
print "Title Version : %s" % tmd.tmd.title_version print "Title Version : %s" % tmd.tmd.title_version
print "Title Boot Index : %s" % tmd.tmd.boot_index print "Title Boot Index : %s" % tmd.tmd.boot_index
print "Title Contents : %s" % tmd.tmd.numcontents print "Title Contents : %s" % tmd.tmd.numcontents
print "Title IOS : %s" % TitleIDs.TitleSwapDict["%s" % ("%016x" % tmd.tmd.iosversion)] if ("%016x" % tmd.tmd.iosversion) == "0000000000000000":
print "Title IOS : --"
else:
print "Title IOS : %s" % TitleIDs.TitleSwapDict["%s" % ("%016x" % tmd.tmd.iosversion)]
print "Title Access Rights: %s" % tmd.tmd.access_rights print "Title Access Rights: %s" % tmd.tmd.access_rights
print "Title Type : %s" % tmd.tmd.title_type print "Title Type : %s" % tmd.tmd.title_type
print "Title Group ID : %s" % tmd.tmd.group_id print "Title Group ID : %s" % tmd.tmd.group_id

View File

@ -8,6 +8,11 @@ from PyQt4.QtCore import QTranslator, QString, QLocale
from GUI.VenPri import MWQwad, nusDownloadingCLI, PackingCLI, UnpackingCLI, ShowTMD from GUI.VenPri import MWQwad, nusDownloadingCLI, PackingCLI, UnpackingCLI, ShowTMD
from TitleIDs import TitleDict, IOSdict, swap_dic, ChannelCLIDict, ChannelJAPDict, ChannelPALDict, ChannelUSADict, ChannelJAPVerDict, ChannelPALVerDict, ChannelUSAVerDict from TitleIDs import TitleDict, IOSdict, swap_dic, ChannelCLIDict, ChannelJAPDict, ChannelPALDict, ChannelUSADict, ChannelJAPVerDict, ChannelPALVerDict, ChannelUSAVerDict
if os.getenv("QWAD_X_DIR"):
os.chdir(os.getenv("QWAD_X_DIR"))
else:
os.chdir(os.getenv("HOME"))
class MultipleOption(Option): class MultipleOption(Option):
ACTIONS = Option.ACTIONS + ("extend",) ACTIONS = Option.ACTIONS + ("extend",)
STORE_ACTIONS = Option.STORE_ACTIONS + ("extend",) STORE_ACTIONS = Option.STORE_ACTIONS + ("extend",)
@ -20,10 +25,9 @@ class MultipleOption(Option):
else: else:
Option.take_action(self, action, dest, opt, value, values, parser) Option.take_action(self, action, dest, opt, value, values, parser)
VERSION = '0.6' VERSION = '0.7'
def opts(): def opts():
os.chdir(sys.path[0])
description = """NUS-Downloader, WadManager and TMD-Viewer for Linux""" description = """NUS-Downloader, WadManager and TMD-Viewer for Linux"""
parser = OptionParser(option_class=MultipleOption, parser = OptionParser(option_class=MultipleOption,
usage='usage: qwad [OPTIONS] ARGUMENT', usage='usage: qwad [OPTIONS] ARGUMENT',
@ -72,7 +76,7 @@ def opts():
xarg = TitleDict[str(options.download[0])] xarg = TitleDict[str(options.download[0])]
nusdow = nusDownloadingCLI(int(str(xarg).lower(),16), args[0], args[1], args[2], args[3]) nusdow = nusDownloadingCLI(int(str(xarg).lower(),16), args[0], args[1], args[2], args[3])
else: else:
nusdow = nusDownloadingCLI(int(str(options.download[0]).lower(),16), args[0], args[1], args[2], args[3]) nusdow = nusDownloadingCLI(int(str(options.download[0]).lower(),16), args[0], args[1], args[2], args[3])
nusdow.start() nusdow.start()
sys.exit(0) sys.exit(0)
@ -165,8 +169,6 @@ def main():
# load Qt translations # load Qt translations
qttranslator = QTranslator() qttranslator = QTranslator()
qttranslator.load(QString("qt_%1").arg(QLocale.system().name())) qttranslator.load(QString("qt_%1").arg(QLocale.system().name()))
# change directory in $HOME, so that file-seletors don't start in Qwads source/data directory
os.chdir(os.getenv("HOME"))
# misc stuff # misc stuff
Vapp = QApplication(sys.argv) Vapp = QApplication(sys.argv)
Vapp.setOrganizationName("Nanolx") Vapp.setOrganizationName("Nanolx")

1
qwad
View File

@ -1,3 +1,4 @@
#!/bin/sh #!/bin/sh
export QWAD_X_DIR="${PWD}"
PYTHONPATH="/usr/share/Qwad/" PYTHONPATH="/usr/share/Qwad/"
python /usr/share/Qwad/Qwad.pyw $@ python /usr/share/Qwad/Qwad.pyw $@