Exemplo n.º 1
0
def read_rec_version(meta_info):
    version = meta_info["Capture Software Version"]
    version = ''.join([c for c in version if c in '1234567890.-'
                       ])  #strip letters in case of legacy version format
    version = VersionFormat(version)
    logger.debug("Recording version: {}".format(version))
    return version
Exemplo n.º 2
0
def get_version(version_file=None):
    #get the current software version
    if getattr(sys, 'frozen', False):
        with open(version_file, 'r') as f:
            version = f.read()
    else:
        version = pupil_version()
    version = VersionFormat(version)
    logger.debug("Running version: {}".format(version))
    return version
Exemplo n.º 3
0
def get_version():
    # get the current software version
    if getattr(sys, "frozen", False):
        version_file = os.path.join(sys._MEIPASS, "_version_string_")
        with open(version_file, "r") as f:
            version = f.read()
    else:
        version = pupil_version()
    version = VersionFormat(version)
    logger.debug("Running version: {}".format(version))
    return version
Exemplo n.º 4
0
Lesser General Public License (LGPL v3.0).
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import platform, sys, os, time
from distutils.version import LooseVersion as VersionFormat
import subprocess as sp

import logging

logger = logging.getLogger(__name__)

os_name = platform.system()
if os_name == "Darwin":
    mac_version = VersionFormat(platform.mac_ver()[0])
    min_version = VersionFormat("10.11.0")

if os_name == "Darwin" and mac_version >= min_version:

    class Prevent_Idle_Sleep(object):
        def __init__(self):
            self.caffeine_process = None

        def __enter__(self):
            self.caffeine_process = sp.Popen(
                ["caffeinate", "-w", str(os.getpid())])
            logger.info("Disabled idle sleep.")

        def __exit__(self, type, value, traceback):
            if type is not None:
Exemplo n.º 5
0
    adjust_gl_view,
    basic_gl_setup,
    clear_gl_screen,
    make_coord_system_norm_based,
    make_coord_system_pixel_based,
)
from methods import normalize
from plugin import Plugin

from .detector_base_plugin import PropertyProxy, PupilDetectorPlugin
from .visualizer_2d import draw_eyeball_outline, draw_pupil_outline
from .visualizer_3d import Eye_Visualizer

logger = logging.getLogger(__name__)

if VersionFormat(pupil_detectors.__version__) < VersionFormat("1.0.5"):
    msg = (
        f"This version of Pupil requires pupil_detectors >= 1.0.5."
        f" You are running with pupil_detectors == {pupil_detectors.__version__}."
        f" Please upgrade to a newer version!"
    )
    logger.error(msg)
    raise RuntimeError(msg)


class Detector3DPlugin(PupilDetectorPlugin):
    uniqueness = "by_class"
    icon_font = "pupil_icons"
    icon_chr = chr(0xEC19)

    label = "C++ 3d detector"