Opened 8 years ago

Doesn't import the attachments for a page

Reported by: Owned by: srevill@… Tristan Rivoallan normal WikiImportPlugin normal 0.11

Description

The reason I installed this plugin was to save me from manually importing the very many image attachments we have on a number of tutorial wiki pages. Sadly, this plugin only imports wiki pages and none of their attachments. I could've done that manually in the time it took to install the plugin :(

Any chance this feature could be added? Something along these lines would do it for a single file...

import os
from trac.attachment import Attachment

wikidir = r'C:\Path\To\My\TracProject'

filename = r'c:\Path\To\My\Images\2_0.jpg'

attachment = Attachment(admin.env_open(), 'wiki', 'tutorials/page1')

size = os.stat(filename)[6]
attfile = open(filename,'rb')

attachment.insert(os.path.basename(filename), attfile, size)


Modify Ticket

Change Properties