setup.py
author lbessard
Tue, 13 Jan 2009 17:26:37 +0100
changeset 300 34d1402c0e24
parent 149 189ebdde3eb9
permissions -rwxr-xr-x
Bug with variable tree generation fixed
148
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
     1
import os,sys,glob
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
     2
from distutils.core import setup
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
     3
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
     4
149
189ebdde3eb9 fix plcopeneditor directory in lowcase
greg
parents: 148
diff changeset
     5
install_dir=os.path.join("LOLITech","plcopeneditor")
148
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
     6
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
     7
data_files=[]
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
     8
os.getcwd()
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
     9
os.chdir(os.getcwd())
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    10
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    11
def generate(base_dir):
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    12
    listfile=[]
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    13
    if base_dir == "":
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    14
        directory = "."
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    15
    else:
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    16
        directory = base_dir
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    17
    data_files.append((os.path.join(install_dir, base_dir), listfile))
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    18
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    19
    for element in os.listdir(directory):
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    20
        element_path=os.path.join(base_dir, element)
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    21
        if os.path.isdir(element_path):
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    22
            generate(element_path)
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    23
        elif os.path.isfile(element_path):
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    24
            listfile.append(element_path)
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    25
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    26
generate("")
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    27
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    28
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    29
setup(name='PlcOpenEditor', # Name of the executable
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    30
      version='0.1', # Version
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    31
      description='Editor for the 5 of the IEC-61131-3 languages', #description
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    32
      author='Edouard Tisserant, Laurent Bessard',
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    33
      author_email='laurent.bessard@lolitech.fr',
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    34
      url='http://www.beremiz.org',
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    35
      license='GPL',
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    36
      scripts=['plcopeneditor_postinst.py'],
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    37
      data_files=data_files, # Add files to install
a083d4a94bd3 add setup.py and plcopeneditor_postinst.py to build windows installer
greg
parents:
diff changeset
    38
)