Git Product home page Git Product logo

gmg_localfiles's Introduction

gmg_localfiles, plugin for GNU MediaGoblin

Plugin for importing files from your filesystem without duplication.

This plugin lets you have all your original files in one folder on your file system, and it will stop MediaGoblin from copying those files to its own locations.

It will try to make mediagoblin not touch/ruin your files (no guarantees!), but it will make a mg_cache folder in the directory.

The plugin has currently been tested on what will become MediaGoblin 0.7.

Example setup in mediagoblin.ini:

[storage:queuestore]
base_dir = /srv/media/Pictures
storage_class = gmg_localfiles.storage:PersistentFileStorage

[storage:publicstore]
base_dir = /srv/media/Pictures
base_url = /mgoblin_media/
storage_class = gmg_localfiles.storage:PersistentFileStorage

[plugins]
[[gmg_localfiles]]

You will also need to serve the files, so in paste.ini:

[app:publicstore_serve]
use = egg:Paste#static
document_root = %(here)s/user_dev/media/public/

Installation

Put gmg_localfiles somewhere on your Python path. You might even just put it inside the MediaGoblin folder if you want to be done with it quickly ;-)

Running

Go into the gmg_localfiles folder and run python import_files.py.

gmg_localfiles's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gmg_localfiles's Issues

import_files fails when run as a module

If the plugin has been placed in the mediagoblin plugins folder then when run with python -m from the mediagoblin folder, the import_files.py script fails to find the ini file because the path to the mediagoblin module that is returned is relative. The following little change (hack?) fixes that.

if __name__ == "__main__":
    mg_dir = os.path.dirname(mediagoblin.__path__[0])
    if mg_dir == ''":
        mg_dir = './'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.