Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ZODB.DB
- import ZODB.FileStorage
- filename = 'var/filestorage/Data.fs'
- foldername = 'news-'
- savepath = 'news_pexego/'
- storage = ZODB.FileStorage.FileStorage(filename, read_only=1)
- DB = ZODB.DB(storage)
- conn = DB.open()
- root = conn.root()['Application']
- site = root['pexego.es']
- folder = site['news-']
- for item in news.items():
- ATitem = item[1]
- exported_file = open(savepath+item[0]+'.txt', 'w')
- exported_content = """
- Titulo: %s
- -------------------------------------
- Resumen:
- %s
- -------------------------------------
- Cuerpo:
- %s
- -------------------------------------
- """ % (ATitem.title, ATitem.Description, ATitem.getText())
- # Rest of the code goes here (Still working on that, but it just put the
- # contents into the file and closes it)
Add Comment
Please, Sign In to add comment