diff --git a/.gitignore b/.gitignore index 349f22cc7..ee2b39ca2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ *egg* *dist* *tar.gz* +.idea +build \ No newline at end of file diff --git a/conda/conda_build_config.yaml b/conda/conda_build_config.yaml new file mode 100644 index 000000000..b5d49c7ba --- /dev/null +++ b/conda/conda_build_config.yaml @@ -0,0 +1,6 @@ +python: + - 2.7 + +numpy: + - 1.11 + diff --git a/conda/meta.yaml b/conda/meta.yaml new file mode 100644 index 000000000..f968f155f --- /dev/null +++ b/conda/meta.yaml @@ -0,0 +1,48 @@ +{% set data = load_setup_py_data(setup_file="../setup.py", + from_recipe_dir=True) %} + +{% set GIT_HASHTAG = os.popen("git log --pretty=format:'%h' -n 1") + .read().strip()%} + +package: + name: {{data.get('name').lower().replace(' ', '_')}} + version: {{data.get('version')}} + +source: + path: .. + +build: + number: {{environ.get('BUILD_NUMBER',0)}} + noarch: python + script: '{{PYTHON}} setup.py install --single-version-externally-managed + --record=record.txt' + + string: 'py{{CONDA_PY}}_{{ PKG_BUILDNUM }}_g{{GIT_HASHTAG}}' + entry_points: {{data.get('entry_points', {}).get('console_scripts', [])}} + +requirements: + host: + - python {{python}} + - setuptools + run: + - python {{python}} + - future + - pytango + +test: + requires: + - pytango + - future + imports: + {% for pack in data['packages'] %} + - {{pack}} + {% endfor %} +about: + home: {{ data.get('url')}} + license: {{ data.get('license')}} + summary: {{ data.get('description')}} + author: {{ data.get('author')}} + description: {{ data.get('long_description')}} + + + diff --git a/fandango/scripts/csv2tango b/fandango/scripts/csv2tango.py similarity index 100% rename from fandango/scripts/csv2tango rename to fandango/scripts/csv2tango.py diff --git a/fandango/scripts/ctds b/fandango/scripts/ctds.py similarity index 100% rename from fandango/scripts/ctds rename to fandango/scripts/ctds.py diff --git a/fandango/scripts/fandango b/fandango/scripts/fandango_script.py similarity index 99% rename from fandango/scripts/fandango rename to fandango/scripts/fandango_script.py index ca776b709..18bd728ce 100755 --- a/fandango/scripts/fandango +++ b/fandango/scripts/fandango_script.py @@ -83,7 +83,7 @@ If it is problem is solved in the future, then will be moved to fandango.linos """ -if __name__ == '__main__': +def main(): import sys cmd = '' try: @@ -196,3 +196,6 @@ def get_module_name(o): sys.exit(1) sys.exit(0) + +if __name__ == '__main__': + main() diff --git a/fandango/scripts/folder-gui b/fandango/scripts/folder-gui deleted file mode 100755 index 15185dab2..000000000 --- a/fandango/scripts/folder-gui +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python - -import fandango.device.FolderGUI -g = fandango.device.FolderGUI.main() diff --git a/fandango/scripts/sardanact b/fandango/scripts/sardanact.py similarity index 100% rename from fandango/scripts/sardanact rename to fandango/scripts/sardanact.py diff --git a/fandango/scripts/tango2csv b/fandango/scripts/tango2csv.py similarity index 90% rename from fandango/scripts/tango2csv rename to fandango/scripts/tango2csv.py index ea714d268..7a40bfd23 100755 --- a/fandango/scripts/tango2csv +++ b/fandango/scripts/tango2csv.py @@ -165,29 +165,32 @@ def tango2csv(filters,options=[]): except Exception,e: print '-------> An unforeseen exception occured....',traceback.format_exc() - -if __name__ == '__main__': - - opts = [a for a in sys.argv[1:] if a.startswith('-')] - args = [a for a in sys.argv[1:] if not a.startswith('-')] - if not args: - print(__doc__) - elif '--tree' not in opts: - tango2csv(args,opts) + + +def main(): + opts = [a for a in sys.argv[1:] if a.startswith('-')] + args = [a for a in sys.argv[1:] if not a.startswith('-')] + if not args: + print(__doc__) + elif '--tree' not in opts: + tango2csv(args, opts) + else: + if len(args) > 1: + fout = args[-1] + args = args[:-1] else: - if len(args)>1: - fout = args[-1] - args = args[:-1] - else: - fout = '' + fout = '' + + text = fd.tango.tango2table(args, opts=opts + ['--text']) + + if fout: + fout = open(fout, 'w') + fout.write(text) + fout.close() + else: + print(text) + +if __name__ == '__main__': + main() + - text = fd.tango.tango2table(args,opts=opts+['--text']) - - if fout: - fout = open(fout,'w') - fout.write(text) - fout.close() - else: - print(text) - - diff --git a/fandango/scripts/tango2json b/fandango/scripts/tango2json deleted file mode 100755 index 7af0c9ce5..000000000 --- a/fandango/scripts/tango2json +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python - -import fandango as fn -import sys,json,gzip - -__doc__ = """ -Usage: - - > tango2json.py [--compress] [--commands] [--properties] [--attributes] "filename.json" dev/name/1 "dev/exp/*" -""" - -args,params,devs,data = [],[],[],fn.CaselessDict() - -t0 = fn.now() -i = 1 -source = '' - -while i tango2json.py [--compress] [--commands] [--properties] [--attributes] "filename.json" dev/name/1 "dev/exp/*" +""" + + +def main(): + args,params,devs,data = [],[],[],fn.CaselessDict() + + t0 = fn.now() + i = 1 + source = '' + + while i