示例#1
0
    def onClick(self, event):
        if event.widget == self.__bootImgSelect:
            filename = tkFileDialog.askopenfilename(initialdir=os.path.expanduser("~"))
            if len(filename) > 0 :
                self.__bootImgText.set(filename)

        elif event.widget == self.__bootDirSelect:
            directory = tkFileDialog.askdirectory(initialdir=os.path.expanduser("~"))
            if len(directory) > 0 :
                self.__bootDirText.set(directory) 

        elif event.widget == self.__unpackBtn:
            bootfile = self.__bootImgText.get()
            output =  self.__bootDirText.get()

            if len(bootfile) > 0 :
                bootimg.unpack(bootfile, output)
                result = "Unpack " + bootfile + " --> " + output
                self.__resultText.set(result)

        elif event.widget == self.__packBtn:
            bootfile = self.__bootDirText.get()
            output = self.__bootImgText.get()

            if len(bootfile) > 0 :
                bootimg.pack(bootfile, output)
                result = "Pack " + bootfile + " --> " + output
                self.__resultText.set(result)
示例#2
0
文件: main.py 项目: loserq/tools
    def onClick(self, event):
        if event.widget == self.__bootImgSelect:
            filename = tkFileDialog.askopenfilename(
                initialdir=os.path.expanduser("~"))
            if len(filename) > 0:
                self.__bootImgText.set(filename)

        elif event.widget == self.__bootDirSelect:
            directory = tkFileDialog.askdirectory(
                initialdir=os.path.expanduser("~"))
            if len(directory) > 0:
                self.__bootDirText.set(directory)

        elif event.widget == self.__unpackBtn:
            bootfile = self.__bootImgText.get()
            output = self.__bootDirText.get()

            if len(bootfile) > 0:
                bootimg.unpack(bootfile, output)
                result = "Unpack " + bootfile + " --> " + output
                self.__resultText.set(result)

        elif event.widget == self.__packBtn:
            bootfile = self.__bootDirText.get()
            output = self.__bootImgText.get()

            if len(bootfile) > 0:
                bootimg.pack(bootfile, output)
                result = "Pack " + bootfile + " --> " + output
                self.__resultText.set(result)
示例#3
0
"""


__author__ = '*****@*****.**'


from internal import bootimg
import sys
import traceback


if __name__ == '__main__':
    argc = len(sys.argv)
    if argc <= 1:
        print __doc__
        exit(1)

    if argc > 1:
        boot_dir = sys.argv[1]
        output = boot_dir + ".img"

    if argc > 2:
        output = sys.argv[2]

    try:
        bootimg.pack(boot_dir, output)
    except ValueError as ve:
        traceback.print_exc()
        # See help.xml ERR_PACK_BOOTIMG_FAILED
        sys.exit(154)
示例#4
0
    def asset_pack_succ(boot_dir):
        bootimg.pack(boot_dir, "out.img")

        assert path.exists("out.img")

        os.remove("out.img")
示例#5
0
Usage: pack_bootimg.py BOOT_IMG_DIR [OUTPUT_IMG]
       - BOOT_IMG_DIR : the directory of boot image files.
       - OUTPUT_IMG   : the output image after pack. If not present, BOOT_IMG_DIR.img will be used
"""

__author__ = '*****@*****.**'

from internal import bootimg
import sys
import traceback

if __name__ == '__main__':
    argc = len(sys.argv)
    if argc <= 1:
        print __doc__
        exit(1)

    if argc > 1:
        boot_dir = sys.argv[1]
        output = boot_dir + ".img"

    if argc > 2:
        output = sys.argv[2]

    try:
        bootimg.pack(boot_dir, output)
    except ValueError as ve:
        traceback.print_exc()
        # See help.xml ERR_PACK_BOOTIMG_FAILED
        sys.exit(154)
示例#6
0
    def asset_pack_succ(boot_dir):
        bootimg.pack(boot_dir, "out.img")

        assert path.exists("out.img")

        os.remove("out.img")