#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
#########################################################
# Name: launcher.py
# Porpose: main launch script of videomass
# Compatibility: Python2, Python3
# Author: Gianluca Pernigoto <jeanlucperni@gmail.com>
# Copyright: (c) 2018/2020 Gianluca Pernigoto <jeanlucperni@gmail.com>
# license: GPL3
# Rev: Gen 14-2019, Aug 14-2019, Sept.11.2019
#########################################################

# This file is part of Videomass.

#    Videomass is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.

#    Videomass is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.

#    You should have received a copy of the GNU General Public License
#    along with Videomass.  If not, see <http://www.gnu.org/licenses/>.

#########################################################

import sys
import platform

if __name__ == '__main__':
    
    if sys.version_info[0] == 3:
        try:
            import wx
        
        except ImportError:
            sys.stderr.write("videomass: ERROR: 'wx' module is required; "
                             "need wxPython4 (phoenix).\n"
                             "Visit the wxPython web page for more info:\n"
                             "<https://wxpython.org/>\n"
                            )
            if platform.system() not in ['Windows', 'Darwin']:
                sys.stderr.write('Please, install wxPython4 with your package '
                                 'manager.\n')
            sys.exit(1)
        
        from videomass3 import Videomass3
        Videomass3.main()
    
    else:
        sys.stderr.write("videomass: ERROR: Not a supported Python version.\n"
                         "Since version 1.6.1 Videomass is compatible only "
                         "with Python3 .\nYou are using Python version %s\n" % 
                         sys.version[0]
                         )
        sys.exit(1)
        
