Srikanth Vavilapalli | 1725e49 | 2014-12-01 17:50:52 -0800 | [diff] [blame^] | 1 | # |
| 2 | # Copyright (c) 2011,2012,2013 Big Switch Networks, Inc. |
| 3 | # |
| 4 | # Licensed under the Eclipse Public License, Version 1.0 (the |
| 5 | # "License"); you may not use this file except in compliance with the |
| 6 | # License. You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.eclipse.org/legal/epl-v10.html |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 13 | # implied. See the License for the specific language governing |
| 14 | # permissions and limitations under the License. |
| 15 | # |
| 16 | |
| 17 | import setuptools |
| 18 | import os |
| 19 | |
| 20 | |
| 21 | def all_files_in_subdir(dir, mod, full_list): |
| 22 | for f in os.listdir(dir): |
| 23 | path = os.path.join(dir, f) |
| 24 | if os.path.isdir(path): |
| 25 | all_files_in_subdir(path, "%s.%s" % (dir, f), full_list) |
| 26 | elif f.endswith('.py') and f != '__init__.py': |
| 27 | full_list.append("%s.%s" % (mod, f[:-3])) |
| 28 | return full_list |
| 29 | |
| 30 | |
| 31 | def all_modules_in_subdir(dir): |
| 32 | mod = all_files_in_subdir(dir, '', []) |
| 33 | return mod |
| 34 | |
| 35 | |
| 36 | def all_doc_in_subdirs(dir, doc_collect): |
| 37 | for f in os.listdir(dir): |
| 38 | path = os.path.join(dir, f) |
| 39 | if os.path.isdir(path): |
| 40 | all_doc_in_subdirs(path, doc_collect) |
| 41 | else: |
| 42 | doc_collect.append((dir, [path])) |
| 43 | return doc_collect |
| 44 | |
| 45 | |
| 46 | def all_documentation(dir): |
| 47 | return all_doc_in_subdirs(dir, []) |
| 48 | |
| 49 | |
| 50 | setuptools.setup( |
| 51 | name="cli", |
| 52 | version="0.1.0", |
| 53 | zip_safe=True, |
| 54 | py_modules=["cli", "model_info_list", "prettyprint", "storeclient", |
| 55 | "climodelinfo", "vendor", "trace", "timesince", "command", |
| 56 | "c_actions", "c_data_handlers", "c_completions", "c_validations", |
| 57 | "error", "modi", "utif", "midw", "vnsw", "fmtcnv", |
| 58 | "rest_to_model", "run_config", "tech_support", |
| 59 | "url_cache", "doc", "sdndb", |
| 60 | ] + all_modules_in_subdir('desc'), |
| 61 | data_files=[("data", ["data/oui.txt"])] + all_documentation("documentation"), |
| 62 | entry_points=dict(console_scripts=["cli = cli:main", "trace = trace:main"]), |
| 63 | ) |