ghtalpo / py_amazfit_tools

pack/unpack .bin for amazfit verge lite/gtr/gts
55 stars 53 forks source link

Error when I run convert.py #2

Closed chenchix closed 5 years ago

chenchix commented 5 years ago

$ python3 convert.py gtr47 GTR source Traceback (most recent call last): File "convert.py", line 112, in Converter().resizePng(inputFileName) File "convert.py", line 89, in resizePng self.resizeJson(full_path) File "convert.py", line 53, in resizeJson self.patchTree(tree) File "convert.py", line 43, in patchTree value = tree[k] TypeError: list indices must be integers or slices, not dict

ghtalpo commented 5 years ago

can you provide link for the gtr watchface?

chenchix commented 5 years ago

I didn't know how i closed the issue.

Here you have the file https://drive.google.com/file/d/1R0uKtmxlsEHh2GKBCnFGW1y_HACGDvsW/view?usp=sharing

I have fixed it adding this

    def resizeJson(self, json_path):
        tree = self.loadJson(json_path)
        **if not 'Background' in tree:
            return**
        self.patchTree(tree)
        self.saveJson(json_path, tree)

To apply only to valids json.

ghtalpo commented 5 years ago

added your patch at 7e57acc

thanks