From 903bdeb84a5135ccf172b1bdae76fdf1066d28ff Mon Sep 17 00:00:00 2001
From: Jonathan Lambrechts <jonathan.lambrechts@uclouvain.be>
Date: Mon, 24 Dec 2012 13:22:25 +0000
Subject: [PATCH] onelab python client : remove symlinks in test

---
 .../onelab/python/wrappers/OnelabClient.py    |  1 +
 contrib/onelab/python/wrappers/test.ol        |  3 ++-
 contrib/onelab/python/wrappers/test.py        | 21 ++++++++++++++++++-
 3 files changed, 23 insertions(+), 2 deletions(-)
 mode change 120000 => 100755 contrib/onelab/python/wrappers/test.ol
 mode change 120000 => 100755 contrib/onelab/python/wrappers/test.py

diff --git a/contrib/onelab/python/wrappers/OnelabClient.py b/contrib/onelab/python/wrappers/OnelabClient.py
index 6ec8641976..3677a6a1d9 100755
--- a/contrib/onelab/python/wrappers/OnelabClient.py
+++ b/contrib/onelab/python/wrappers/OnelabClient.py
@@ -50,6 +50,7 @@ class client :
 
   def __init__(self):
     self.client = None
+    self.name = ""
     for i, v in enumerate(sys.argv) :
       if v == '-onelab':
         self.name = sys.argv[i + 1]
diff --git a/contrib/onelab/python/wrappers/test.ol b/contrib/onelab/python/wrappers/test.ol
deleted file mode 120000
index 200dd10d85..0000000000
--- a/contrib/onelab/python/wrappers/test.ol
+++ /dev/null
@@ -1 +0,0 @@
-../test.ol
\ No newline at end of file
diff --git a/contrib/onelab/python/wrappers/test.ol b/contrib/onelab/python/wrappers/test.ol
new file mode 100755
index 0000000000..79463f51e7
--- /dev/null
+++ b/contrib/onelab/python/wrappers/test.ol
@@ -0,0 +1,2 @@
+Native.register(native, ./test.py);
+Native.run();
diff --git a/contrib/onelab/python/wrappers/test.py b/contrib/onelab/python/wrappers/test.py
deleted file mode 120000
index 40a41e7dea..0000000000
--- a/contrib/onelab/python/wrappers/test.py
+++ /dev/null
@@ -1 +0,0 @@
-../test.py
\ No newline at end of file
diff --git a/contrib/onelab/python/wrappers/test.py b/contrib/onelab/python/wrappers/test.py
new file mode 100755
index 0000000000..631bb7070f
--- /dev/null
+++ b/contrib/onelab/python/wrappers/test.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+#coding=utf-8
+import OnelabClient
+
+oc = OnelabClient.client()
+
+#name and default value are required
+A = oc.get_number('A', 10)
+#other attributes are optionals
+B = oc.get_number('Group/B', 0, min = -10, max = 10, step = 1)
+C = oc.get_number('Group/C', 2, choices = [0, 1, 2, 3], attributes={'Highlight':'Pink'})
+D = oc.get_number('Group/D', 2, labels = {0:'zero', 1:'un', 2:'deux', 3:'trois'}, attributes={'Highlight':'Blue'})
+#utf-8 are allowed everywhere (should be prefixed by 'u' in python 2, not required in python 3)
+Omega = oc.get_string(u'Ω', u'∫(∂φ/∂α)³dx', help=u'ask someone@universe.org', choices = ['oui', 'non', u'peut-être'])
+
+if oc.action != 'compute' :
+  exit(0)
+
+#this is the solver code
+print (A, B, C, str(Omega))
-- 
GitLab