From 89ab32443ccb5badade8d311aa34ccfe3f292e04 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 27 Feb 2014 14:06:31 +0100 Subject: [PATCH] Corrected bug with unexisting directories --- README | 5 +++-- man/man1/irpf90.1.gz | Bin 1329 -> 1471 bytes src/command_line.py | 2 ++ src/init.py | 9 ++++++++- src/irpf90_t.py | 6 +++++- src/module.py | 2 +- src/version.py | 2 +- 7 files changed, 20 insertions(+), 6 deletions(-) diff --git a/README b/README index da145fc..a0d98c3 100644 --- a/README +++ b/README @@ -7,7 +7,7 @@ Dependencies - GNU make (>= 3.81 recommended) - Python > 2.3 -- Any Fortran 90 compiler (Intel recommended, for example) +- Any Fortran 90 compiler (Intel recommended) Installing IRPF90 ----------------- @@ -21,6 +21,7 @@ ${IRPF90_HOME} is the location of your irpf90 directory:: export PATH=${IRPF90_HOME}/bin:${PATH} export MANPATH=${IRPF90_HOME}/man:${MANPATH} EOF + . ${HOME}/.bash_profile Using IRPF90 @@ -43,6 +44,6 @@ Author ------ | Anthony Scemama, LCPQ-IRSAMC, CNRS-Universite Paul Sabatier -| scemama@irsamc.ups-tlse.fr +| | http://scemama.mooo.com diff --git a/man/man1/irpf90.1.gz b/man/man1/irpf90.1.gz index 19b980fd63735b02d03d8b8f66004f7460eb41ab..2e0b640df0b1ebd4d280207fad1caa290f8aa9f5 100644 GIT binary patch literal 1471 zcmV;w1wi^AiwFq7J^E4r18H(_W;rk}F#wfUZExE)5dO|zaWyia#bU*FR}AwoU|!<3 z1{%k(9Be}s6tqO!L?lupDLXFuwrw4qbCaC0`3#3ndJ9 zBBPbj1sM@LQ>CslB3psn%3k|2rwlT&B{|T&#o< zDi!23%{Zil6UM@!NEtHL4GONhQe{H9ZZ5VWr=H);MBneuMF|_%+^nTyNpjYwBvBu6 zq6kZOtUlrwpVHOt*V4l$&EDM;i~Xk-2X`!L;+RaY#?u9hkg@1dOn^=d zSw!=gd~_IngUYiWK8E6nvkjs@_Mb7Xts6FO((SbMlj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%@T>?ecyVzzsYZA$EZ zRw6p^GYmdBibWj%J-=JTvzSGV!_bfV$MsG081e=79 z#prA~8nP}0NJ^nlKT zKdCo{5^w$5Xzwrp*SS|ImDqJ#Fox}9S;88#V5DlWIwS@4tBf1mdslnMc7;$_O_+Hq zD@>Jml8%-fTG>~?E!zo{#%&OBySN7@D@rg%BE#mks4-a9vUFVAw639DxhzG;x#lEj z4Q@fIvo2@Rau%Yj*@C=4Drq6?k5uxQKj|=eXge?ER}|L9=$OX{Zn11hF=tpj+?Nig z-lHI^0AteBv#1c%IA(pP%_G@%;K#n|*j64&p_CiN#`F)|7{0gd)Jk<#qhQnW%dN1C zlvv@KAYM{Yjz7-c&ySTGQR6c4#IZv$>PPv1+zcTs&~(Z|(8DmF9PnnncLLVhQ&#sK z6RXz53d;}uX#&`6NQ_Q-fTZh8baownbqs7tjfO!t-UO10VA>*AtX?t;|z0o zB%^XVP@V+qR&ZK~^bvuP#f9EkL@`7oAfT+|*I*6K+C5dU5&w9MVs;WyAB#$$vQ${x z_-6x39?s|uL&-&WJ5)Vusy>2yD{@~#PUsf8Y(rTia?4V!5a`Goum#n**b}sDp-76VtJGvxp78i8cMBe zOJ=k7p%$#HMT&rz9-@biKkFseYH-@81)E4)ml)e-a1dHL8XMeDtdM{}9ASZl4Jn|4 zJ>u&Iol%4ZIAL&*djhkLD&MN|%3}uFx@$J4$~cj4TkS%ug2&PYUBdPM&VKhBllbqfFhh%R-t diff --git a/src/command_line.py b/src/command_line.py index 35569d0..593f807 100644 --- a/src/command_line.py +++ b/src/command_line.py @@ -74,6 +74,8 @@ class CommandLine(object): self._include_dir = [] for o,a in self.opts: if o in [ "-I", '--'+options['I'][0] ]: + if len(a) < 1: + print "Error: -I option needs a directory" if a[-1] != '/': a = a+'/' self._include_dir.append(a) diff --git a/src/init.py b/src/init.py index 4fd25d1..7bddb42 100644 --- a/src/init.py +++ b/src/init.py @@ -63,10 +63,17 @@ def init(): makefile.create() # Copy current files in the irpdir + ls = os.listdir(os.getcwd()) + print ls for dir in ['./']+command_line.include_dir: + try: + os.stat(dir) + except: + print dir,'not in dir' + continue for filename in os.listdir(dir): filename = dir+filename - if not filename[0].startswith(".") and not os.path.isdir(filename): + if not filename.startswith(".") and not os.path.isdir(filename): try: file = open(filename,"r") except IOError: diff --git a/src/irpf90_t.py b/src/irpf90_t.py index 57658c4..ae1b73a 100644 --- a/src/irpf90_t.py +++ b/src/irpf90_t.py @@ -350,7 +350,11 @@ def create_irpf90_files(): return filename.endswith(".irp.f") and not filename.startswith('.') result = filter ( is_irpf90_file, os.listdir(os.getcwd()) ) for dir in command_line.include_dir: - result += map(lambda x: dir+x, filter ( is_irpf90_file, os.listdir(dir) ) ) + try: + os.stat(dir) + result += map(lambda x: dir+x, filter ( is_irpf90_file, os.listdir(dir) ) ) + except: + continue if command_line.do_codelet: result += [command_line.codelet[3]] return result diff --git a/src/module.py b/src/module.py index 4bb9f49..a817f40 100644 --- a/src/module.py +++ b/src/module.py @@ -47,7 +47,7 @@ class Fmodule(object): def __init__(self,text,filename): self.text = put_info(text,filename) self.filename = filename[:-6] - self.name = "%s_mod"%(self.filename).replace('/','__') + self.name = "%s_mod"%(self.filename).replace('/','__').replace('.','Dot') def is_main(self): if '_is_main' not in self.__dict__: diff --git a/src/version.py b/src/version.py index 35ec9a3..cfa2db6 100644 --- a/src/version.py +++ b/src/version.py @@ -1 +1 @@ -version = "1.3.1" +version = "1.3.3"