/[escript]/release/5.2/localdebian/utils/cppy.py
ViewVC logotype

Annotation of /release/5.2/localdebian/utils/cppy.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6692 - (hide annotations)
Mon Jun 25 02:31:06 2018 UTC (2 years, 11 months ago) by jfenwick
File MIME type: text/x-python
File size: 1418 byte(s)
Fix

1 jfenwick 5577 #!/usr/bin/python
2    
3 sshaw 5707 ##############################################################################
4     #
5 jfenwick 6651 # Copyright (c) 2003-2018 by The University of Queensland
6 sshaw 5707 # http://www.uq.edu.au
7     #
8     # Primary Business: Queensland, Australia
9 jfenwick 6112 # Licensed under the MIT (ExPat) license
10     # https://opensource.org/licenses/MIT
11 sshaw 5707 #
12     # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
13     # Development 2012-2013 by School of Earth Sciences
14     # Development from 2014 by Centre for Geoscience Computing (GeoComp)
15     #
16     ##############################################################################
17    
18 jfenwick 5577 # locates the source of .pyc in the esys directory and copies to the specified dest directory
19 sshaw 5706
20     from __future__ import print_function, division
21    
22 jfenwick 5577 import os, shutil, sys
23    
24     if len(sys.argv)!=2:
25     print("Please specify source directory", file=sys.stderr)
26     exit(1)
27    
28     print("TESTING")
29    
30     for dirn, subdir, files in os.walk("esys"):
31 jfenwick 5853 if dirn.find('__pycache__')!=-1:
32     continue
33 jfenwick 5577 first=True
34     for n in files:
35     if n.endswith(".pyc"):
36     n=n[:-1]
37     if first:
38     first=False
39     print("os.makedirs("+dirn+")")
40 sshaw 5705 try:
41 jfenwick 5577 os.makedirs(dirn)
42 sshaw 5705 except OSError:
43     pass
44 jfenwick 5577 lst=dirn.split("/")
45     if len(lst)==1:
46     continue
47     source="/".join([sys.argv[1]]+[lst[1]]+["py_src"]+lst[2:]+[n])
48     dest=dirn+"/"+n
49     shutil.copyfile(source,dest)
50     print("Copy: "+source+" "+dest)

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26