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 : 2017-07-20 11:23:43
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20170720-112343
  • min_os_version :
  • min_wapt_version :

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


    

manifest

[["WAPT/icon.png", "41a4529177a7b54c723a159658e69070d74207fd"], ["WAPT/certificate.crt", "0db563dc9077b268ca07ba834322d0fc5e21f8e5"], ["WAPT/wapt.psproj", "a35d93f78b78a427ef76ba023721a9e2b58cb19c"], ["PyScripter-v2.6.0-Setup.exe", "46934b00ae4ab7d496110cc881335b085c166b4e"], ["setup.py", "0192c0f1a39ec19b05e056338e021046e89b288b"], ["WAPT/control", "74e9737249da9ffee277762bab9d0db4785e6f8b"]]