Beispiel #1
0
    def get_local_version():
        """ Get the local version of Odemis
        return (str): version of the form #.#.##
         """

        ver_str = odemis._get_version()
        if '-' in ver_str:
            ver_str = '.'.join(ver_str.split('-')[:2])
        return ver_str
Beispiel #2
0
    def get_local_version():
        """ Get the local version of Odemis
        return (str): version of the form #.#.##
         """

        ver_str = odemis._get_version()
        if '-' in ver_str:
            ver_str = '.'.join(ver_str.split('-')[:2])
        return ver_str
Beispiel #3
0
    def get_local_version():
        """ Get the local version of Odemis
        return (str): version of the form #.#.##
         """

        ver_str = odemis._get_version()
        if "-" in ver_str:
            ver_str = ".".join(ver_str.split("-")[:2])
        return ver_str
Beispiel #4
0
def add_size_to_version():
    with open('dist/version.txt', 'a') as f:
        version = '.'.join(odemis._get_version().split('-')[:2])
        f.write(str(os.path.getsize("dist\OdemisViewer-%s.exe" % version)) + '\n')
Beispiel #5
0
import os
import subprocess
import sys
import odemis

cpy_command = ["python", "setup.py", "build_ext", "--inplace"]
pyi_command = ["pyinstaller", "-y", "viewer.spec"]
nsis_command = [
    r"C:\Program Files (x86)\NSIS\makensis",
    "/DPRODUCT_VERSION=" + '.'.join(odemis._get_version().split('-')[:2]),
    "setup.nsi"
]

# PyInstaller/tkinter might have problems finding init.tcl
if 'TCL_LIBRARY' not in os.environ or 'TK_LIBRARY' not in os.environ:
    print "\n* WARNING * You might need to set the 'TCL_LIBRARY' and 'TK_LIBRARY' env vars!\n"


def run_command(cmd, flavor=None):

    if flavor is not None:
        os.environ['FLAVOR'] = str(flavor)

    p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    print "\n\n"
    for line in iter(p.stdout.readline, b''):
        print line.rstrip()
    return p.wait()


def add_size_to_version():
Beispiel #6
0
def add_size_to_version():
    with open('dist/version.txt', 'a') as f:
        version = '.'.join(odemis._get_version().split('-')[:2])
        f.write(str(os.path.getsize("dist\OdemisViewer-%s.exe" % version)) + '\n')
Beispiel #7
0
import os
import subprocess
import sys
import odemis
import traceback
from builtins import input

cpy_command = ["python", "setup.py", "build_ext", "--inplace"]
pyi_command = ["pyinstaller", "--clean", "-y", "viewer.spec"]
nsis_command = [
    r"C:\Program Files (x86)\NSIS\makensis",
    "/DPRODUCT_VERSION=" + '.'.join(odemis._get_version().split('-')[:2]),
    "setup.nsi"
]

# PyInstaller/tkinter might have problems finding init.tcl
if 'TCL_LIBRARY' not in os.environ or 'TK_LIBRARY' not in os.environ:
    print("\n* ATTENTION * You might need to set the 'TCL_LIBRARY' and 'TK_LIBRARY' env vars!\n")


def run_command(cmd, flavor=None):
    if flavor is not None:
        os.environ['FLAVOR'] = str(flavor)
    try:
        subprocess.check_call(cmd)
    except Exception as ex:
        # Don't close terminal after raising Exception
        traceback.print_exc(ex)
        input("Press any key to exit.")
        sys.exit(-1)