pyNastran
0.5.0
pyNastran BDF Reader/Writer, OP2 Parser, and GUI
|
00001 ## GNU Lesser General Public License 00002 ## 00003 ## Program pyNastran - a python interface to NASTRAN files 00004 ## Copyright (C) 2011-2012 Steven Doyle, Al Danial 00005 ## 00006 ## Authors and copyright holders of pyNastran 00007 ## Steven Doyle <mesheb82@gmail.com> 00008 ## Al Danial <al.danial@gmail.com> 00009 ## 00010 ## This file is part of pyNastran. 00011 ## 00012 ## pyNastran is free software: you can redistribute it and/or modify 00013 ## it under the terms of the GNU Lesser General Public License as published by 00014 ## the Free Software Foundation, either version 3 of the License, or 00015 ## (at your option) any later version. 00016 ## 00017 ## pyNastran is distributed in the hope that it will be useful, 00018 ## but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 ## GNU General Public License for more details. 00021 ## 00022 ## You should have received a copy of the GNU Lesser General Public License 00023 ## along with pyNastran. If not, see <http://www.gnu.org/licenses/>. 00024 ## 00025 import sys 00026 import platform 00027 00028 #if platform.system=='Windows': 00029 00030 00031 def get_graphic_card_properties(): 00032 import dbus 00033 bus = dbus.SystemBus() 00034 hal_manager_object = bus.get_object('org.freedesktop.Hal', '/org/freedesktop/Hal/Manager') 00035 prop = 'pci.device_class' 00036 for device in hal_manager_object.get_dbus_method('GetAllDevices', 'org.freedesktop.Hal.Manager')(): 00037 dev = bus.get_object('org.freedesktop.Hal', device) 00038 interface = dbus.Interface(dev, dbus_interface='org.freedesktop.Hal.Device') 00039 if interface.PropertyExists(prop): 00040 if interface.GetProperty(prop) == 3: 00041 # we return the properties of the first device in the list 00042 # with a pci.device_class == 3 (should check if several such devs... 00043 return interface.GetAllProperties() 00044 00045 if 0: 00046 dic = get_graphic_card_properties() 00047 for key, value in dic.iteritems(): 00048 print("%s : %s" %(key, value)) 00049 00050 def makeLog(): 00051 msg = '' 00052 msg += "sys.version = %s\n" %(sys.version) 00053 msg += "sys.version_info = %s\n" %(str(sys.version_info)) 00054 msg += "machine = %s\n" %(platform.machine()) 00055 msg += "platform = %s\n" %(platform.platform()) 00056 msg += "processor = %s\n" %(platform.processor()) 00057 msg += "architecure = %s\n" %(str(platform.architecture())) 00058 #msg += "os = %s\n" %(platform.os()) 00059 msg += "python_branch = %s\n" %(platform.python_branch()) 00060 msg += "python_revision = %s\n" %(platform.python_revision()) 00061 msg += "win32_ver = %s\n" %(str(platform.win32_ver())) 00062 msg += "version = %s\n" %(platform.version()) 00063 msg += "uname = %s\n" %(str(platform.uname())) 00064 msg += "system = %s\n" %(platform.system()) 00065 msg += "python_build = %s\n" %(str(platform.python_build())) 00066 msg += "python_compiler = %s\n" %(platform.python_compiler()) 00067 msg += "python_implementation = %s\n" %(platform.python_implementation()) 00068 msg += "system = %s\n" %(platform.system()) 00069 #msg += "system_alias = %s\n" %(platform.system_alias()) 00070 msg += "mac_ver = %s\n" %(str(platform.mac_ver())) 00071 msg += "linux_distribution = %s\n" %(str(platform.linux_distribution())) 00072 msg += "libc_ver = %s\n" %(str(platform.libc_ver())) 00073 print msg 00074 f = open('pyNastran.log','w') 00075 f.write(msg) 00076 f.close() 00077 00078 makeLog() 00079