Пример #1
0
 def removeWorkspace(self, name):
     if name in self.getWorkspacesNames():
         try:
             return delete_workspace(name)
         except Unauthorized:
             notification_center.showDialog("You are not authorized to "
                                            "delete this workspace. \n")
Пример #2
0
 def removeWorkspace(self, name):
     if name in self.getWorkspacesNames():
         try:
             return delete_workspace(name)
         except Unauthorized:
             notification_center.showDialog("You are not authorized to "
                                            "delete this workspace. \n")
Пример #3
0
 def openWorkspace(self, name):
     if name in self.getWorkspacesNames():
         self.closeWorkspace()
         dbConnector = self.dbManager.getConnector(name)
         self.mappersManager.createMappers(dbConnector)
         workspace = self.mappersManager.getMapper(Workspace.__name__).find(name)
         if not workspace:
             notification_center.showDialog(
                 "Error loading workspace.\nYou should try opening faraday with the '--update' option",
                 level="ERROR")
             return self.openDefaultWorkspace()
         self.setActiveWorkspace(workspace)
         CONF.setLastWorkspace(name)
         CONF.saveConfig()
         notification_center.workspaceChanged(workspace)
         notification_center.workspaceLoad(workspace.getHosts())
         self.changesManager.watch(self.mappersManager, dbConnector)
         self.reportsManager.watch(name)
         return workspace
     return None
Пример #4
0
 def openWorkspace(self, name):
     if name in self.getWorkspacesNames():
         self.closeWorkspace()
         dbConnector = self.dbManager.getConnector(name)
         self.mappersManager.createMappers(dbConnector)
         workspace = self.mappersManager.getMapper(Workspace.__name__).find(name)
         if not workspace:
             notification_center.showDialog(
                 "Error loading workspace.\nYou should try opening faraday with the '--update' option",
                 level="ERROR")
             return self.openDefaultWorkspace()
         self.setActiveWorkspace(workspace)
         CONF.setLastWorkspace(name)
         CONF.saveConfig()
         notification_center.workspaceChanged(workspace,self.getWorkspaceType(name))
         notification_center.workspaceLoad(workspace.getHosts())
         self.changesManager.watch(self.mappersManager, dbConnector)
         self.reportsManager.watch(name)
         return workspace
     return None
Пример #5
0
 def runVisualization(self):
     """
     runs script that builds the html for visutalizacion and opens a browser
     """
     base_uri = str(CONF.getCouchURI())
     uri = base_uri + "/reports/_design/reports/index.html"
     import requests
     try:
         response = requests.head(uri)
         res = response.ok
     except:
         res = False
         return notification_center.showDialog(
                 "Error trying to connect couchdb.\nIn order to see the visualizations you should have couchdb started.",
                 level="ERROR")
     if res:
         webbrowser.open_new(uri)
Пример #6
0
 def runVisualization(self):
     """
     runs script that builds the html for visutalizacion and opens a browser
     """
     base_uri = str(CONF.getCouchURI())
     current_workspace = str(CONF.getLastWorkspace())
     uri = base_uri + "/reports/_design/reports/index.html#/dashboard/ws/" + current_workspace
     import requests
     try:
         response = requests.head(uri)
         res = response.ok
     except:
         res = False
         return notification_center.showDialog(
             "Error trying to connect couchdb.\nIn order to see the visualizations you should have couchdb started.",
             level="ERROR")
     if res:
         webbrowser.open_new(uri)