Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Romin Tomasetti
gmsh
Commits
f7bf94a0
Commit
f7bf94a0
authored
11 years ago
by
Jonathan Lambrechts
Browse files
Options
Downloads
Patches
Plain Diff
onelab.py : compatibility with python3
parent
3a085360
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/onelab/python/onelab.py
+8
-8
8 additions, 8 deletions
contrib/onelab/python/onelab.py
with
8 additions
and
8 deletions
contrib/onelab/python/onelab.py
+
8
−
8
View file @
f7bf94a0
...
@@ -216,7 +216,7 @@ class client :
...
@@ -216,7 +216,7 @@ class client :
if
t
==
self
.
_GMSH_PARAMETER
:
if
t
==
self
.
_GMSH_PARAMETER
:
p
.
fromchar
(
msg
).
choices
.
append
(
value
)
p
.
fromchar
(
msg
).
choices
.
append
(
value
)
elif
t
==
self
.
_GMSH_PARAMETER_NOT_FOUND
:
elif
t
==
self
.
_GMSH_PARAMETER_NOT_FOUND
:
print
'
Unknown parameter %s
'
%
(
param
.
name
)
print
(
'
Unknown parameter %s
'
%
(
param
.
name
)
)
self
.
_send
(
self
.
_GMSH_PARAMETER
,
p
.
tochar
())
self
.
_send
(
self
.
_GMSH_PARAMETER
,
p
.
tochar
())
def
_get_parameter
(
self
,
param
,
warn_if_not_found
=
True
)
:
def
_get_parameter
(
self
,
param
,
warn_if_not_found
=
True
)
:
...
@@ -227,7 +227,7 @@ class client :
...
@@ -227,7 +227,7 @@ class client :
if
t
==
self
.
_GMSH_PARAMETER
:
if
t
==
self
.
_GMSH_PARAMETER
:
param
.
fromchar
(
msg
)
param
.
fromchar
(
msg
)
elif
t
==
self
.
_GMSH_PARAMETER_NOT_FOUND
and
warn_if_not_found
:
elif
t
==
self
.
_GMSH_PARAMETER_NOT_FOUND
and
warn_if_not_found
:
print
'
Unknown parameter %s
'
%
(
param
.
name
)
print
(
'
Unknown parameter %s
'
%
(
param
.
name
)
)
def
getNumber
(
self
,
name
,
warn_if_not_found
=
True
):
def
getNumber
(
self
,
name
,
warn_if_not_found
=
True
):
param
=
_parameter
(
'
number
'
,
name
=
name
)
param
=
_parameter
(
'
number
'
,
name
=
name
)
...
@@ -246,9 +246,9 @@ class client :
...
@@ -246,9 +246,9 @@ class client :
self
.
_send
(
self
.
_GMSH_PARAMETER_QUERY
,
param
.
tochar
())
self
.
_send
(
self
.
_GMSH_PARAMETER_QUERY
,
param
.
tochar
())
(
t
,
msg
)
=
self
.
_receive
()
(
t
,
msg
)
=
self
.
_receive
()
if
t
==
self
.
_GMSH_PARAMETER
:
if
t
==
self
.
_GMSH_PARAMETER
:
print
msg
print
(
msg
)
elif
t
==
self
.
_GMSH_PARAMETER_NOT_FOUND
:
elif
t
==
self
.
_GMSH_PARAMETER_NOT_FOUND
:
print
'
Unknown parameter %s
'
%
(
name
)
print
(
'
Unknown parameter %s
'
%
(
name
)
)
def
openGeometry
(
self
,
filename
)
:
def
openGeometry
(
self
,
filename
)
:
if
not
self
.
socket
or
not
filename
:
if
not
self
.
socket
or
not
filename
:
...
@@ -282,19 +282,19 @@ class client :
...
@@ -282,19 +282,19 @@ class client :
def
sendInfo
(
self
,
msg
)
:
def
sendInfo
(
self
,
msg
)
:
if
not
self
.
socket
:
if
not
self
.
socket
:
print
msg
print
(
msg
)
return
return
self
.
_send
(
self
.
_GMSH_INFO
,
msg
)
self
.
_send
(
self
.
_GMSH_INFO
,
msg
)
def
sendWarning
(
self
,
msg
)
:
def
sendWarning
(
self
,
msg
)
:
if
not
self
.
socket
:
if
not
self
.
socket
:
print
msg
print
(
msg
)
return
return
self
.
_send
(
self
.
_GMSH_WARNING
,
msg
)
self
.
_send
(
self
.
_GMSH_WARNING
,
msg
)
def
sendError
(
self
,
msg
)
:
def
sendError
(
self
,
msg
)
:
if
not
self
.
socket
:
if
not
self
.
socket
:
print
msg
print
(
msg
)
return
return
self
.
_send
(
self
.
_GMSH_ERROR
,
msg
)
self
.
_send
(
self
.
_GMSH_ERROR
,
msg
)
...
@@ -304,7 +304,7 @@ class client :
...
@@ -304,7 +304,7 @@ class client :
self
.
_send
(
self
.
_GMSH_OLPARSE
,
filename
)
self
.
_send
(
self
.
_GMSH_OLPARSE
,
filename
)
(
t
,
msg
)
=
self
.
_receive
()
(
t
,
msg
)
=
self
.
_receive
()
if
t
==
self
.
_GMSH_OLPARSE
:
if
t
==
self
.
_GMSH_OLPARSE
:
print
msg
print
(
msg
)
def
_createSocket
(
self
)
:
def
_createSocket
(
self
)
:
addr
=
self
.
addr
addr
=
self
.
addr
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment