/[escript]/trunk/debian/utils/cppy.py
ViewVC logotype

Contents of /trunk/debian/utils/cppy.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5707 - (show annotations)
Mon Jun 29 03:59:06 2015 UTC (3 years, 6 months ago) by sshaw
File MIME type: text/x-python
File size: 1395 byte(s)
adding copyright headers to files without copyright info, moved header to top of file in some cases where it wasn't
1 #!/usr/bin/python
2
3 ##############################################################################
4 #
5 # Copyright (c) 2003-2015 by The University of Queensland
6 # http://www.uq.edu.au
7 #
8 # Primary Business: Queensland, Australia
9 # Licensed under the Open Software License version 3.0
10 # http://www.opensource.org/licenses/osl-3.0.php
11 #
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 # locates the source of .pyc in the esys directory and copies to the specified dest directory
19
20 from __future__ import print_function, division
21
22 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 first=True
32 for n in files:
33 if n.endswith(".pyc"):
34 n=n[:-1]
35 if first:
36 first=False
37 print("os.makedirs("+dirn+")")
38 try:
39 os.makedirs(dirn)
40 except OSError:
41 pass
42 lst=dirn.split("/")
43 if len(lst)==1:
44 continue
45 source="/".join([sys.argv[1]]+[lst[1]]+["py_src"]+lst[2:]+[n])
46 dest=dirn+"/"+n
47 shutil.copyfile(source,dest)
48 print("Copy: "+source+" "+dest)

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26