+ model.Session.commit()
+
+
+ ### Filesystem stuff
+ # Only necessary if we're using the filesystem for storage.
+ # And we are!
+ art_path = os.path.join(config['app_conf']['static_root'], 'art')
+ # Test that we can write to the art directory
+ if os.access(art_path, os.W_OK | os.X_OK):
+ # Create directories for various image sizes
+ for subdir in ['original', 'medium', 'thumbnail']:
+ path = os.path.join(art_path, subdir)
+ # If it exists, it should be writeable. If not, create it.
+ if os.path.exists(path):
+ if not os.access(path, os.W_OK | os.X_OK):
+ print "*** WARNING: Can't write to the art/{0} " \
+ "directory!".format(subdir)
+ continue
+ os.makedirs(path)
+ else:
+ print "*** WARNING: Can't write to the art directory!"