Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- from PyKDE4.nepomuk2 import Nepomuk2
- def tagging(file_name, tags):
- resource_manager = Nepomuk2.ResourceManager.instance()
- if not resource_manager.initialized():
- return
- absolute_path = os.path.abspath(file_name)
- resource = Nepomuk2.Resource(absolute_path)
- for tag in tags:
- nepomuk_tag = Nepomuk2.Tag(tag)
- resource.addTag(nepomuk_tag)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement