mirror of
https://gitlab.com/scemama/irpf90.git
synced 2024-06-02 11:25:19 +02:00
Every thing are templated
This commit is contained in:
parent
6bc15db94a
commit
8a31b6302c
2602
src/ashes.py
2602
src/ashes.py
File diff suppressed because it is too large
Load Diff
|
@ -24,11 +24,7 @@
|
||||||
# 31062 Toulouse Cedex 4
|
# 31062 Toulouse Cedex 4
|
||||||
# scemama@irsamc.ups-tlse.fr
|
# scemama@irsamc.ups-tlse.fr
|
||||||
|
|
||||||
try:
|
from lib.manager import irpy
|
||||||
import irpy
|
|
||||||
except:
|
|
||||||
import lib_irpy as irpy
|
|
||||||
|
|
||||||
|
|
||||||
import getopt, sys
|
import getopt, sys
|
||||||
from version import version
|
from version import version
|
||||||
|
|
105
src/entity.py
105
src/entity.py
|
@ -28,11 +28,7 @@ from irpf90_t import *
|
||||||
from util import *
|
from util import *
|
||||||
from command_line import command_line
|
from command_line import command_line
|
||||||
import sys
|
import sys
|
||||||
try:
|
from lib.manager import irpy
|
||||||
import irpy
|
|
||||||
except:
|
|
||||||
import lib_irpy as irpy
|
|
||||||
|
|
||||||
|
|
||||||
class Entity(object):
|
class Entity(object):
|
||||||
'''All lines between BEGIN_PROVIDER and END_PROVIDER included
|
'''All lines between BEGIN_PROVIDER and END_PROVIDER included
|
||||||
|
@ -164,92 +160,35 @@ class Entity(object):
|
||||||
return any(self.d_entity[i].is_written for i in self.parents)
|
return any(self.d_entity[i].is_written for i in self.parents)
|
||||||
|
|
||||||
@irpy.lazy_property
|
@irpy.lazy_property
|
||||||
def writer(self):
|
def io_er(self):
|
||||||
if not self.is_main:
|
if not self.is_main:
|
||||||
result = []
|
result = []
|
||||||
else:
|
|
||||||
from util import mangled
|
from util import mangled
|
||||||
name = self.name
|
from util import ashes_env
|
||||||
result = [ \
|
name = self.name
|
||||||
"subroutine writer_%s(irp_num)"%(name),
|
|
||||||
" use %s"%(self.fmodule),
|
d_template= {'name':name,
|
||||||
" implicit none",
|
'fmodule':self.fmodule,
|
||||||
" character*(*), intent(in) :: irp_num",
|
'same_as' : self.same_as,
|
||||||
" logical :: irp_is_open",
|
'do_debug':command_line.do_debug,
|
||||||
" integer :: irp_iunit" ]
|
'children':mangled(self.needs,self.d_entity),
|
||||||
if command_line.do_debug:
|
'group_entity': [{'name':n,'dim':build_dim(self.cm_d_variable[n].dim,colons=True)} for n in self.l_name]}
|
||||||
length = len("writer_%s" % (self.name))
|
|
||||||
result += [\
|
|
||||||
" character*(%d) :: irp_here = 'writer_%s'"%(length,name),
|
return ashes_env('io.f90',d_template).split('\n')
|
||||||
" call irp_enter(irp_here)" ]
|
|
||||||
result += [ \
|
def reader(self):
|
||||||
" if (.not.%s_is_built) then"%(self.same_as),
|
return io.er.split('TOKEN_SPLIT')[0]
|
||||||
" call provide_%s"%(self.same_as),
|
|
||||||
" endif" ]
|
def writer(self):
|
||||||
result += map(lambda x: " call writer_%s(irp_num)" % (x), mangles(self.needs))
|
return io.er.split('TOKEN_SPLIT')[1]
|
||||||
result += [ \
|
|
||||||
" irp_is_open = .True.",
|
|
||||||
" irp_iunit = 9",
|
|
||||||
" do while (irp_is_open)",
|
|
||||||
" irp_iunit = irp_iunit+1",
|
|
||||||
" inquire(unit=irp_iunit,opened=irp_is_open)",
|
|
||||||
" enddo" ]
|
|
||||||
for n in self.l_name:
|
|
||||||
result += [\
|
|
||||||
" open(unit=irp_iunit,file='irpf90_%s_'//trim(irp_num),form='FORMATTED',status='UNKNOWN',action='WRITE')"%(n),
|
|
||||||
" write(irp_iunit,*) %s%s"%(n,build_dim(self.d_entity[n].dim,colons=True)),
|
|
||||||
" close(irp_iunit)" ]
|
|
||||||
if command_line.do_debug:
|
|
||||||
result.append(" call irp_leave(irp_here)")
|
|
||||||
result.append("end subroutine writer_%s" % (name))
|
|
||||||
result.append("")
|
|
||||||
return result
|
|
||||||
|
|
||||||
@irpy.lazy_property_mutable
|
@irpy.lazy_property_mutable
|
||||||
def is_read(self):
|
def is_read(self):
|
||||||
'''Check if it will be read from disk'''
|
'''Check if it will be read from disk'''
|
||||||
return any(self.d_entity[i].is_read for i in self.parents)
|
return any(self.d_entity[i].is_read for i in self.parents)
|
||||||
|
|
||||||
@irpy.lazy_property
|
|
||||||
def reader(self):
|
|
||||||
if not self.is_main:
|
|
||||||
result = []
|
|
||||||
else:
|
|
||||||
from util import mangled
|
|
||||||
name = self.name
|
|
||||||
result = [ \
|
|
||||||
"subroutine reader_%s(irp_num)"%(name),
|
|
||||||
" use %s"%(self.fmodule),
|
|
||||||
" implicit none",
|
|
||||||
" character*(*), intent(in) :: irp_num",
|
|
||||||
" logical :: irp_is_open",
|
|
||||||
" integer :: irp_iunit" ]
|
|
||||||
if command_line.do_debug:
|
|
||||||
length = len("reader_%s" % (name))
|
|
||||||
result += [\
|
|
||||||
" character*(%d) :: irp_here = 'reader_%s'"%(length,name),
|
|
||||||
" call irp_enter(irp_here)" ]
|
|
||||||
result += map(lambda x: " call reader_%s(irp_num)" % (x), mangled(self.needs))
|
|
||||||
result += [ \
|
|
||||||
" irp_is_open = .True.",
|
|
||||||
" irp_iunit = 9",
|
|
||||||
" do while (irp_is_open)",
|
|
||||||
" inquire(unit=irp_iunit,opened=irp_is_open)",
|
|
||||||
" enddo"]
|
|
||||||
for n in self.l_name:
|
|
||||||
result += [\
|
|
||||||
" open(unit=irp_iunit,file='irpf90_%s_'//trim(irp_num),form='FORMATTED',status='OLD',action='READ')"%(n),
|
|
||||||
" read(irp_iunit,*) %s%s"%(n,build_dim(self.cm_d_variable[n].dim,colons=True)),
|
|
||||||
" close(irp_iunit)" ]
|
|
||||||
result += [ \
|
|
||||||
" call touch_%s"%(name),
|
|
||||||
" %s_is_built = .True."%(name) ]
|
|
||||||
if command_line.do_debug:
|
|
||||||
result.append(" call irp_leave(irp_here)")
|
|
||||||
result.append("end subroutine reader_%s" % (name))
|
|
||||||
result.append("")
|
|
||||||
return result
|
|
||||||
|
|
||||||
@irpy.lazy_property
|
@irpy.lazy_property
|
||||||
def is_source_touch(self):
|
def is_source_touch(self):
|
||||||
return (Touch in self.d_type_lines or SoftTouch in self.d_type_lines)
|
return (Touch in self.d_type_lines or SoftTouch in self.d_type_lines)
|
||||||
|
|
|
@ -32,11 +32,8 @@ from zlib import crc32
|
||||||
import os
|
import os
|
||||||
irp_id = abs(crc32(os.getcwd()))
|
irp_id = abs(crc32(os.getcwd()))
|
||||||
|
|
||||||
try:
|
from lib.manager import irpy
|
||||||
import irpy
|
from util import logger
|
||||||
except:
|
|
||||||
import lib_irpy as irpy
|
|
||||||
|
|
||||||
|
|
||||||
class Line(object):
|
class Line(object):
|
||||||
def __init__(self, i, text, filename):
|
def __init__(self, i, text, filename):
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
from util import parmap, lazy_write_file
|
from util import parmap, lazy_write_file
|
||||||
from util import flatten, listdir
|
from util import flatten, listdir
|
||||||
|
from util import logger
|
||||||
|
|
||||||
try:
|
from lib.manager import irpy
|
||||||
import irpy
|
|
||||||
except:
|
|
||||||
import lib_irpy as irpy
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import irpf90_t
|
import irpf90_t
|
||||||
|
@ -12,9 +10,6 @@ import sys
|
||||||
|
|
||||||
from command_line import command_line
|
from command_line import command_line
|
||||||
|
|
||||||
from util import logger
|
|
||||||
|
|
||||||
|
|
||||||
class Irpy_comm_world(object):
|
class Irpy_comm_world(object):
|
||||||
'''Maestro.'''
|
'''Maestro.'''
|
||||||
|
|
||||||
|
|
160
src/lib_irpy.py
160
src/lib_irpy.py
|
@ -1,160 +0,0 @@
|
||||||
#Handle the execution stack
|
|
||||||
from collections import defaultdict
|
|
||||||
d_path = defaultdict(list)
|
|
||||||
d_last_caller = defaultdict(lambda: None)
|
|
||||||
|
|
||||||
def genealogy(obj, _node, direction,degree_max=100):
|
|
||||||
"""Return the genealogy of a _node.
|
|
||||||
Direction is $parents or $children, recurse accordingly"""
|
|
||||||
|
|
||||||
def sap(_node, direction, visited=set(), degree=0):
|
|
||||||
|
|
||||||
visited.add(_node)
|
|
||||||
try:
|
|
||||||
s = getattr(obj, "{0}_{1}".format(_node, direction))
|
|
||||||
except AttributeError:
|
|
||||||
s = set()
|
|
||||||
|
|
||||||
for next_ in s - visited:
|
|
||||||
|
|
||||||
if degree < degree_max:
|
|
||||||
sap(next_, direction, visited, degree+1)
|
|
||||||
|
|
||||||
return visited
|
|
||||||
|
|
||||||
s = sap(_node, direction) - set([_node])
|
|
||||||
|
|
||||||
return s
|
|
||||||
|
|
||||||
|
|
||||||
def addattr(obj, name, value):
|
|
||||||
try:
|
|
||||||
s = getattr(obj, name)
|
|
||||||
except AttributeError:
|
|
||||||
setattr(obj, name, set([value]))
|
|
||||||
else:
|
|
||||||
setattr(obj, name, s | set([value]))
|
|
||||||
|
|
||||||
def removeattr(obj, name, value):
|
|
||||||
try:
|
|
||||||
s = getattr(obj, name)
|
|
||||||
except AttributeError:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
setattr(obj, name, s - set([value]))
|
|
||||||
|
|
||||||
|
|
||||||
# _
|
|
||||||
# | \ _ _ _ ._ _. _|_ _ ._
|
|
||||||
# |_/ (/_ (_ (_) | (_| |_ (_) |
|
|
||||||
#
|
|
||||||
class lazy_property(object):
|
|
||||||
"""
|
|
||||||
My little Property
|
|
||||||
My little Property
|
|
||||||
My little Property... friend
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, provider, init_node=False, immutable=True):
|
|
||||||
"""Provider: If a function who will be used to compute the node
|
|
||||||
init_node: If the name of the node
|
|
||||||
immutable: If immutable is set you cannot set the node"""
|
|
||||||
|
|
||||||
self.provider = provider
|
|
||||||
self.init_node = init_node
|
|
||||||
self.immutable = immutable
|
|
||||||
|
|
||||||
if not self.init_node:
|
|
||||||
name = provider.__name__
|
|
||||||
else:
|
|
||||||
name = self.init_node
|
|
||||||
|
|
||||||
#Kind of human readable identifier
|
|
||||||
self._node = "_%s_%s" % (name, id(provider))
|
|
||||||
|
|
||||||
def __get__(self, obj, objtype):
|
|
||||||
"Get the value of the node and handle the genealogy"
|
|
||||||
|
|
||||||
_node = self._node
|
|
||||||
|
|
||||||
if d_path[obj]:
|
|
||||||
_caller = d_path[obj][-1]
|
|
||||||
if _caller != d_last_caller[obj]:
|
|
||||||
addattr(obj, "%s_parents" % _node, _caller)
|
|
||||||
addattr(obj, "%s_children" % _caller, _node)
|
|
||||||
d_last_caller[obj] = _caller
|
|
||||||
|
|
||||||
#Wanted: value. Cached or Computed
|
|
||||||
try:
|
|
||||||
value = getattr(obj, _node)
|
|
||||||
except AttributeError:
|
|
||||||
|
|
||||||
d_path[obj].append(_node)
|
|
||||||
|
|
||||||
value = self.provider(obj)
|
|
||||||
setattr(obj, _node, value)
|
|
||||||
|
|
||||||
d_path[obj].pop()
|
|
||||||
|
|
||||||
return value
|
|
||||||
|
|
||||||
def __set__(self, obj, value):
|
|
||||||
"""Set the value of the node
|
|
||||||
But wait, init_node are "gradual typed" variable! Youpi!
|
|
||||||
Idea borrowed from the-worst-programming-language-ever (http://bit.ly/13tc6XW)
|
|
||||||
"""
|
|
||||||
|
|
||||||
_node = self._node
|
|
||||||
|
|
||||||
if not self.init_node:
|
|
||||||
|
|
||||||
if self.immutable:
|
|
||||||
raise AttributeError("Immutable Node {0}".format(self._node))
|
|
||||||
|
|
||||||
#Set the new value
|
|
||||||
setattr(obj, _node, value)
|
|
||||||
|
|
||||||
#Node ancestor need to be recompute is asked
|
|
||||||
for _parent in genealogy(obj, _node, "parents"):
|
|
||||||
if hasattr(obj, _parent): delattr(obj, _parent)
|
|
||||||
|
|
||||||
#Node abandoned her children,
|
|
||||||
for _child in genealogy(obj, _node, "children",degree_max=1):
|
|
||||||
removeattr(obj, "%s_parents" % _child, _node)
|
|
||||||
|
|
||||||
#Indeed node is now a leaf
|
|
||||||
setattr(obj, "%s_children" % _node, set())
|
|
||||||
|
|
||||||
else:
|
|
||||||
setattr(obj, _node, value)
|
|
||||||
self.init_node = False
|
|
||||||
|
|
||||||
|
|
||||||
def lazy_property_mutable(provider):
|
|
||||||
"Return a lazy_property mutable"
|
|
||||||
return lazy_property(provider=provider, immutable=False)
|
|
||||||
|
|
||||||
|
|
||||||
def lazy_property_leaves(mutables=(), immutables=()):
|
|
||||||
"Set to properties for the __init__ method"
|
|
||||||
|
|
||||||
def leaf_decorator(func):
|
|
||||||
def func_wrapper(self, *args, **kwargs):
|
|
||||||
|
|
||||||
for node in set(immutables) | set(mutables):
|
|
||||||
|
|
||||||
def provider(self):
|
|
||||||
return getattr(self, "_%s" % node)
|
|
||||||
|
|
||||||
p = lazy_property(provider=provider,
|
|
||||||
init_node=node,
|
|
||||||
immutable=node in immutables)
|
|
||||||
|
|
||||||
#If this ugly? Yeah... Is this an issue? I don't really know
|
|
||||||
setattr(self.__class__, node, p)
|
|
||||||
|
|
||||||
return func(self, *args, **kwargs)
|
|
||||||
|
|
||||||
return func_wrapper
|
|
||||||
|
|
||||||
return leaf_decorator
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/unr/bin/env python
|
#!/usr/bin/env python
|
||||||
# IRPF90 is a Fortran90 preprocessor written in Python for programming using
|
# IRPF90 is a Fortran90 preprocessor written in Python for programming using
|
||||||
# the Implicit Reference to Parameters (IRP) method.
|
# the Implicit Reference to Parameters (IRP) method.
|
||||||
# Copyright (C) 2009 Anthony SCEMAMA
|
# Copyright (C) 2009 Anthony SCEMAMA
|
||||||
|
|
|
@ -59,6 +59,7 @@ simple_dict = {
|
||||||
"begin_provider": Begin_provider,
|
"begin_provider": Begin_provider,
|
||||||
"begin_provider_immutable": Begin_provider,
|
"begin_provider_immutable": Begin_provider,
|
||||||
"&begin_provider": Cont_provider,
|
"&begin_provider": Cont_provider,
|
||||||
|
"&begin_provider_immutable": Cont_provider,
|
||||||
"end_provider": End_provider,
|
"end_provider": End_provider,
|
||||||
"end_provider_immutable": End_provider,
|
"end_provider_immutable": End_provider,
|
||||||
"assert": Assert,
|
"assert": Assert,
|
||||||
|
|
|
@ -28,11 +28,7 @@
|
||||||
from irpf90_t import *
|
from irpf90_t import *
|
||||||
|
|
||||||
from util import logger
|
from util import logger
|
||||||
|
from lib.manager import irpy
|
||||||
try:
|
|
||||||
import irpy
|
|
||||||
except:
|
|
||||||
import lib_irpy as irpy
|
|
||||||
|
|
||||||
class Routine(object):
|
class Routine(object):
|
||||||
'''
|
'''
|
||||||
|
|
71
src/templates/ioer.f90
Normal file
71
src/templates/ioer.f90
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
SUBROUTINE write_{name}(irp_num)
|
||||||
|
|
||||||
|
USE {fmodule}
|
||||||
|
IMPLICIT NONE
|
||||||
|
|
||||||
|
CHARACTER*(*), INTENT(IN) :: irp_num
|
||||||
|
LOGICAL :: irp_is_open = .TRUE.
|
||||||
|
INTEGER :: irp_iunit = 9
|
||||||
|
|
||||||
|
{?do_debug}
|
||||||
|
CHARACTER*(7+{@size key=name/}),PARAMETER :: irp_here = 'writer_{name}'
|
||||||
|
{/do_debug}
|
||||||
|
|
||||||
|
{?do_debug} CALL irp_enter(irp_here) {/do_debug}
|
||||||
|
|
||||||
|
IF (.NOT.{same_as}_is_built) THEN
|
||||||
|
CALL provide_{same_as}
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
{children}
|
||||||
|
CALL write_{.}(irp_num)
|
||||||
|
{/children}
|
||||||
|
|
||||||
|
DO WHILE (irp_is_open)
|
||||||
|
irp_iunit = irp_inuit + 1
|
||||||
|
INQUIRE(UNIT=irp_inuit, OPENED=irp_is_open)
|
||||||
|
END DO
|
||||||
|
|
||||||
|
{#group_entity}
|
||||||
|
OPEN(UNIT=irp_inuit,file='irpf90_{name}_'//trim(irp_num),FROM='FORMATTED',STATUS='UNKNOWN',ACTION='WRITE')
|
||||||
|
WRITE(irp_inuit,*) {.}{dim}
|
||||||
|
CLOSE(irp_inuit)
|
||||||
|
{/group_entity}
|
||||||
|
|
||||||
|
{?do_debug} CALL irp_leave(irp_here) {/do_debug}
|
||||||
|
|
||||||
|
END SUBROUTINE write_{name}
|
||||||
|
|
||||||
|
!TOKEN_SPLIT
|
||||||
|
|
||||||
|
SUBROUTINE read_{name}(irp_num)
|
||||||
|
|
||||||
|
USE {fmodule}
|
||||||
|
IMPLICIT NONE
|
||||||
|
|
||||||
|
CHARACTER*(*), INTENT(IN) :: irp_num
|
||||||
|
LOGICAL :: irp_is_open = .TRUE.
|
||||||
|
INTEGER :: irp_iunit = 9
|
||||||
|
|
||||||
|
{?do_debug}
|
||||||
|
CHARACTER*(5+{@size key=name/}),PARAMETER :: irp_here = 'read_{name}'
|
||||||
|
{/do_debug}
|
||||||
|
|
||||||
|
{?do_debug} CALL irp_enter(irp_here) {/do_debug}
|
||||||
|
|
||||||
|
DO WHILE (irp_is_open)
|
||||||
|
irp_iunit = irp_inuit + 1
|
||||||
|
INQUIRE(UNIT=irp_inuit, OPENED=irp_is_open)
|
||||||
|
END DO
|
||||||
|
|
||||||
|
{#group_entity}
|
||||||
|
OPEN(UNIT=irp_inuit,file='irpf90_{name}_'//trim(irp_num),FROM='FORMATTED',STATUS='UNKNOWN',ACTION='WRITE')
|
||||||
|
READ(irp_inuit,*) {name}{dim}
|
||||||
|
CLOSE(irp_inuit)
|
||||||
|
{/group_entity}
|
||||||
|
|
||||||
|
CALL touch_{name}
|
||||||
|
{?do_debug} CALL irp_leave(irp_here) {/do_debug}
|
||||||
|
|
||||||
|
END SUBROUTINE read_{name}
|
||||||
|
|
69
src/templates/writer.f90
Normal file
69
src/templates/writer.f90
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
SUBROUTINE write_{name}(irp_num)
|
||||||
|
|
||||||
|
USE {fmodule}
|
||||||
|
IMPLICIT NONE
|
||||||
|
|
||||||
|
CHARACTER*(*), INTENT(IN) :: irp_num
|
||||||
|
LOGICAL :: irp_is_open = .TRUE.
|
||||||
|
INTEGER :: irp_iunit = 9
|
||||||
|
|
||||||
|
{?do_debug}
|
||||||
|
CHARACTER*(7+{@size key=name/}),PARAMETER :: irp_here = 'writer_{name}'
|
||||||
|
{/do_debug}
|
||||||
|
|
||||||
|
{?do_debug} CALL irp_enter(irp_here) {/do_debug}
|
||||||
|
|
||||||
|
IF (.NOT.{same_as}_is_built) THEN
|
||||||
|
CALL provide_{same_as}
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
{children}
|
||||||
|
CALL write_{.}(irp_num)
|
||||||
|
{/children}
|
||||||
|
|
||||||
|
DO WHILE (irp_is_open)
|
||||||
|
irp_iunit = irp_inuit + 1
|
||||||
|
INQUIRE(UNIT=irp_inuit, OPENED=irp_is_open)
|
||||||
|
END DO
|
||||||
|
|
||||||
|
{#group_entity}
|
||||||
|
OPEN(UNIT=irp_inuit,file='irpf90_{name}_'//trim(irp_num),FROM='FORMATTED',STATUS='UNKNOWN',ACTION='WRITE')
|
||||||
|
WRITE(irp_inuit,*) {.}{dim}
|
||||||
|
CLOSE(irp_inuit)
|
||||||
|
{/group_entity}
|
||||||
|
|
||||||
|
{?do_debug} CALL irp_leave(irp_here) {/do_debug}
|
||||||
|
|
||||||
|
END SUBROUTINE write_{name}
|
||||||
|
|
||||||
|
SUBROUTINE read_{name}(irp_num)
|
||||||
|
|
||||||
|
USE {fmodule}
|
||||||
|
IMPLICIT NONE
|
||||||
|
|
||||||
|
CHARACTER*(*), INTENT(IN) :: irp_num
|
||||||
|
LOGICAL :: irp_is_open = .TRUE.
|
||||||
|
INTEGER :: irp_iunit = 9
|
||||||
|
|
||||||
|
{?do_debug}
|
||||||
|
CHARACTER*(5+{@size key=name/}),PARAMETER :: irp_here = 'read_{name}'
|
||||||
|
{/do_debug}
|
||||||
|
|
||||||
|
{?do_debug} CALL irp_enter(irp_here) {/do_debug}
|
||||||
|
|
||||||
|
DO WHILE (irp_is_open)
|
||||||
|
irp_iunit = irp_inuit + 1
|
||||||
|
INQUIRE(UNIT=irp_inuit, OPENED=irp_is_open)
|
||||||
|
END DO
|
||||||
|
|
||||||
|
{#group_entity}
|
||||||
|
OPEN(UNIT=irp_inuit,file='irpf90_{name}_'//trim(irp_num),FROM='FORMATTED',STATUS='UNKNOWN',ACTION='WRITE')
|
||||||
|
READ(irp_inuit,*) {name}{dim}
|
||||||
|
CLOSE(irp_inuit)
|
||||||
|
{/group_entity}
|
||||||
|
|
||||||
|
CALL touch_{name}
|
||||||
|
{?do_debug} CALL irp_leave(irp_here) {/do_debug}
|
||||||
|
|
||||||
|
END SUBROUTINE read_{name}
|
||||||
|
|
|
@ -46,9 +46,9 @@ logger.setLevel(30)
|
||||||
# ~#~#~#~#~#
|
# ~#~#~#~#~#
|
||||||
# A S H E S _ T E M P L A T E S
|
# A S H E S _ T E M P L A T E S
|
||||||
# ~#~#~#~#~#
|
# ~#~#~#~#~#
|
||||||
from ashes import AshesEnv
|
from lib.manager import ashes
|
||||||
import os
|
import os
|
||||||
ashes_env = AshesEnv([os.path.join(os.path.dirname(__file__),'templates')])
|
ashes_env = ashes.AshesEnv([os.path.join(os.path.dirname(__file__),'templates')])
|
||||||
|
|
||||||
def remove_empy_lines(text):
|
def remove_empy_lines(text):
|
||||||
return os.linesep.join([s for s in text.splitlines() if s.strip()])
|
return os.linesep.join([s for s in text.splitlines() if s.strip()])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user