Пример #1
0
 def processItem(self, job, item):
     #fullPath = transform.transformDirToInternal(item["fullPath"])
     #monitoringFullPath = transform.transformDirToInternal(item["monitoringPath"])
     
     #source_dir = item["SourceDir"]
     #misc.ensureDir(source_dir)
     
     tag = item["tag"]
     
     working_dir = item["WorkingDir"]
     misc.ensureDir(transform.transformDirToInternal(working_dir))
     
     target_dir = item["TargetDir"]
     misc.ensureDir(transform.transformDirToInternal(target_dir))
     
     import wwjufsdatabase.libs.services.servicesV2 as service
     req = service.req()
     t = tagSystem.getTagSysObj(req.getDbSys())
     e = t.getObjs(unicode(tag))
     for i in e:
         print i
         source_dir = transform.transformDirToInternal(i)
         
         AutoArchiveThumb(source_dir, target_dir, working_dir)
     job.delete()
     return False
     #Return true only when the item should be kept in the tube
     return True
Пример #2
0
 def on_ok_button_clicked(self, widget, data=None):
     import wwjufsdatabase.libs.services.servicesV2 as service
     req = service.req()
     #gtk.main_quit()
     entry = self.builder.get_object("entry1")
     tag = entry.get_text()
     print tag
     tag_list_raw = tag.split(",")
     tag_list = []
     for i in tag_list_raw:
         if i == "":
             continue
         tag_list.append(unicode(i))
     t = tagSystem.getTagSysObj(req.getDbSys())
     for i in self.liststore:
         #print i[0], i[1]
         if i[0]:
             url = i[1]
             url = url.replace("file:///", "")
             url = unicode(url)
             full_path = transform.transformDirToInternal(url)
             #print "full_path is:", full_path
             t.tag(full_path, tag_list)
             from localLibs.services.beanstalkdServices.TagProcessServiceV2 import TagProcessService
             p = TagProcessService()
             for cur_tag in tag_list:
                 p.addItem({"url":full_path, "tag":cur_tag})
     self.window1.hide()
Пример #3
0
    def processItem(self, job, item):
        #fullPath = transform.transformDirToInternal(item["fullPath"])
        #monitoringFullPath = transform.transformDirToInternal(item["monitoringPath"])
        
        #source_dir = item["SourceDir"]
        #misc.ensureDir(source_dir)
        
        tag = item["tag"]
        
        task_item = item
        
        if item.has_key("output_tube_name"):
            #################################
            # Adding tag processing task
            #################################
            task_item = item
            self.processing_tag_dict[tag] = item
            import wwjufsdatabase.libs.services.servicesV2 as service
            req = service.req()
            t = tagSystem.getTagSysObj(req.getDbSys())
            tagged_item_list = t.getObjs(unicode(tag))
        else:
            #################################
            # A new tag added for existing tag processing task
            #################################
            if self.processing_tag_dict.has_key(tag):
                #Task exist, add the new tagged elment for processing
                task_item = self.processing_tag_dict[tag]
                tagged_item_list = [transform.transformDirToInternal(item["url"])]
            else:
                #Not a valid item, return
                print "not a valid item or tag not have processor yet"
                job.delete()
                return False
            
            
        output_tube_name = task_item["output_tube_name"]
        
        working_dir = task_item["working_dir"]
        misc.ensureDir(transform.transformDirToInternal(working_dir))
        
        target_dir = task_item["target_dir"]
        misc.ensureDir(transform.transformDirToInternal(target_dir))
        
        
        b = beanstalkServiceBase(output_tube_name)

        for i in tagged_item_list:
            info(i)
            source_dir = transform.transformDirToInternal(i)
            
            b.addItem({"source_dir":source_dir, "working_dir": working_dir, "target_dir":target_dir})

        job.delete()
        return False
Пример #4
0
'''
Created on 2012-4-19

@author: Richard
'''

import wwjufsdatabase.libs.tag.tagSystemInterfaceV2 as tagSystem
if __name__ == '__main__':
    import wwjufsdatabase.libs.services.servicesV2 as service
    req = service.req()
    t = tagSystem.getTagSysObj(req.getDbSys())
    e = t.getObjs(u"download")
    for i in e:
        print i