a | b/trunk/cforge/cforge/Package/CFORGE/Scripts/plcopen-export.py | ||
---|---|---|---|
1 | import sys, os |
||
2 | import cds_script |
||
3 | |||
4 | |||
5 | # This is a cforge command (script file) |
||
6 | # this will be run as ironpython script. |
||
7 | # the filename of this script is automatically the corresponding cforge command |
||
8 | # with some magic functions you can easily integrate it nicely into cforge tool |
||
9 | |||
10 | # cforge_usage: |
||
11 | # here you can return an array of all possible arguments and options that can |
||
12 | # be passed to this command script |
||
13 | def cforge_usage(): |
||
14 | help = [ |
||
15 | ["<path to CODESYS project>", "---"] |
||
16 | ] |
||
17 | |||
18 | return help |
||
19 | |||
20 | |||
21 | |||
22 | if len(sys.argv) <= 1: |
||
23 | print("Oh, there are no arguments. Perhaps you forgot something?") |
||
24 | sys.exit() |
||
25 | |||
26 | scriptpath = "C:\\Users\\Stefan\Projekte\\SVN\\Forge\\cforge\\trunk\\scripts\\" |
||
27 | |||
28 | scriptname = os.path.join(scriptpath, "action.plcopenxml.export.py") |
||
29 | scriptargs = sys.argv[1] |
||
30 | |||
31 | cds_script.RunCodesysWithScript(scriptname, scriptargs) |