Diff of /trunk/cforge/cforge/Package/CFORGE/Scripts/build.py [r61] .. [r62]  Maximize  Restore

Switch to unified view

a/trunk/cforge/cforge/Package/CFORGE/Scripts/build.py b/trunk/cforge/cforge/Package/CFORGE/Scripts/build.py
1
import sys, os
1
import sys, os
2
import re
2
import re
3
import zipfile
3
import zipfile
4
import cds_script
4
import cds_script
5
5
import ntpath
6
import ui
6
7
7
# This is a cforge command (script file)
8
# This is a cforge command (script file)
8
# this will be run as ironpython script.
9
# this will be run as ironpython script.
9
# the filename of this script is automatically the corresponding cforge command 
10
# the filename of this script is automatically the corresponding cforge command 
10
# with some magic functions you can easily integrate it nicely into cforge tool
11
# with some magic functions you can easily integrate it nicely into cforge tool
...
...
25
    sys.exit()
26
    sys.exit()
26
27
27
folder = sys.argv[1]
28
folder = sys.argv[1]
28
scriptpath = os.path.abspath(os.path.dirname(sys.argv[0]))
29
scriptpath = os.path.abspath(os.path.dirname(sys.argv[0]))
29
30
31
# if folder can't be found, try to interpret it as a repo
32
# name, relatively to the workspace folder
33
if not os.path.isdir(folder):
34
    config = ui.GetSettings()
35
    workspace, file = ntpath.split(config['folder'])
36
    folder = os.path.join(workspace, folder)
37
38
print("building folder: %s" % folder)
39
30
def zipdir(path, ziph):
40
def zipdir(path, ziph):
31
    # ziph is zipfile handle
41
    # ziph is zipfile handle
32
    for root, dirs, files in os.walk(path):
42
    for root, dirs, files in os.walk(path):
33
        for file in files:
43
        for file in files:
34
            filename=os.path.join(root, file)
44
            filename=os.path.join(root, file)
...
...
78
    cds_script.RunCodesysWithScript(scriptname, scriptargs, False)
88
    cds_script.RunCodesysWithScript(scriptname, scriptargs, False)