# 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
linux_out = "comtool_ubuntu_v{}.tar.xz".format(version.__version__)
macos_out = "comtool_macos_v{}.dmg".format(version.__version__)
windows_out = "comtool_windows_v{}.zip".format(version.__version__)

def zip(out, path):
    out = os.path.abspath(out)
    cwd = os.getcwd()
    os.chdir(os.path.dirname(path))
    with zipfile.ZipFile(out,'w', zipfile.ZIP_DEFLATED) as target:
        for i in os.walk(os.path.basename(path)):
            for n in i[2]:
                target.write(os.path.join(i[0],n))
    os.chdir(cwd)

def upadte_spec_bundle(spec_path, items = {}, plist_items={}):
    with open(spec_path) as f:
        spec = f.read()
    def BUNDLE(*args, **kw_args):
        kw_args.update(items)
        if "info_plist" in kw_args:
            kw_args["info_plist"].update(plist_items)
        else:
            kw_args["info_plist"] = plist_items
        bundle_str_args = ""
        for arg in args:
            if type(arg) == str and arg != "exe" and arg != "coll":
                bundle_str_args += f'"{arg}", \n'
            else:
                bundle_str_args += f'{arg}, \n'
        for k, v in kw_args.items():

# 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

linux_out = "comtool_ubuntu_v{}.tar.xz".format(version.__version__)
macos_out = "comtool_macos_v{}.dmg".format(version.__version__)
windows_out = "comtool_windows_v{}.zip".format(version.__version__)

def zip(out, path):
    out = os.path.abspath(out)
    cwd = os.getcwd()
    os.chdir(os.path.dirname(path))
    with zipfile.ZipFile(out,'w', zipfile.ZIP_DEFLATED) as target:
        for i in os.walk(os.path.basename(path)):
            for n in i[2]:
                target.write(os.path.join(i[0],n))
    os.chdir(cwd)

def upadte_spec_bundle(spec_path, items = {}, plist_items={}):
    with open(spec_path) as f:
        spec = f.read()
    def BUNDLE(*args, **kw_args):
        kw_args.update(items)
        if "info_plist" in kw_args:
            kw_args["info_plist"].update(plist_items)
        else:
            kw_args["info_plist"] = plist_items
        bundle_str_args = ""
        for arg in args:
            if type(arg) == str and arg != "exe" and arg != "coll":
                bundle_str_args += f'"{arg}", \n'
            else:
                bundle_str_args += f'{arg}, \n'
        for k, v in kw_args.items():

            if type(v) == str: