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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5706 - (show annotations)
Mon Jun 29 03:41:36 2015 UTC (4 years, 2 months ago) by sshaw
File MIME type: text/x-python
File size: 801 byte(s)
all python files now force use of python3 prints and division syntax to stop sneaky errors appearing in py3 environs
1 #!/usr/bin/python
2
3 # locates the source of .pyc in the esys directory and copies to the specified dest directory
4
5 from __future__ import print_function, division
6
7 import os, shutil, sys
8
9 if len(sys.argv)!=2:
10 print("Please specify source directory", file=sys.stderr)
11 exit(1)
12
13 print("TESTING")
14
15 for dirn, subdir, files in os.walk("esys"):
16 first=True
17 for n in files:
18 if n.endswith(".pyc"):
19 n=n[:-1]
20 if first:
21 first=False
22 print("os.makedirs("+dirn+")")
23 try:
24 os.makedirs(dirn)
25 except OSError:
26 pass
27 lst=dirn.split("/")
28 if len(lst)==1:
29 continue
30 source="/".join([sys.argv[1]]+[lst[1]]+["py_src"]+lst[2:]+[n])
31 dest=dirn+"/"+n
32 shutil.copyfile(source,dest)
33 print("Copy: "+source+" "+dest)

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26