summaryrefslogtreecommitdiff
path: root/allDemos.py
blob: 77a9ba44713e00e16b1562e5b45000804b4c144c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# **********************************************************************

import os, sys, imp

sys.path.append(os.path.join(os.path.dirname(__file__), "demoscript"))
from demoscript import *

demoGroups = []

if os.path.isdir("cpp"):
    subdirs = [ "cpp", "java", "cs", "py", "rb"]
else:
    subdirs = [ "demo", "demoj", "democs", "demopy", "demorb"]

for d in subdirs:
    
    filename = os.path.abspath(os.path.join(os.path.dirname(__file__), d, "allDemos.py"))
    f = file(filename, "r")
    current_mod = imp.load_module("allDemos", f, filename, (".py", "r", imp.PY_SOURCE)) 
    f.close()

    demos = [ os.path.join(d, "demo", x) for x in current_mod.demos ]
    demoGroups.extend(demos)

Util.run(demoGroups, root=True)