Tang Cheng | 53ca487 | 2012-11-05 14:00:43 +0800 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | # -*- coding: utf-8 -*- |
| 3 | |
| 4 | from distutils.core import setup |
| 5 | import os |
| 6 | |
| 7 | |
| 8 | def _do_list_dir(top_dir, base_dir): |
| 9 | top_dir = os.path.realpath(top_dir) |
| 10 | print "top : ", top_dir |
| 11 | base_dir = os.path.realpath(base_dir) |
| 12 | all_files = os.listdir(base_dir) |
| 13 | modules = [] |
| 14 | for f in all_files: |
| 15 | fname = os.path.join(base_dir, f) |
| 16 | if os.path.isfile(fname): |
| 17 | ext = f.split('.')[-1] |
| 18 | if ext == 'py': |
| 19 | p = base_dir.find(top_dir) |
| 20 | mod = os.path.join(base_dir[p + len(top_dir) + 1:], f) |
| 21 | modules.append(mod) |
| 22 | elif os.path.isdir(fname): |
| 23 | modules += _do_list_dir(top_dir, fname) |
| 24 | return modules |
| 25 | |
| 26 | |
| 27 | def find_all_dist_module(): |
| 28 | base_dir = 'supwisdom' |
| 29 | return _do_list_dir(base_dir, base_dir) |
| 30 | |
| 31 | #print find_all_dist_module() |
| 32 | |
| 33 | setup( |
| 34 | name='swtools', |
| 35 | version="0.1", |
| 36 | description="Supwisdom python libraries", |
| 37 | author='Cheng Tang', |
| 38 | author_email='cheng.tang@supwisdom.com', |
| 39 | platforms=['All'], |
| 40 | packages=['supwisdom', 'supwisdom.protocol'] |
| 41 | ) |