Commit 8e57192a authored by mozul's avatar mozul
Browse files

adding sphinx generated documentation of 2015 release candidate

parent 9ab7236d
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 390cfe4236edd989f316075a56418423
tags: 645f666f9bcd5a90fca523b33c5a78b7
import math
from pylmgc90.pre_lmgc import *
nb_particles = 10000
radius_min = 1.0
radius_max = 2.5
radii = granulo_Random(nb_particles, radius_min, radius_max)
lx = 150.
ly = 100.
[nb_laid_particles, coors] = depositInBox2D(radii,lx,ly)
mat = material(name='TDURx', type='RIGID', density=100.)
mod = model(name='rigid', type='MECAx', element='Rxx2D', dimension=2)
# generate the triangles
bodies = avatars()
nb_vertices = 3
for i in range(nb_laid_particles):
body = rigidPolygon(radius=radii[i], center=coors[2*i:2*i+2], nb_vertices=nb_vertices, model=mod, material=mat, color='BLUEx')
bodies.addAvatar(body)
max_radius = max(radii)
mut = material(name='TDURx', type='RIGID', density=1000.)
# left wall : rough wall
left = roughWall( center=[-radius_max, 0.5*ly], theta=-0.5*math.pi, l=ly + 2.*radius_max,
r=radius_max, model=mod, material=mut, color='WALLx')
left.imposeDrivenDof(component=[1,2,3], dofty='vlocy')
bodies.addAvatar(left)
# right wall : not too rough wall
right = fineWall( center=[lx+radius_max, 0.5*ly], theta= 0.5*math.pi, l=ly + 2.*radius_max,
r=radius_max, model=mod, material=mut, color='WALLx')
right.imposeDrivenDof(component=[1,2,3], dofty='vlocy')
bodies.addAvatar(right)
# bottom wall : small wall (why not use a JONCx ?)
bottom = smoothWall( center=[0.5*lx, -radius_max], theta=0., l=lx + 2.*radius_max,
h=2.*radius_max, nb_polyg=12, model=mod, material=mut, color='WALLx')
bottom.imposeDrivenDof(component=[1,2,3], dofty='vlocy')
bodies.addAvatar(bottom)
try:
visuAvatars(bodies)
except:
pass
mats = materials()
mats.addMaterial(mat,mut)
svs = see_tables()
tacts = tact_behavs()
# interaction definition:
lplpl=tact_behav(name='iqsc0', type='IQS_CLB', fric=0.3)
tacts+=lplpl
svplpl = see_table(CorpsCandidat='RBDY2', candidat='POLYG', colorCandidat='BLUEx', behav=lplpl,
CorpsAntagoniste='RBDY2', antagoniste='POLYG', colorAntagoniste='BLUEx', alert=.1)
tacts+=svplpl
svdkpl = see_table(CorpsCandidat='RBDY2', candidat='DISKx', colorCandidat='BLUEx', behav=lplpl,
CorpsAntagoniste='RBDY2', antagoniste='POLYG', colorAntagoniste='WALLx', alert=.1)
svs+=svdkpl
# files writing
writeBodies(bodies,chemin='DATBOX/')
writeBulkBehav(mats,chemin='DATBOX/')
writeTactBehav(tacts,svs,chemin='DATBOX/')
writeDrvDof(bodies,chemin='DATBOX/')
writeDofIni(bodies,chemin='DATBOX/')
writeVlocRlocIni(chemin='DATBOX/')
import numpy
import math
from pylmgc90.pre_lmgc import *
dim = 2
bodies = avatars()
mat = material(name='PLEXx',type='RIGID',density=2000.)
mod = model(name='rigid', type='MECAx', element='Rxx2D', dimension=dim)
# bricks, half-brick, linteau and opening definition
brick = brick2D('brick', 1.e-1, 5.e-2)
half_brick = brick2D('half-brick', 5.e-2, 5.e-2)
linteau = brick2D('linteau', 3.e-1, 5.e-2)
ghost = brick2D('ghost', 2.e-1, 5.e-2)
# joint thickness
horizontal_joint_thickness = 0.001
vertical_joint_thickness = 0.001
# rows definitions
even_row = [half_brick, brick, brick, brick, brick, half_brick]
odd_row = [brick, brick, brick, brick, brick]
even_window_row = [half_brick, brick, ghost, brick, half_brick]
odd_window_row = [brick, half_brick, ghost, half_brick, brick]
linteau_row = [brick, linteau, brick]
# wall as a list of rows
wall = [even_row,
odd_row ,
even_row,
odd_row ,
even_window_row,
odd_window_row ,
even_window_row,
linteau_row ,
even_row ]
# wall building :
nb_bricks=0
x=0.
y=0.
for j in xrange(0, len(wall), 1):
row = wall[j]
if j % 2 == 0:
color='BLUEx'
else:
color='REDxx'
x=0.
for i in xrange(0, len(row), 1):
nb_bricks += 1
brick = row[i]
if i == 0:
y += 0.5*brick.ly
x += 0.5*brick.lx
if brick.name != 'ghost':
bodies += brick.rigidBrick(center=[x, y], model=mod, material=mat, color=color)
x += 0.5*brick.lx + vertical_joint_thickness
y += 0.5*brick.ly + horizontal_joint_thickness
## wall done... everything else (floor and other container)
mats = materials()
svs = see_tables()
tacts = tact_behavs()
mut = material(name='TDURx',type='RIGID',density=2500.)
mats.addMaterial(mat,mut)
floor = rigidJonc(axe1=3.e-1, axe2=2.5e-2, center=[2.5e-1, -2.5e-2],
model=mod, material=mut, color='WALLx')
floor.imposeDrivenDof(component=[1, 2, 3],dofty='vlocy')
bodies += floor
try:
visuAvatars(bodies)
except:
pass
# interactions management :
lplpl=tact_behav(name='iqsc0',type='IQS_CLB',fric=0.3)
tacts+=lplpl
lpljc=tact_behav(name='iqsc1',type='IQS_CLB',fric=0.5)
tacts+=lpljc
svbbbb = see_table(CorpsCandidat='RBDY2',candidat='POLYG', colorCandidat='BLEUx',behav=lplpl,
CorpsAntagoniste='RBDY2', antagoniste='POLYG',colorAntagoniste='BLEUx',alert=5.e-3)
svs+=svbbbb
svbrbr = see_table(CorpsCandidat='RBDY2',candidat='POLYG', colorCandidat='REDxx',behav=lplpl,
CorpsAntagoniste='RBDY2', antagoniste='POLYG',colorAntagoniste='REDxx',alert=5.e-3)
svs+=svbrbr
svbbbr = see_table(CorpsCandidat='RBDY2',candidat='POLYG', colorCandidat='BLEUx',behav=lplpl,
CorpsAntagoniste='RBDY2', antagoniste='POLYG',colorAntagoniste='REDxx',alert=5.e-3)
svs+=svbbbr
svpljc = see_table(CorpsCandidat='RBDY2',candidat='POLYG', colorCandidat='BLEUx',behav=lpljc,
CorpsAntagoniste='RBDY2', antagoniste='JONCx',colorAntagoniste='WALLx',alert=5.e-3)
svs+=svpljc
# file writing
writeBodies(bodies,chemin='DATBOX/')
writeBulkBehav(mats,chemin='DATBOX/')
writeTactBehav(tacts,svs,chemin='DATBOX/')
writeDrvDof(bodies,chemin='DATBOX/')
writeDofIni(bodies,chemin='DATBOX/')
writeVlocRlocIni(chemin='DATBOX/')
import numpy
import math
from pylmgc90.pre_lmgc import *
dim = 2
# disk creation
radius = 0.1
disk = avatar(type='RBDY2', dimension=dim)
disk.addNode( node(type='NO2xx',coor=numpy.array([0.,0.1]),number=1) )
disk.addBulk( rigid2d() )
disk.defineGroups()
disk.addContactors(type='DISKx',color='BLUEx',byrd=radius)
# foundation creation
floor = avatar(type='RBDY2', dimension=dim)
floor.addNode( node(type='NO2xx',coor=numpy.array([0.,-0.05]),number=1) )
floor.addBulk( rigid2d() )
floor.defineGroups()
floor.addContactors(type='JONCx',color='BLUEx',axe1=1.,axe2=0.05)
# materials, model and groups definition
mat = material(name='TDURx',type='RIGID',density=1000.)
mut = material(name='MOUxx',type='RIGID',density=100.)
mod = model(name='rigid', type='MECAx', element='Rxx2D', dimension=dim)
disk.defineModel(model=mod)
disk.defineMaterial(material=mut)
disk.computeRigidProperties()
floor.defineModel(model=mod)
floor.defineMaterial(material=mat)
floor.computeRigidProperties()
# boundary condition
floor.imposeDrivenDof(component=[1,2,3],dofty='vlocy')
# column creation
import copy
nb_disks = 10
column = avatars()
for i in range(nb_disks):
new_disk = copy.deepcopy(disk)
new_disk.translate(dy=i*2.*radius)
column.addAvatar(new_disk)
# copy column
bodies = avatars()
nb_columns = 3
for i in range(nb_columns):
new_columns = copy.deepcopy(column)
new_columns.translate(dx=i*2.*radius)
for body in new_columns:
bodies.addAvatar(body)
# adding floor and rotation sample
bodies.addAvatar(floor)
bodies.rotate(type='axis', alpha=-math.pi/6., axis=[0., 0., 1.], center=[1.,-0.05])
try:
visuAvatars(bodies)
except:
pass
# containers definitions:
mats = materials()
mats.addMaterial(mat,mut)
svs = see_tables()
tacts = tact_behavs()
# interaction definition:
ldkjc=tact_behav(name='iqsc0', type='IQS_CLB', fric=0.3)
tacts+=ldkjc
svdkjc = see_table(CorpsCandidat='RBDY2', candidat='DISKx', colorCandidat='BLUEx', behav=ldkjc,
CorpsAntagoniste='RBDY2', antagoniste='JONCx', colorAntagoniste='BLUEx', alert=.1)
svs+=svdkjc
svdkdk = see_table(CorpsCandidat='RBDY2', candidat='DISKx', colorCandidat='BLUEx', behav=ldkjc,
CorpsAntagoniste='RBDY2', antagoniste='DISKx', colorAntagoniste='BLUEx', alert=.1)
svs+=svdkdk
# files writing
writeBodies(bodies,chemin='DATBOX/')
writeBulkBehav(mats,chemin='DATBOX/')
writeTactBehav(tacts,svs,chemin='DATBOX/')
writeDrvDof(bodies,chemin='DATBOX/')
writeDofIni(bodies,chemin='DATBOX/')
writeVlocRlocIni(chemin='DATBOX/')
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Overview: module code &mdash; pylmgc90.pre 2013 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '2013',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pylmgc90.pre 2013 documentation" href="../index.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../index.html">pylmgc90.pre 2013 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<h1>All modules for which code is available</h1>
<ul><li><a href="pylmgc90/pre_lmgc.html">pylmgc90.pre_lmgc</a></li>
</ul>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../index.html">pylmgc90.pre 2013 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2013, CNRS.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylmgc90.pre_lmgc &mdash; pylmgc90.pre 2013 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../',
VERSION: '2013',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="pylmgc90.pre 2013 documentation" href="../../index.html" />
<link rel="up" title="Module code" href="../index.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../../index.html">pylmgc90.pre 2013 documentation</a> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<h1>Source code for pylmgc90.pre_lmgc</h1><div class="highlight"><pre>
<span class="c"># import du module permettant de savoir si on pourra importer les pre_tools</span>
<span class="kn">from</span> <span class="nn">utilities.check_compiled_modules</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># import des maps permettant de verifier la coherence des donnees</span>
<span class="kn">from</span> <span class="nn">config.lmgc90dicts</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># import de l&#39;objet tact_behav (i.e. definissant les parametres d&#39;une loi de contact)</span>
<span class="kn">from</span> <span class="nn">shared.tact_behav</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># import de l&#39;objet bulk_behav (i.e. definissant les parametres materiau)</span>
<span class="kn">from</span> <span class="nn">shared.bulk_behav</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># import de l&#39;objet postpro_command (i.e. definissant une commande de post-traitement) </span>
<span class="kn">from</span> <span class="nn">shared.postpro_command</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># import de l&#39;objet model (i.e. definissant un modele, mecanique ou thermique)</span>
<span class="kn">from</span> <span class="nn">shared.model</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># import des conteneneurs</span>
<span class="c"># * d&#39;avatars</span>
<span class="kn">from</span> <span class="nn">avatars</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * de modeles</span>
<span class="kn">from</span> <span class="nn">models</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * de materiaux</span>
<span class="kn">from</span> <span class="nn">bulk_behavs</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * de loi de contact</span>
<span class="kn">from</span> <span class="nn">tact_behavs</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * de commandes de post-traitement</span>
<span class="kn">from</span> <span class="nn">postpro_commands</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># import des differents modules de build_avatar</span>
<span class="c"># * module de creation de briques 2D, ou 3D</span>
<span class="kn">from</span> <span class="nn">build_avatar.brick</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * module de creation de rangees de briques 3D</span>
<span class="kn">from</span> <span class="nn">build_avatar.brick_row</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * module de creation de rangees de mur de briques 3D</span>
<span class="kn">from</span> <span class="nn">build_avatar.brick_wall</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * module d&#39;extrusion de corps rigides 2D, pour obtenir des corps rigides 3D</span>
<span class="kn">from</span> <span class="nn">build_avatar.extrusion</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * module de gestion de maillage generique (2D/3D)</span>
<span class="kn">from</span> <span class="nn">build_avatar.mesh</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * module de gestion de maillage 2D</span>
<span class="kn">from</span> <span class="nn">build_avatar.mesh2D</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * module de gestion de maillage 3D</span>
<span class="kn">from</span> <span class="nn">build_avatar.mesh3D</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c">## * module de lecture de maillages</span>
<span class="kn">from</span> <span class="nn">build_avatar.lecture</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * module de creation de particules 2D, ou 3D</span>
<span class="kn">from</span> <span class="nn">build_avatar.particles</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># import des macros fournisant les fonctionnalites des anciens pre-processeurs pour mes milieux granulaires</span>
<span class="kn">from</span> <span class="nn">build_avatar.tools.granulometry</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># si on peut essayer d&#39;importer le module pre_tools sans tout faire planter</span>
<span class="k">if</span> <span class="n">import_lmgc90</span><span class="p">():</span>
<span class="c"># on essaye</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="c"># * import des macros de depot de grains</span>
<span class="c"># - dans un conteneneur 2D</span>
<span class="kn">from</span> <span class="nn">build_avatar.tools.containers2D</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># - dans un conteneneur 3D</span>
<span class="kn">from</span> <span class="nn">build_avatar.tools.containers3D</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># import du module de creation de parois 2D (reposant sur le module fournissant les fonctions permettant de</span>
<span class="c"># choisir la granulometrie)</span>
<span class="kn">from</span> <span class="nn">build_avatar.walls</span> <span class="kn">import</span> <span class="o">*</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
<span class="k">print</span> <span class="s">&#39;Unable to import wrapped part of the granular media module!&#39;</span>
<span class="k">print</span> <span class="s">&#39;You cannot use granulometry facilities or deposit grains in a container&#39;</span>
<span class="k">except</span><span class="p">:</span>
<span class="k">raise</span>
<span class="c"># sinon,</span>
<span class="k">else</span><span class="p">:</span>
<span class="c"># on explique que c&#39;est impossible</span>
<span class="k">print</span> <span class="s">&#39;Unable to import wrapped part of the granular media module!&#39;</span>
<span class="k">print</span> <span class="s">&#39;You cannot use granulometry facilities or deposit grains in a container&#39;</span>
<span class="c"># - sur un reseau 2D</span>
<span class="kn">from</span> <span class="nn">build_avatar.lattices2D</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># - sur un reseau 3D</span>
<span class="kn">from</span> <span class="nn">build_avatar.lattices3D</span> <span class="kn">import</span> <span class="o">*</span>
<span class="k">try</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">build_avatar.medpre</span> <span class="kn">import</span> <span class="o">*</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
<span class="k">print</span> <span class="s">&#39;Unable to import med file reading&#39;</span>
<span class="k">except</span><span class="p">:</span>
<span class="k">raise</span>
<span class="c"># import des fonctions d&#39;ecriture des fichiers decrivant</span>
<span class="c"># * la geometrie des corps (BODIES.DAT)</span>
<span class="kn">from</span> <span class="nn">files.bodiesFile</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * les modeles (MODELS.DAT)</span>
<span class="kn">from</span> <span class="nn">files.modelFile</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * les parametres materiaux (BULK_BEHAV.DAT)</span>
<span class="kn">from</span> <span class="nn">files.bulkBehavFile</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * les lois de contat et les tables de visibilite (TACT_BEHAV.DAT)</span>
<span class="kn">from</span> <span class="nn">files.dofIniFile</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * les conditions limites (DRV_DOF.DAT)</span>
<span class="kn">from</span> <span class="nn">files.tactBehavFile</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * les valeurs des ddl iniales (DOF.INI)</span>
<span class="kn">from</span> <span class="nn">files.drvDofFile</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * les valeurs aux points de Gauss iniales (GPV.INI)</span>
<span class="kn">from</span> <span class="nn">files.gpvIniFile</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * les contacts initiaux (Vloc_Rloc.INI)</span>
<span class="kn">from</span> <span class="nn">files.vlocrlocIniFile</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * les fichiers d&#39;evolution, pour les conditions limites</span>
<span class="kn">from</span> <span class="nn">files.evolutionFile</span> <span class="kn">import</span> <span class="o">*</span>
<span class="c"># * les commandes de post-traitement (POSTPRO.DAT)</span>
<span class="kn">from</span> <span class="nn">files.postproFile</span> <span class="kn">import</span> <span class="o">*</span>
<span class="k">try</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">viz.visuVtk</span> <span class="kn">import</span> <span class="o">*</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
<span class="k">print</span> <span class="s">&#39;Unable to import visualization module with vtk&#39;</span>
<span class="k">except</span><span class="p">:</span>
<span class="k">raise</span>
<span class="c"># si on peut essayer d&#39;importer le module lmgc90 sans tout faire planter</span>
<span class="k">if</span> <span class="n">import_lmgc90</span><span class="p">():</span>
<span class="c"># on essaye</span>
<span class="k">try</span><span class="p">:</span>
<span class="c"># import melimelo reading/writing</span>
<span class="kn">from</span> <span class="nn">build_avatar.melimeloLecture</span> <span class="kn">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">files.melimeloFile</span> <span class="kn">import</span> <span class="o">*</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
<span class="k">print</span> <span class="s">&#39;Unable to import melimelo reading/writing functions&#39;</span>
<span class="k">except</span><span class="p">:</span>
<span class="k">raise</span>
<span class="c"># sinon,</span>
<span class="k">else</span><span class="p">:</span>
<span class="c"># on explique que c&#39;est impossible</span>
<span class="k">print</span> <span class="s">&#39;Unable to import lmgc90 module for transfert to melimelo!&#39;</span>
<span class="k">print</span> <span class="s">&#39;You cannot use melimelo&#39;</span>