https://svn.lrde.epita.fr/svn/oln/trunk/swilena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Add the Swilena Python Shell (sps).
* python/sps-common.in, python/sps.in, python/sps-local.in: New.
* python/swilena.py: New.
Use it...
* python/test.py: ...here, to factor imports.
* python/Makefile.am (python_PYTHON): Add swilena.py.
(bin_SCRIPTS): New. Add sps
(noinst_SCRIPTS): New. Add sps-local.
(CLEANFILES): Add $(bin_SCRIPTS) and $(noinst_SCRIPTS).
Makefile.am | 16 ++++++++++++++++
sps-common.in | 34 ++++++++++++++++++++++++++++++++++
sps-local.in | 6 ++++++
sps.in | 6 ++++++
swilena.py | 31 +++++++++++++++++++++++++++++++
test.py | 3 +--
6 files changed, 94 insertions(+), 2 deletions(-)
Index: python/sps-common.in
--- python/sps-common.in (revision 0)
+++ python/sps-common.in (revision 0)
@@ -0,0 +1,34 @@
+#! /bin/sh
+
+# Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+#
+# This file is part of the Olena Library. This library is free
+# software; you can redistribute it and/or modify it under the terms
+# of the GNU General Public License version 2 as published by the
+# Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this library; see the file COPYING. If not, write to
+# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+# Boston, MA 02111-1307, USA.
+#
+# As a special exception, you may use this file as part of a free
+# software library without restriction. Specifically, if other files
+# instantiate templates or use macros or inline functions from this
+# file, or you compile this file and link it with other files to
+# produce an executable, this file does not by itself cause the
+# resulting executable to be covered by the GNU General Public
+# License.
+# reasons why the executable file might be covered by the GNU General
+# Public License.
+
+# The Swilena Python Shell.
+
+echo 'The Swilena Python Shell (sps).'
+echo 'Type "help", "copyright", "credits" or
"license" for more information.'
+echo 'Type "quit()" or ^D (Ctrl-D) to quit.'
Index: python/sps-local.in
--- python/sps-local.in (revision 0)
+++ python/sps-local.in (revision 0)
@@ -0,0 +1,6 @@
+ # -*- sh -*-
+
+# sps local version, for use from non installed distributions.
+PYTHONPATH='@abs_builddir@/python:@abs_srcdir@/python':"$PYTHONPATH" \
+DYLD_LIBRARY_PATH='.libs:@abs_top_builddir@/src/.libs' \
+exec @PYTHON@ -i @abs_srcdir@/swilena.py "$@"
Index: python/test.py
--- python/test.py (revision 2096)
+++ python/test.py (working copy)
@@ -27,8 +27,7 @@
# reasons why the executable file might be covered by the GNU General
# Public License.
-import ltihooks
-import image2d
+from swilena import *
ima = image2d.image2d_int(3, 3)
image2d.fill_image2d_int(ima, 42)
Index: python/Makefile.am
--- python/Makefile.am (revision 2096)
+++ python/Makefile.am (working copy)
@@ -46,6 +46,22 @@
nodist_python_PYTHON = image2d.py
+## ---------------------------- ##
+## Swilena Python Shell (sps). ##
+## ---------------------------- ##
+
+# FIXME: We might want to rename this shell as something else.
+
+python_PYTHON += swilena.py
+
+# The script to be used in installed distributions.
+bin_SCRIPTS = sps
+# The script to be used in non-installed distributions.
+noinst_SCRIPTS = sps-local
+
+CLEANFILES += $(bin_SCRIPTS) $(noinst_SCRIPTS)
+
+
## ------- ##
## Tests. ##
## ------- ##
Index: python/swilena.py
--- python/swilena.py (revision 0)
+++ python/swilena.py (revision 0)
@@ -0,0 +1,31 @@
+#! /usr/bin/env python
+
+# Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+#
+# This file is part of the Olena Library. This library is free
+# software; you can redistribute it and/or modify it under the terms
+# of the GNU General Public License version 2 as published by the
+# Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this library; see the file COPYING. If not, write to
+# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+# Boston, MA 02111-1307, USA.
+#
+# As a special exception, you may use this file as part of a free
+# software library without restriction. Specifically, if other files
+# instantiate templates or use macros or inline functions from this
+# file, or you compile this file and link it with other files to
+# produce an executable, this file does not by itself cause the
+# resulting executable to be covered by the GNU General Public
+# License.
+# reasons why the executable file might be covered by the GNU General
+# Public License.
+
+import ltihooks
+import image2d
Index: python/sps.in
--- python/sps.in (revision 0)
+++ python/sps.in (revision 0)
@@ -0,0 +1,6 @@
+ # -*- sh -*-
+
+# sps, for use from an installed distribution.
+PYTHONPATH='@pythondir@':"$PYTHONPATH" \
+DYLD_LIBRARY_PATH='@pythondir@:@libdir@' \
+exec @PYTHON@ -i @pythondir@/swilena.py "$@"