Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[examples] force-build with dynamic-linking and allow modules to be r…

…e-used between examples
  • Loading branch information...
commit 5706cf8b17fde8313821598e5e2f6004703352ef 1 parent 70f78af
@xtfxme xtfxme authored
View
1  .gitignore
@@ -5,6 +5,7 @@ pyjd/__init__.py
examples/showcase/build/
examples/showcase/src/demoInfo.py
output
+__output__
*.pyc
*.pyo
.*.sw?
View
2  examples/__main__.py
@@ -61,7 +61,7 @@
complete = [
'\n' + '( Pyjs )'.center(69, '-') + '\n',
' Complete! View examples via:',
- str(' # cd {0}').format(path),
+ str(' # cd {0}/__output__').format(path),
str(' # {0} -m SimpleHTTPServer').format(env['PYJS_BIN_PYTHON']),
' http://localhost:8000',
'\n' + '( Pyjs )'.center(69, '-') + '\n\n',
View
8 examples/_examples/template/index.html.tpl
@@ -1,13 +1,13 @@
<html>
<head>
- <title>Pyjamas Examples</title>
- <meta name="keywords" content="Python Pyjamas Examples, Python Web widgets" />
- <meta name="description" content="Python Pyjamas Examples" />
+ <title>Pyjs Examples</title>
+ <meta name="keywords" content="Python Pyjs Examples, Python Web widgets" />
+ <meta name="description" content="Python Pyjs Examples" />
<meta name="title" content="Python Web Toolkit Examples - Javascript Translator and AJAX Widgets" />
<link rel="stylesheet" type="text/css" href="_examples/static/examples.css" />
</head>
<body>
- <h1 id='title'>Pyjamas Examples</h1>
+ <h1 id='title'>Pyjs Examples</h1>
<h4 id='head'>Demos are enabled once built.</h4>
{0}
View
12 examples/_examples/util.py
@@ -89,10 +89,10 @@ def sub(m):
{{example.{name}.demos}}
</ul>
{{example.{name}._comment_start}} -->
- <h4 class='source'><a href="{name}/">source directory</a> ({name})<h4>
+ <h4 class='source'><a href="https://github.com/pyjs/pyjs/tree/master/examples/{name}/">source directory</a> ({name})<h4>
''',
'demo': r'''
- <li class='demo'>(demo) <a href="{name}/output/{target}.html">{target}</a></li>
+ <li class='demo'>(demo) <a href="{target}.html">{target}</a></li>
''',
}
@@ -294,6 +294,12 @@ def translate():
args += TARGETS[target].get('additional_args', [])
else:
opts = []
+ opts += ['--enable-strict',
+ '--enable-signatures',
+ '--enable-preserve-libs',
+ '--disable-debug',
+ '--dynamic-link',
+ '-o', '../__output__']
cmd = [ENV['BIN_PYTHON'], ENV['BIN_PYJSBUILD']] + ENV['ARG_PYJSBUILD'] + opts + args
if not [ENV['ARG_PYJSBUILD']] + opts + args:
@@ -324,7 +330,7 @@ def install(package=None, **packages):
packages[name] = example
if not packages:
raise TypeError('Nothing to install.')
- index = os.path.join(ENV['DIR_EXAMPLES'], 'index.html')
+ index = os.path.join(ENV['DIR_EXAMPLES'], '__output__', 'index.html')
try:
if os.path.isfile(index):
idx_out_fd = open(index, 'r+')
View
8 examples/showcase/compile.py
@@ -111,18 +111,18 @@ def main():
f.write("\n".join(s))
f.close()
- options = " ".join(sys.argv[1:])
+ options = " ".join(sys.argv[1:]) + " --enable-signatures --enable-preserve-libs --disable-debug --dynamic-link"
# Compile the application using Pyjamas.
if sys.platform == "win32":
stmt = (sys.executable + " " + os.path.join(PATH_TO_PYJAMAS, 'bin', 'pyjsbuild.py') +
" " + options +
- " -o " + os.path.join(here,'output') + " " +
+ " -o " + os.path.join(here, '..', '__output__') + " " +
" -I " + os.path.join(here, 'src') + " " +
'Showcase')
else:
- stmt = (os.path.join(PATH_TO_PYJAMAS, 'bin', 'pyjsbuild') +
+ stmt = (sys.executable + " " + os.path.join(PATH_TO_PYJAMAS, 'bin', 'pyjsbuild') +
" " + options +
- " -o " + os.path.join(here,'output') + " " +
+ " -o " + os.path.join(here, '..', '__output__') + " " +
" -I " + os.path.join(here, 'src') + " " +
'Showcase' +
" > /dev/null")
Please sign in to comment.
Something went wrong with that request. Please try again.