Ejemplo n.º 1
0
 def __init__(self, parent):
   QToolBar.__init__(self)
   self.filtertw = parent
   self.filterw = parent.filterw
   self.tagsmanager = TagsManager.get()
   self.tagbuttons = []
   self.refreshTags()
Ejemplo n.º 2
0
 def __init__(self, parent):
     QToolBar.__init__(self)
     self.filtertw = parent
     self.filterw = parent.filterw
     self.tagsmanager = TagsManager.get()
     self.tagbuttons = []
     self.refreshTags()
Ejemplo n.º 3
0
 def __init__(self, parent, main, model=None):
   QMenu.__init__(self, main)
   self.model = model
   self.browser = parent
   self.parent = parent
   self.tagsmanager = TagsManager.get()
   self.setTitle(QString("Tags"))
   self.connect(self, SIGNAL("aboutToShow"), self.refreshTagMenu)
   self.manageAction = QAction(QString(self.tr("Manage tags")), self)
   self.connect(self.manageAction, SIGNAL("triggered(bool)"), self.openDialog)
   self.connect(self, SIGNAL("triggered(QAction*)"), self.tagNodes)
   self.refreshTagMenu()
Ejemplo n.º 4
0
Archivo: menu.py Proyecto: kzwkt/dff
 def __init__(self, parent, main, model=None):
     QMenu.__init__(self, main)
     self.model = model
     self.browser = parent
     self.parent = parent
     self.tagsmanager = TagsManager.get()
     self.setTitle(QString("Tags"))
     self.connect(self, SIGNAL("aboutToShow"), self.refreshTagMenu)
     self.manageAction = QAction(QString(self.tr("Manage tags")), self)
     self.connect(self.manageAction, SIGNAL("triggered(bool)"),
                  self.openDialog)
     self.connect(self, SIGNAL("triggered(QAction*)"), self.tagNodes)
     self.refreshTagMenu()
Ejemplo n.º 5
0
 def __init__(self, parent = None, selectedNodesList = []):
    QDialog.__init__(self, parent)
    self.setupUi(self)
    self.VFS = VFS.Get()
    self.connect(self.newTagButton, SIGNAL("clicked()"), self.editTag)   
    self.connect(self.deleteTagButton, SIGNAL("clicked()"), self.deleteTag)   
    self.connect(self.addTagNodesButton, SIGNAL("clicked()"), self.addTagNodes)   
    self.connect(self.removeTagNodesButton, SIGNAL("clicked()"), self.removeTagNodes)   
    self.connect(self.selectedTags, SIGNAL("itemDoubleClicked(QListWidgetItem*)"), self.editTag)
    self.connect(self.allTags, SIGNAL("itemDoubleClicked(QListWidgetItem*)"), self.editTag)
    self.tagsManager = TagsManager.get()
    self.selectedNodesList = selectedNodesList
    self.selectedNodes = []
    self.fillLists()
    self.translation()
Ejemplo n.º 6
0
 def __init__(self, parent):
     Request.__init__(self, parent)
     self.tagsmanager = TagsManager.get()
     self.selectedTags = []
     self.content = QLineEdit(self)
     self.connect(self.content, SIGNAL("textChanged(const QString &)"),
                  self.updateQuery)
     self.connect(self.content, SIGNAL("textEdited(const QString &)"),
                  self.updateQuery)
     self.content.setReadOnly(True)
     self.selectButton = QPushButton(self.tr("Select ..."))
     self.connect(self.selectButton, SIGNAL("clicked()"),
                  self.selectTagsDialog)
     self.layout().addWidget(self.content, 50)
     self.layout().addWidget(self.selectButton)
Ejemplo n.º 7
0
 def __init__(self, parent=None, tag=None):
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.VFS = VFS.Get()
     self.tagsManager = TagsManager.get()
     self.connect(self.setColorButton, SIGNAL("clicked()"), self.setColor)
     self.connect(self.tagEdit, SIGNAL("editingFinished()"), self.setName)
     self.tag = tag
     if self.tag:
         self.tagColor = None
         self.tagName = None
         self.fill(tag)
     else:
         self.tagName = unicode(self.tagEdit.text())
         self.tagColor = (randint(0, 255), randint(0, 255), randint(0, 255))
         self.setEditColor(QColor(*self.tagColor))
Ejemplo n.º 8
0
 def __init__(self, parent = None, selectedNodesList = []):
    QDialog.__init__(self, parent)
    self.setupUi(self)
    self.VFS = VFS.Get()
    self.connect(self.newTagButton, SIGNAL("clicked()"), self.editTag)   
    self.connect(self.deleteTagButton, SIGNAL("clicked()"), self.deleteTag)   
    self.connect(self.addTagNodesButton, SIGNAL("clicked()"), self.addTagNodes)   
    self.connect(self.removeTagNodesButton, SIGNAL("clicked()"), self.removeTagNodes)   
    self.connect(self.selectedTags, SIGNAL("itemDoubleClicked(QListWidgetItem*)"), self.editTag)
    self.connect(self.allTags, SIGNAL("itemDoubleClicked(QListWidgetItem*)"), self.editTag)
    self.tagsManager = TagsManager.get()
    if len(selectedNodesList) == 1 and selectedNodesList[0] == None:
      self.selectedNodesList = []
    else:
      self.selectedNodesList = selectedNodesList
    self.selectedNodes = []
    self.fillLists()
    self.translation()
Ejemplo n.º 9
0
    def start(self, args):
        try:
            node = args['node'].value()
        except:
            node = vfs().getnode("/")
        try:
            indexName = args['index_name'].value().lower()
        except IndexError:
            indexName = "dff"

        self.indexedTag = TagsManager.get().tag("indexed").id()
        self.es = Elasticsearch()
        self.es.indices.create(indexName, ignore=400)
        self.elasticConnection = ElasticConnection(self.es, indexName)

        self.total = node.totalChildrenCount() + 1
        self.currentCount = 0
        self.walk(node)
Ejemplo n.º 10
0
  def start(self, args):
   node  = args['node'].value()
   try:
     indexName = args['index_name'].value().lower()
   except IndexError:
     indexName = "dff"

   try:
     shost, sport = args['host'].value().split(':')
     sport = int(sport)
   except IndexError:
     shost, sport = ('localhost', 8089)
  
   try:
     susername = args['user_name'].value()
   except IndexError:
     susername = '******'

   try:
     spassword = args['password'].value()
   except IndexError:
     spassword = '******'

   if not self.service:
     self.service = client.connect(host=shost, port=sport, username=susername, password=spassword)
     assert isinstance(self.service, client.Service)

   if not self.indexedTag:
     tagsManager = TagsManager.get()
     try:
       self.indexedTag = tagsManager.tag("indexed").id()
     except KeyError:
       self.indexedTag = tagsManager.add("indexed") 

   if not self.index:
     if not indexName in self.service.indexes:
       self.index = self.service.indexes.create(indexName) 
     else:
       self.index = self.service.indexes[indexName]

   self.splunkConnection = SplunkConnection()
   self.total = node.totalChildrenCount() + 1
   self.currentCount = 0  
   self.walk(node)
Ejemplo n.º 11
0
 def __init__(self):
     Module.__init__(self, "elasticsearchindexer", ElasticIndexer)
     self.conf.addArgument({
         "name":
         "index_name",
         "input":
         Argument.Optional | Argument.Single | typeId.String,
         "description":
         "Elastic search index name",
         "parameters": {
             "type": Parameter.Editable,
             "predefined": ["dff"]
         }
     })
     self.flags = ["single", "generic"]
     self.tags = "Analyse"
     #self.icon = "splunk.jpg"
     self.depends = ['File systems', 'Volumes']
     tagsManager = TagsManager.get()
     tagsManager.add("indexed")
Ejemplo n.º 12
0
 def __init__(self):
     Module.__init__(self, "skindetection", SkinDetection)
     self.conf.addArgument({
         "name":
         "file",
         "description":
         "Parses metadata of this file",
         "input":
         Argument.Required | Argument.Single | typeId.Node
     })
     self.conf.addConstant({
         "name": "mime-type",
         "type": typeId.String,
         "description": "managed mime type",
         "values": ["image"]
     })
     self.conf.addArgument({
         "name":
         "tag",
         "input":
         Argument.Empty,
         "description":
         "Node will be tagged as 'explicit' if this argument is set"
     })
     self.conf.addArgument({
         "name":
         "threshold",
         "description":
         "Node will be tagged 'explicit' if percent of skin is superior than this value (default is 30 percent)",
         "input":
         Argument.Optional | Argument.Single | typeId.UInt64,
         "parameters": {
             "type": Parameter.Editable,
             "predefined": [30]
         }
     })
     self.flags = ["single"]
     self.tags = "Metadata"
     self.icon = ":meeting"
     tagsManager = TagsManager.get()
     tagsManager.add('explicit', 255, 85, 127)