~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to em-config

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-02 13:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20130502131151-q8dvteqr1ef2x7xz
Tags: upstream-1.4.1~20130504~adb56cb
ImportĀ upstreamĀ versionĀ 1.4.1~20130504~adb56cb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python2
 
2
 
 
3
'''
 
4
This is a helper tool which is designed to make it possible
 
5
for other apps to read emscripten's configuration variables
 
6
in a unified way.  Usage:
 
7
 
 
8
  em-config VAR_NAME
 
9
 
 
10
This tool prints the value of the variable to stdout if one
 
11
is found, or exits with 1 if the variable does not exist.
 
12
'''
 
13
 
 
14
import os, sys, re
 
15
from tools import shared
 
16
 
 
17
if len(sys.argv) != 2 or \
 
18
  not re.match(r"^[\w\W_][\w\W_\d]*$", sys.argv[1]) or \
 
19
  not (sys.argv[1] in dir(shared)):
 
20
  print 'Usage: em-config VAR_NAME'
 
21
  exit(1)
 
22
 
 
23
print eval('shared.' + sys.argv[1])
 
24