RainEagle library plus script for polling data
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

51 lines
1.6 KiB

  1. # python setup.py --dry-run --verbose install
  2. import os.path
  3. from setuptools import setup, find_packages
  4. from distutils.command.install_scripts import install_scripts
  5. from distutils.core import setup
  6. class install_scripts_and_symlinks(install_scripts):
  7. '''Like install_scripts, but also replicating nonexistent symlinks'''
  8. def run(self):
  9. print "=============install_scripts_and_symlinks run"
  10. install_scripts.run(self)
  11. # Replicate symlinks if they don't exist
  12. print self
  13. print "data_files = ", dir( self.distribution.data_files)
  14. print type(self.distribution.data_files)
  15. print self.distribution.data_files
  16. for script in self.distribution.scripts:
  17. print "\n---script = ",script
  18. if os.path.islink(script):
  19. target = os.readlink(script)
  20. newlink = os.path.join(self.install_dir, os.path.basename(script))
  21. if not os.path.exists(newlink):
  22. print "++++++++++", target, " -> ", newlink
  23. # os.symlink(target, newlink)
  24. setup(
  25. name='RainEagle',
  26. version='0.1.6',
  27. author='Peter Shipley',
  28. author_email='Peter.Shipley@gmail.com',
  29. packages=find_packages(),
  30. scripts=[ 'binbin/get_meter_status.py', 'bin/plot_power.py' ]
  31. data_files=[
  32. # ('examples', ['bin/isy_find.py', 'bin/isy_progs.py',
  33. # 'bin/isy_log.py', 'bin/isy_net_wol.py']),
  34. ('bin', ['bin/isy_nodes.py', 'bin/isy_var.py']) ],
  35. url='https://github.com/evilpete/RainEagle',
  36. license='BSD',
  37. description='Python Class for utilizing the Rainforest Automation Eagle ( RFA-Z109 ) socket API.',
  38. long_description=open('README.md').read(),
  39. cmdclass = { 'install_scripts': install_scripts_and_symlinks }
  40. )