tis-pyscripter 2.6.0-10

  • package : tis-pyscripter
  • version : 2.6.0-10
  • description : Environement de developpement python
  • maintainer : TIS <technique@tranquil-it-systems.fr>
  • date : 2018-02-27 19:06:56

setup.py

#!/usr/bin/python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------
#    This file is part of WAPT
#    Copyright (C) 2013  Tranquil IT Systems http://www.tranquil.it
#    WAPT aims to help Windows systems administrators to deploy
#    setup and update applications on users PC.
#
#    WAPT 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.
#
#    WAPT 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 WAPT.  If not, see <http://www.gnu.org/licenses/>.
#
# -----------------------------------------------------------------------
from setuphelpers import *
import codecs

uninstallkey=[]

def install():
    try:
        install_exe_if_needed('PyScripter-v2.6.0-Setup.exe','/VERYSILENT',key='PyScripter_is1',min_version='2.6.0',killbefore=['PyScripter'])
    except:
        # for old wapt (<1.2.2)
        killalltasks('PyScripter')
        run('PyScripter-v2.6.0-Setup.exe /VERYSILENT')
        uninstallkey.append('PyScripter_is1')

    import common
    if not common.is_system_user():
        session_setup()

def session_setup():
    try:
        python_init_fn = makepath(application_data(),'PyScripter','python_init.py')
        ensure_dir(python_init_fn)
        if isfile(python_init_fn):
            content = codecs.open(python_init_fn,'r',encoding='utf8').read()
        else:
            content = ''
        if not "site.addsitedir('c:/wapt/lib/site-packages')" in content.splitlines():
            with codecs.open(python_init_fn,'a',encoding='utf8') as f:
                print('Add wapt sitedir to %s'%python_init_fn)
                f.write("\nimport site\n")
                f.write("site.addsitedir('c:/wapt/lib/site-packages')\n")
    except Exception as e:
        print(u'Error in session-setup : %s' % ensure_unicode(e))
        raise


    

Changelog

No changelog
    

manifest.sha256

[["WAPT/icon.png", "83092815859a13c15223c22ab138ffc9c8b48685bfe3f13b58bedbdcb65cfe31"], ["WAPT/certificate.crt", "79e5388683c0b6cb03f4f81e4e58e3a11463b2b6cf169dd9c453098027dcfaa4"], ["WAPT/wapt.psproj", "066ff50132185fe01944e556366981c861f66bf1aba3fa5e7f71c3980e7c72c8"], ["PyScripter-v2.6.0-Setup.exe", "bd912dd89e387f19a336f9fd23addcb510b45f968432dfb56b6d82b900313003"], ["setup.py", "8f854c91e74c0b276ab296787d10a51f21e0727ce90b76738017d7d9bc9c0b71"], ["WAPT/control", "f44b7a45eaa3f07273051aa2be0af918752b0853a5cf6d6359c7d83284da0c36"]]