# HG changeset patch # User Henry S. Thompson # Date 1582108745 0 # Node ID 462179da7dc2b65b5c25dffc96d7699d7cd7f6bd # Parent 83ed7c5846b2ef6ad04812dd80bc2f142274a8c7 try harder not to write empty links files diff -r 83ed7c5846b2 -r 462179da7dc2 bin/plinks.py --- a/bin/plinks.py Tue Feb 18 22:19:51 2020 +0000 +++ b/bin/plinks.py Wed Feb 19 10:39:05 2020 +0000 @@ -13,10 +13,12 @@ (fno,f)=l.rstrip().split() try: links=run(f) - with open('/dev/shm/x/links_%s'%fno,'w') as of: - for k in links.keys(): - for l in links[k]: - print("%s\t%s"%(k,l),file=of) + if bool(links) and (links.get('scrape',False) or + links.get('annot',False)): + with open('/dev/shm/x/links_%s'%fno,'w') as of: + for k in links.keys(): + for l in links[k]: + print("%s\t%s"%(k,l),file=of) except Exception as e: print("%s\t%s"%(fno,e),file=bf) if (path.exists('/dev/shm/stopJob')):