2
# Copyright 2008 Hannes Hochreiner
3
# This program is free software: you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation, either version 3 of the License, or
6
# (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program. If not, see http://www.gnu.org/licenses/.
17
from xml.dom.minidom import parse
18
from jessyInk_isExtUtils import *
23
# Process input parameters
24
(tempFile, options) = processOptions(sys.argv[1:])
26
std.stderr.write("Name of the temporary file could not be extracted.\n")
29
# Check if we received an id
30
if not options.has_key("id") or options["id"].strip() == "":
31
sys.stderr.write("No object id found.\n")
34
domDoc = parse(tempFile)
36
node = getNodeWithId(domDoc, options["id"].strip())
39
sys.stderr.write("Node could not be found.\n")
42
if options.has_key("effectInOrder"):
43
effectInOrder = options["effectInOrder"]
44
if effectInOrder == None:
47
if options.has_key("effectIn"):
48
if options["effectIn"] == "appear":
49
node.setAttribute("effectIn","name=appear;order=" + effectInOrder)
50
elif options["effectIn"] == "fade":
51
node.setAttribute("effectIn","name=fade;order=" + effectInOrder)
52
elif options["effectIn"] == "pop":
53
node.setAttribute("effectIn","name=pop;order=" + effectInOrder)
55
if node.hasAttribute("effectIn"):
56
node.removeAttribute("effectIn")
58
if node.hasAttribute("effectIn"):
59
node.removeAttribute("effectIn")
62
if options.has_key("effectOutOrder"):
63
effectOutOrder = options["effectOutOrder"]
64
if effectOutOrder == None:
67
if options.has_key("effectOut"):
68
if options["effectOut"] == "appear":
69
node.setAttribute("effectOut","name=appear;order=" + effectOutOrder)
70
elif options["effectOut"] == "fade":
71
node.setAttribute("effectOut","name=fade;order=" + effectOutOrder)
72
elif options["effectOut"] == "pop":
73
node.setAttribute("effectOut","name=pop;order=" + effectOutOrder)
75
if node.hasAttribute("effectOut"):
76
node.removeAttribute("effectOut")
78
if node.hasAttribute("effectOut"):
79
node.removeAttribute("effectOut")
82
sys.stdout.write(domDoc.toxml())