Public Member Functions | |
| def | OnInit |
| Initializes the application and all the associated global variables. | |
| def | createMainWindow |
| Creates the main application window. | |
| def | loadConfiguration |
| Loads the "Options.ini" and "DisplaySettings.ini" configuration files. | |
| def | initStorage |
| Initializes the database storage. | |
| def | startStorageManager |
| Starts the Storage manager. | |
| def | shutdownStorage |
| Halts the storage manager. | |
Public Attributes | |
| netMon | |
| entityMan | |
| storage | |
| dispConf | |
| optConfig | |
| storageInitted | |
Defined in this module (after the eyespy class definition) is also the equivalent of the "main" function.
Definition at line 34 of file eyespy.py.
| def eyespy.eyespy.createMainWindow | ( | self, | ||
| app | ||||
| ) |
Creates the main application window.
Definition at line 78 of file eyespy.py.
00078 : 00079 # Create an instance of our customized Frame class 00080 stringVer = "EyeSpy V 1.1 (%s)" % globalStrings.VERSION 00081 frame = mainFrame(None, -1, stringVer, app, self.dispConf, self.optConfig) 00082 frame.Show(True) 00083 00084 # Tell wxWindows that this is our main window 00085 self.SetTopWindow(frame) 00086 00087 00088 ## Loads the "Options.ini" and "DisplaySettings.ini" configuration files
| def eyespy.eyespy.initStorage | ( | self, | ||
| clearStorageFirst, | ||||
reloadConfig = False | ||||
| ) |
Initializes the database storage.
| clearStorageFirst | Boolean. True if the storage data should be deleted first. | |
| reloadConfig | Boolean. True if "Options.ini" should be loaded again. |
Definition at line 117 of file eyespy.py.
00117 : 00118 self.storageInitted = False 00119 00120 if self.storage != None: 00121 self.netMon.detach(self.storage) 00122 00123 if reloadConfig: 00124 try: 00125 self.optConfig.loadConfig() 00126 except Exception, e: 00127 pass 00128 00129 # storage initialization 00130 monStorage = self.optConfig.network_getRecordTraffic() 00131 maxSize = self.optConfig.network_getRecordingMaxLimit() 00132 00133 if self.optConfig.network_getNeverStopRecording() == True: 00134 maxSize = -1 00135 00136 self.storage = storageManager.storageManager(monStorage, maxSize) 00137 00138 if clearStorageFirst == True: 00139 try: 00140 self.storage.initializeStorage() 00141 except Exception, ex: 00142 00143 # if the users opts out of storing trace data, then there is no need 00144 # to display this error so prominently 00145 if monStorage == True: 00146 dlg = wx.MessageDialog(None, str(ex), 'Error', wx.ICON_ERROR) 00147 result = dlg.ShowModal() 00148 dlg.Destroy() 00149 00150 self.storageInitted = False 00151 return 00152 00153 if monStorage == True: 00154 self.netMon.attach(self.storage) 00155 00156 self.storageInitted = True 00157 00158 ## Starts the Storage manager
| def eyespy.eyespy.loadConfiguration | ( | self | ) |
Loads the "Options.ini" and "DisplaySettings.ini" configuration files.
Definition at line 90 of file eyespy.py.
00090 : 00091 00092 ex = "" 00093 error = False 00094 00095 try: 00096 # load the display configuration 00097 self.dispConf = displayConfigurator(globalStrings.displaySettingsPath) 00098 self.dispConf.loadConfig() 00099 except Exception, ex: 00100 error = True 00101 #else: ex = "" 00102 00103 try: 00104 # now load the options 00105 self.optConfig = optionsConfigurator(globalStrings.appOptionsPath) 00106 self.optConfig.loadConfig() 00107 except Exception, ex: 00108 error = True 00109 #else: ex = "" 00110 00111 return error, ex 00112 00113 ## Initializes the database storage
| def eyespy.eyespy.OnInit | ( | self | ) |
Initializes the application and all the associated global variables.
Definition at line 37 of file eyespy.py.
00037 : 00038 00039 00040 err, ex = self.loadConfiguration() 00041 00042 if err == True: 00043 errMsg = "Could not read startup configuration files. Although you configuration will be restored some application parameters will be set to their starting values. \nThis is usually due to a missing or corrupt configuration file\n\nDetailed Error:\n%s " % (str(ex)) 00044 dlg = wx.MessageDialog(None, errMsg, 'Error', wx.ICON_ERROR) 00045 result = dlg.ShowModal() 00046 dlg.Destroy() 00047 00048 00049 00050 try: 00051 geoIPUtils.installGeoIPIfNecessary() 00052 except Exception, e: 00053 errMsg = str(e) + "\nPlease try and update the GEO IP again." 00054 dlg = wx.MessageDialog(None, errMsg, 'Error', wx.ICON_ERROR) 00055 result = dlg.ShowModal() 00056 dlg.Destroy() 00057 00058 00059 self.netMon = networkMonitor.networkMonitor() 00060 self.entityMan = entityManager.entityManager() 00061 self.storage = None 00062 00063 self.initStorage(True) 00064 self.storage.deleteStorage() 00065 00066 """ 00067 register packet listener 00068 """ 00069 self.netMon.attach(self.entityMan) 00070 00071 self.createMainWindow(self) 00072 # Return a success flag 00073 return True 00074 00075 00076 ## Creates the main application window.
| def eyespy.eyespy.shutdownStorage | ( | self | ) |
| def eyespy.eyespy.startStorageManager | ( | self | ) |
1.5.8