[okfn-labs] Creating a PyBossa app

Tom Morris tfmorris at gmail.com
Mon Nov 26 14:54:22 UTC 2012


Stefan Wehrmeyer replied to me off-list (thanks Stefan!) and provided the
key missing insight

>> I'm following the tutorial at
http://pybossa.readthedocs.org/en/latest/user/create-application-tutorial.html
and
it says:
>> Adding a tutorial is really simple: you only have to create a file named
tutorial.html and add it to the info object:
>> info = { 'thumbnail': http://hosting-service/thumbnail-name.png
>> ,
>>          'task_presenter': template.html file,
>>          'tutorial': tutorial.html
>>        }
>
>tutorial.html should be a string containing the file contents, so rather
file('tutorial.html').read().decode('utf-8')

The docs have been updated to say "template.html file" but I think Stefan's
formulation is much more explicit.  Since this is supposed to be an
example, why not just include the actual code i.e. *
file('template.html').read().decode('utf-8')*

Tom

On Mon, Nov 26, 2012 at 2:44 AM, Daniel Lombraña González <
teleyinex at gmail.com> wrote:

> Hi Tom,
>
> You are right, the documentation in this specific point is not good at
> all. For this reason I've opened a new issue<https://github.com/PyBossa/pybossa/issues/271>and hopefully this week will be solved soon enough. Meanwhile this is what
> the documentation should say more or less:
>
> In order to create a tutorial all you have to do is to create a HTML file
> without the header and the footer, as these elements are provided by
> PyBossa, and focus on the content that you want to create. The file that
> you will create will be read by the script file *createTasks.py* and
> basically dump the content of the file into the *info object*. The best
> way to create an application is to fork one of the PyBossa applications
> that have a tutorial and modify the files *template.html *and *
> tutorial.html*.
>
> I agree with you that this is not the best solution, and we will be
> implementing a way to work almost completely directly from the web side, so
> you will not need to actually touch any Python code. Meanwhile re-using
> app-flickrperson app-urbanparks or any other application in the Github
> repository should be enough (but probably not easy at all) to create any
> application. If you need more help on this, please, don't hesitate and ask
> here again as well as open new issues with all your fantastic feedback.
>
> I hope I've helped a bit.
>
> Cheers,
>
> Daniel
>
>
> On Fri, Nov 23, 2012 at 9:25 PM, Tom Morris <tfmorris at gmail.com> wrote:
>
>> I'm following the tutorial at
>> http://pybossa.readthedocs.org/en/latest/user/create-application-tutorial.htmland it says:
>>
>> Adding a tutorial is really simple: you only have to create a file named
>> *tutorial.html* and add it to the *info* object:
>>
>> info = { 'thumbnail': http://hosting-service/thumbnail-name.png,
>>          'task_presenter': template.html file,
>>          'tutorial': tutorial.html
>>        }
>>
>>
>> but I don't see anything in the API which describes how to upload
>> template.html or tutorial.html.  Is it assumed that I have write access to
>> the server through some other mechanism?  Or do I need to find a place to
>> host my own files and put absolute URLs in the info block?  I notice that
>> this thumbnail parameter seems to assume offsite storage.
>>
>> From my personal point of view, if I can't create a complete basic app
>> using the GUI, it's not really saving me anything because I'm gong to have
>> to break out Python to finish the job anyway.  It doesn't seem like it
>> would be that much more work to add 3 file browse fields and the form code
>> to upload them (or fields for off-set URLs if that's all that's supported).
>>  Similarly, why document how to handcraft a URL for testing purposes
>> (slug/presenter) when it'd be trivial to add a "Test Presenter" button to
>> the app management page.
>>
>> Has anyone actually created, debugged, and deployed an app by following
>> these directions without having direct access to the PyBoss server?  If
>> not, that would probably be a useful exercise.
>>
>> Tom
>>
>>
>>
>> _______________________________________________
>> okfn-labs mailing list
>> okfn-labs at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/okfn-labs
>> Unsubscribe: http://lists.okfn.org/mailman/options/okfn-labs
>>
>>
>
>
> --
>
> ··························································································································································
> http://github.com/teleyinex
> http://www.flickr.com/photos/teleyinex
>
> ··························································································································································
> Por favor, NO utilice formatos de archivo propietarios para el
> intercambio de documentos, como DOC y XLS, sino PDF, HTML, RTF, TXT, CSV
> o cualquier otro que no obligue a utilizar un programa de un
> fabricante concreto para tratar la información contenida en él.
>
> ··························································································································································
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/okfn-labs/attachments/20121126/a9ccbfb0/attachment-0002.html>


More information about the okfn-labs mailing list