-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·72 lines (52 loc) · 1.96 KB
/
Copy pathsetup.py
File metadata and controls
executable file
·72 lines (52 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env python
from distutils.core import setup
import os, sys
from subprocess import Popen, PIPE
def findFiles(src_dir, *wildcards):
src_dir = src_dir.strip()
while src_dir[-1]=='/':
src_dir = src_dir[:-1]
# Find all directory names
dirList = Popen(['find '+src_dir+' -name "*"'], shell=True, \
stdout=PIPE).communicate()[0].split()
foundList = []
for i in range(len(dirList)):
#if (os.path.isdir(dirList[i])&(dirList[i].strip()!=src_dir)):
if os.path.isdir(dirList[i]):
# Find the appropriate files within each directory
fileList = []
for wc in wildcards:
dum = Popen(['ls -1 '+dirList[i]+'/'+wc], shell=True, \
stdout=PIPE, stderr=PIPE).communicate()[0].split()
#dum = Popen(['find '+dirList[i]+' -name "'+wc+'"'], shell=True, \
#stdout=PIPE).communicate()[0].split()
if len(dum)>0:
fileList.extend(dum)
if len(fileList)>0:
foundList.append((dirList[i], fileList))
return foundList
fileList = findFiles('./radmc3dPy', '*.py')
python_files = []
for i in range(len(fileList)):
for j in range(len(fileList[i][1])):
python_files.append(fileList[i][1][j])
moduleNames = []
packageNames = []
for i in range(len(python_files)):
ind1 = python_files[i].strip()[::-1].find('/')
dum = python_files[i].strip()[-ind1:-3]
if dum.strip()!='__init__':
moduleNames.append('radmc3dPy.'+dum)
else:
sdum = python_files[i].split('/')[1:-1]
txt = sdum[0]
if len(sdum)>1:
for imod in range(1,len(sdum)):
txt += '.'+sdum[imod]
packageNames.append(txt)
setup(name='radmc3dPy',
version='0.28.2',
description='Python module for RADMC3D',
author='Attila Juhasz',
author_email='juhasz@ast.cam.ac.uk',
packages=packageNames)