dev-cafe / autocmake

CMake plugin composer.
http://autocmake.org
BSD 3-Clause "New" or "Revised" License
41 stars 18 forks source link

update.py: Python version verifcation ? #176

Closed miroi closed 8 years ago

miroi commented 8 years ago

Hi Rado,

would it be please possible to add Python version verification for update.py ?

It's more convenient to have Python version requirement explicitly typed in the screen when lower version of Python is used.

milias@login.grid.umb.sk:~/Work/qch/software/dirac/devel_trunk/cmake/.python update.py  ..
- parsing autocmake.yml
Traceback (most recent call last):
  File "update.py", line 283, in <module>
    main(sys.argv)
  File "update.py", line 241, in main
    process_yaml(argv)
  File "update.py", line 128, in process_yaml
    config = parse_yaml(stream)
  File "/home/milias/Work/qch/software/dirac/devel_trunk/cmake/autocmake/parse_yaml.py", line 16, in parse_yaml
    config = interpolate(config, config)
  File "/home/milias/Work/qch/software/dirac/devel_trunk/cmake/autocmake/interpolate.py", line 26, in interpolate
    l.append(interpolate(x, d_map))
  File "/home/milias/Work/qch/software/dirac/devel_trunk/cmake/autocmake/interpolate.py", line 26, in interpolate
    l.append(interpolate(x, d_map))
  File "/home/milias/Work/qch/software/dirac/devel_trunk/cmake/autocmake/interpolate.py", line 28, in interpolate
    l.append(replace(x, d_map))
  File "/home/milias/Work/qch/software/dirac/devel_trunk/cmake/autocmake/interpolate.py", line 6, in replace
    s = s.replace("%({})".format(var), str(d[var]))
ValueError: zero length field name in format
milias@login.grid.umb.sk:~/Work/qch/software/dirac/devel_trunk/cmake/.python -V
Python 2.6.6
milias@login.grid.umb.sk:~/Work/qch/software/dirac/devel_trunk/cmake/.
bast commented 8 years ago

I agree with you Miro - I will implement that.

bast commented 8 years ago

This is now done for Python 2.6. Python 2.4 will still throw an ugly message because of with. It would need restructuring the code to remedy that which I will not do for the moment.