Example #1
0
 def run(self):
     """
     Setup user interface and start QT
     """
     app=QtGui.QApplication(self.parser.getArgs())
     app.setApplicationName(path.basename(sys.argv[0]))
     try:
         app.setApplicationVersion(PyFoam.versionString())
     except AttributeError:
         # Old PyQt
         pass    
     app.setOrganizationName("PyFoam")
     self.setupGUI()
     
     sys.exit(app.exec_())
Example #2
0
except KeyError:
    print "not set"

try:
    import PyFoam
    import PyFoam.FoamInformation
except ImportError:
    print "PyFoam not in PYTHONPATH. Don't see no sense in continuing"
    sys.exit(-1)
    
print
print "OpenFOAM", PyFoam.FoamInformation.foamVersion(),"of the installed versions",PyFoam.FoamInformation.foamInstalledVersions()
if PyFoam.FoamInformation.oldAppConvention():
    print "  This version of OpenFOAM uses the old calling convention"
print
print "pyFoam-Version:",PyFoam.versionString()
print
print "Configuration search path:",PyFoam.configuration().configSearchPath()
print "Configuration files (used):",PyFoam.configuration().configFiles()

def testLibrary(name,textMissing=None):
    print "%-20s : " % name,

    try:
        exec("import "+name)
        print "Yes",
        version=None
        try:
            version=eval(name+".__version__")
        except AttributeError:
            pass
Example #3
0
installed=PyFoam.FoamInformation.foamInstalledVersions()

print_("Version", PyFoam.FoamInformation.foamVersion(),
       "Fork",PyFoam.FoamInformation.foamFork(),
       "of the installed",len(installed),"versions:")
installedKeys=list(installed.keys())
installedKeys.sort()

formatString="%%%ds : %%s" % max([1+len(a[0])+len(a[1]) for a in installedKeys])
for k in installedKeys:
    print_(formatString % (k[0]+"-"+k[1],installed[k]))

if PyFoam.FoamInformation.oldAppConvention():
    print_("  This version of OpenFOAM uses the old calling convention")
print_()
print_("pyFoam-Version:",PyFoam.versionString())
# hardcodedVersion=(0,6,4,"development")
hardcodedVersion=(0,6,4)
if PyFoam.version()!=hardcodedVersion:
    print_("ALERT: Reported version",PyFoam.version(),
           "is different from hardcoded version",
            hardcodedVersion,"-> probably inconsistent library installation")
print_()
print_("Path where PyFoam was found (PyFoam.__path__) is",PyFoam.__path__)
print_()
print_("Configuration search path:",PyFoam.configuration().configSearchPath())
print_("Configuration files (used):",PyFoam.configuration().configFiles())

libLoc={}

def testLibrary(name,