~maddevelopers/mg5amcnlo/3.0.2-alpha0

« back to all changes in this revision

Viewing changes to madgraph/iolibs/misc.py

  • Committer: Michel Herquet
  • Date: 2009-09-28 09:46:16 UTC
  • mto: (6.3.3 test-framework-dev)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: herquet@gmail.com-20090928094616-l9715e7ptx9wdgav
Reorganize structure

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
##############################################################################
 
2
#
 
3
# Copyright (c) 2009 The MadGraph Development team and Contributors
 
4
#
 
5
# This file is a part of the MadGraph 5 project, an application which 
 
6
# automatically generates Feynman diagrams and matrix elements for arbitrary
 
7
# high-energy processes in the Standard Model and beyond.
 
8
#
 
9
# It is subject to the MadGraph license which should accompany this 
 
10
# distribution.
 
11
#
 
12
# For more information, please visit: http://madgraph.phys.ucl.ac.be
 
13
#
 
14
##############################################################################
 
15
 
 
16
"""A set of functions performing routine administrative I/O tasks."""
 
17
 
 
18
import madgraph
 
19
import os
 
20
 
 
21
def get_version():
 
22
    """Returns the current version of the MadGraph package, as written in
 
23
    the VERSION text file. If the file cannot be found, UNKNOWN is 
 
24
    returned"""
 
25
 
 
26
    version = "UNKNOWN"
 
27
 
 
28
    try:
 
29
        version_file = fopen(os.path.join(madgraph.__path__, "VERSION"), 'r')
 
30
        try:
 
31
            version = version_file.read()
 
32
        finally:
 
33
            version_file.close()
 
34
    except IOError:
 
35
        pass
 
36
 
 
37
    return version
 
38