~flimp-dev/flimp/trunk

« back to all changes in this revision

Viewing changes to examples/file_import.py

  • Committer: Nicholas Tollervey
  • Date: 2010-09-28 10:11:00 UTC
  • Revision ID: git-v1:eb73425ff9a8b26cd1267d17c59256dede1c07d9
Updated documentation in light of recent changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import logging
2
 
from flimp.file_handler import process
 
2
from flimp.file_handler import process, clean_data
3
3
from fom.session import Fluid
4
4
 
5
5
# optionally create a logger - you don't need to do this but it's good to be
28
28
about = 'id' # field whose value to use for the about tag
29
29
preview = False # True will cause flimp to print out the preview
30
30
 
31
 
# Make magic happen...
 
31
# A basic example
32
32
process(filename, root_path, name, desc, about, preview)
 
33
 
 
34
# If you only want to get the data structure from the file try this.
 
35
data = clean_data(filename)
 
36
 
 
37
# The variable "data" now contains a list of dictionaries where each
 
38
# dictionary defines the tags to be added to an individual object.