streetsign_server.external_source_types

External data, such as RSS feeds, weather, news, etc, are really useful things to be able to automatically add in to your signage system.

External Sources are set up on the feeds page, and deliver into various feeds, as you decide.

The different kinds of sources are defined here, in pretty much the same manner as post types. Read that documentation, and have a look at the rss post kind source, and it should make sense.

The main external Source Types:

StreetSign Digital Signage Project
  1. Copyright 2013 Daniel Fairhead

StreetSign is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

StreetSign is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with StreetSign. If not, see <http://www.gnu.org/licenses/>.


Main methods for working with multiple external source types.

Yes, this is very similar to post_types. If you feel like combining bits and making it more general, go for it.

streetsign_server.external_source_types.load(type_name)

load a module, and return it. (caches in this module)

streetsign_server.external_source_types.module_dict(name)

turns a name (string) into a dict ready for use in importing,

streetsign_server.external_source_types.modules()

a list of all post types modules which can be used/imported

streetsign_server.external_source_types.my(filename, level=1)

if this function is called from /x/y/z/blah.py, with filename=’potato.html’, it will return the contents of /x/y/z/potato.html.

streetsign_server.external_source_types.path_to_module(path)

given a path (/var/blah/x/__init__.py) return the name of x for importing (just x)

streetsign_server.external_source_types.receive(posttype, form)

hand a form object from a request on to the appropriate handler

streetsign_server.external_source_types.types()

return a list of dicts of all post types.

The RSS Source Type

Pull data from an RSS feed

streetsign_server.external_source_types.rss.form(data)

the form for editing this type of post

streetsign_server.external_source_types.rss.get_new(data)

ok, actually go get us some new posts, alright? (return new posts, and update data with any hidden fields updated that we need to (current_posts, for instance))

streetsign_server.external_source_types.rss.make_templater(data)

from the info in data, return a html cleaner function.

streetsign_server.external_source_types.rss.receive(request)

get data from the admin, extract the data, and return the object we actually need to save.

streetsign_server.external_source_types.rss.test(data)

we get sent a copy of the data, and should reply with some HTML that reassures the user if the url/whatever is correct (preferably with some data from the feed)

The Local Folder Source Type

Look in a local images folder (on this computer) for pictures, and pull them into a feed.

streetsign_server.external_source_types.localfolderimages.form(data)

the form for editing this type of post

streetsign_server.external_source_types.localfolderimages.get_new(data)

ok, actually go get us some new posts, alright? (return new posts, and update data with any hidden fields updated that we need to (current_posts, for instance))

streetsign_server.external_source_types.localfolderimages.receive(request)

get data from the admin, extract the data, and return the object we actually need to save.

streetsign_server.external_source_types.localfolderimages.test(data)

we get sent a copy of the data, and should reply with some HTML that reassures the user if the path/whatever is correct (preferably with some data from the feed)