# Path: COMTool/version.py
# class Version:
#     def __init__(self, major=major, minor=minor, dev=dev, name="", desc=""):
#     def dump_dict(self):
#     def load_dict(self, obj):
#     def int(self):
#     def __str__(self):
# 
# Path: COMTool/i18n.py
# def _(text):
# def set_locale(locale_in):
# def get_languages():
# def extract(src_path, config_file_path, out_path):
# def init(template_path, out_dir, locale, domain="messages"):
# def update(template_path, out_dir, locale, domain="messages"):
# def compile(translate_dir, locale, domain="messages"):
# def main(cmd):


import os, sys, shutil
import zipfile
import shutil
import re
from COMTool import version, i18n
            if type(v) == str:
                bundle_str_args += f'{k}="{v}",\n'
            else:
                bundle_str_args += f'{k}={v},\n'
        return bundle_str_args

    match = re.findall(r'BUNDLE\((.*?)\)', spec, flags=re.MULTILINE|re.DOTALL)
    if len(match) <= 0:
        raise Exception("no BUNDLE found in spec, please check code")
    code =f'app = BUNDLE({match[0]})'
    vars = {
        "BUNDLE": BUNDLE,
        "exe": "exe",
        "coll": "coll"
    }
    exec(code, vars)
    final_str = vars["app"]

    def re_replace(c):
        print(c[0])
        return f'BUNDLE({final_str})'

    final_str = re.sub(r'BUNDLE\((.*)\)', re_replace, spec, flags=re.I|re.MULTILINE|re.DOTALL)
    print(final_str)

    with open(spec_path, "w") as f:
        f.write(spec)

def pack():
    # update translate

# Path: COMTool/version.py
# class Version:
#     def __init__(self, major=major, minor=minor, dev=dev, name="", desc=""):
#     def dump_dict(self):
#     def load_dict(self, obj):
#     def int(self):
#     def __str__(self):
# 
# Path: COMTool/i18n.py
# def _(text):
# def set_locale(locale_in):
# def get_languages():
# def extract(src_path, config_file_path, out_path):
# def init(template_path, out_dir, locale, domain="messages"):
# def update(template_path, out_dir, locale, domain="messages"):
# def compile(translate_dir, locale, domain="messages"):
# def main(cmd):


# Path: pack.py
import os, sys, shutil
import zipfile
import shutil
import re
from COMTool import version, i18n

            if type(v) == str:
                bundle_str_args += f'{k}="{v}",\n'
            else:
                bundle_str_args += f'{k}={v},\n'
        return bundle_str_args

    match = re.findall(r'BUNDLE\((.*?)\)', spec, flags=re.MULTILINE|re.DOTALL)
    if len(match) <= 0:
        raise Exception("no BUNDLE found in spec, please check code")
    code =f'app = BUNDLE({match[0]})'
    vars = {
        "BUNDLE": BUNDLE,
        "exe": "exe",
        "coll": "coll"
    }
    exec(code, vars)
    final_str = vars["app"]

    def re_replace(c):
        print(c[0])
        return f'BUNDLE({final_str})'

    final_str = re.sub(r'BUNDLE\((.*)\)', re_replace, spec, flags=re.I|re.MULTILINE|re.DOTALL)
    print(final_str)

    with open(spec_path, "w") as f:
        f.write(spec)

def pack():
    # update translate

    i18n.main("finish")