Merge branch 'master' into sqlmigrate

Conflicts:
	mediagoblin/db/sql/models.py
This commit is contained in:
Christopher Allan Webber 2012-02-18 10:01:47 -06:00
commit 63352aaf70
181 changed files with 656 additions and 372 deletions

View File

@ -30,7 +30,7 @@ If not, see <http://www.gnu.org/licenses/>.
JavaScript files located in the ``mediagoblin/`` directory tree
are free software: you can redistribute and/or modify them under the
terms of the GNU Lesser General Public License as published by the
terms of the GNU Affero General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at
your option) any later version.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 Free Software Foundation, Inc
# Copyright (C) 2011, 2012 GNU MediaGoblin Contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -154,13 +154,11 @@ then
mv docs/build/texinfo/ docs/texinfo/
rm -rf docs/build/
rm -rf docs/source/mgext/*.pyc
else
# this is the old directory structure pre-0.0.4
mv docs/_build/html/ docs/html/
rm -rf docs/_build/
rm -rf docs/mgext/*.pyc
fi
popd

View File

@ -1,7 +1,7 @@
#!/bin/bash
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 Free Software Foundation, Inc
# Copyright (C) 2011, 2012 GNU MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,3 +1,16 @@
.. MediaGoblin Documentation
Written in 2011, 2012 by MediaGoblin contributors
To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to
the public domain worldwide. This software is distributed without
any warranty.
You should have received a copy of the CC0 Public Domain
Dedication along with this software. If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
=======================
About GNU MediaGoblin
=======================

View File

@ -1,3 +1,16 @@
.. MediaGoblin Documentation
Written in 2011, 2012 by MediaGoblin contributors
To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to
the public domain worldwide. This software is distributed without
any warranty.
You should have received a copy of the CC0 Public Domain
Dedication along with this software. If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
.. _codebase-chapter:
========================
@ -35,8 +48,10 @@ Software Stack
* `Nose <http://somethingaboutorange.com/mrl/projects/nose/>`_:
for unit tests
* `buildout <http://www.buildout.org/>`_: for getting dependencies,
building a runtime environment, ...
* `virtualenv <http://www.virtualenv.org/>`_: for setting up an
isolated environment to keep mediagoblin and related packages
(potentially not required if MediaGoblin is packaged for your
distro)
* Data storage
@ -54,21 +69,47 @@ Software Stack
* `Routes <http://routes.groovie.org/>`_: for URL routing
* `Beaker <http://beaker.groovie.org/>`_: for handling sessions
* `Beaker <http://beaker.groovie.org/>`_: for handling sessions and
caching
* `Jinja2 <http://jinja.pocoo.org/docs/>`_: the templating engine
* `MongoKit <http://namlook.github.com/mongokit/>`_: the lightweight
ORM for MongoDB we're using which will make it easier to define
structures and all that
* `WTForms <http://wtforms.simplecodes.com/>`_: for handling,
validation, and abstraction from HTML forms
* `Celery <http://celeryproject.org/>`_: for task queuing (resizing
images, encoding video, ...)
* `RabbitMQ <http://www.rabbitmq.com/>`_: for sending tasks to celery
* `MongoKit <http://namlook.github.com/mongokit/>`_: the lightweight
ORM for MongoDB we're using which will make it easier to define
structures and all that (will be swapped out soon...)
* `SQLAlchemy <http://sqlalchemy.org/>`_: SQL ORM and database
interaction library for Python. We'll be moving to this in the
upcoming move to SQL.
* `Babel <http://babel.edgewall.org>`_: Used to extract and compile
translations.
* `Markdown (for python) <http://pypi.python.org/pypi/Markdown>`_:
implementation of `Markdown <http://daringfireball.net/projects/markdown/>`_
text-to-html tool to make it easy for people to write richtext
comments, descriptions, and etc.
* `lxml <http://lxml.de/>`_: nice xml and html processing for
python.
* Media processing libraries
* `Python Imaging Library <http://www.pythonware.com/products/pil/>`_:
used to resize and otherwise convert images for display.
* `GStreamer <http://gstreamer.freedesktop.org/>`_: (Optional, for
video hosting sites only) Used to transcode video, and in the
future, probably audio too.
* `chardet <http://pypi.python.org/pypi/chardet>`_: (Optional, for
ascii art hosting sites only) Used to make ascii art thumbnails.
* Front end
@ -79,7 +120,8 @@ Software Stack
What's where
============
After you've run buildout, you're faced with the following directory
After you've run checked out mediagoblin and followed the virtualenv
instantiation instructions, you're faced with the following directory
tree::
mediagoblin/
@ -89,12 +131,14 @@ tree::
| |- auth/
| \- submit/
|- docs/ # documentation
|- devtools/ # some scripts for developer convenience
|
| # the below directories are generated by buildout.
| # the below directories are installed into your virtualenv checkout
|
|- bin/ # scripts
|- develop-eggs/
|- eggs/
|- lib/ # python libraries installed into your virtualenv
|- include/
|- mediagoblin.egg-info/
|- parts/
|- user_dev/ # sessions, etc

View File

@ -25,7 +25,7 @@ sys.path.insert(0, os.path.abspath('.'))
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ["mgext.youcanhelp"]
extensions = []
# Add any paths that contain templates here, relative to this directory.
templates_path = ['source/_templates']
@ -41,7 +41,7 @@ master_doc = 'index'
# General information about the project.
project = u'GNU MediaGoblin'
copyright = u'2011, Free Software Foundation, Inc and contributors'
copyright = u'2011, 2012 GNU MediaGoblin contributors'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the

View File

@ -1,3 +1,16 @@
.. MediaGoblin Documentation
Written in 2011, 2012 by MediaGoblin contributors
To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to
the public domain worldwide. This software is distributed without
any warranty.
You should have received a copy of the CC0 Public Domain
Dedication along with this software. If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
.. _configuration-chapter:
========================
@ -7,6 +20,7 @@ Configuring MediaGoblin
So! You've got MediaGoblin up and running, but you need to adjust
some configuration parameters. Well you've come to the right place!
MediaGoblin's config files
==========================
@ -71,16 +85,20 @@ Common changes
Enabling email notifications
----------------------------
You'll almost certainly want to enable sending emails. By default,
You'll almost certainly want to enable sending email. By default,
MediaGoblin doesn't really do this... for the sake of developer
convenience, it runs in "email debug mode". Change this::
convenience, it runs in "email debug mode".
To make MediaGoblin send email, you need a mailer daemon.
Change this in your ``mediagoblin.ini`` file::
email_debug_mode = false
You can (and should) change the "from" email address by setting
``email_sender_address``.
You should also change the "from" email address by setting
``email_sender_address``. For example::
Note that you need a mailer daemon running for this to work.
email_sender_address = "foo@example.com"
If you have more custom SMTP settings, you also have the following
options at your disposal, which are all optional, and do exactly what
@ -91,17 +109,19 @@ they sound like.
- email_smtp_user
- email_smtp_pass
All other configuration changes
-------------------------------
To be perfectly honest, there are quite a few options and we haven't had
time to document them all
time to document them all.
So here's a cop-out section saying that if you get into trouble, hop
onto IRC and we'll help you out::
#mediagoblin on irc.freenode.net
Celery
======

View File

@ -1,3 +1,16 @@
.. MediaGoblin Documentation
Written in 2011, 2012 by MediaGoblin contributors
To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to
the public domain worldwide. This software is distributed without
any warranty.
You should have received a copy of the CC0 Public Domain
Dedication along with this software. If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
=====================
Deploying MediaGoblin
=====================
@ -118,7 +131,7 @@ Clone the MediaGoblin repository::
And setup the in-package virtualenv::
cd mediagoblin
virtualenv . && ./bin/python setup.py develop
(virtualenv --system-site-packages . || virtualenv .) && ./bin/python setup.py develop
.. note::

View File

@ -1,3 +1,16 @@
.. MediaGoblin Documentation
Written in 2011, 2012 by MediaGoblin contributors
To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to
the public domain worldwide. This software is distributed without
any warranty.
You should have received a copy of the CC0 Public Domain
Dedication along with this software. If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
========
Foreword
========

View File

@ -1,3 +1,16 @@
.. MediaGoblin Documentation
Written in 2011, 2012 by MediaGoblin contributors
To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to
the public domain worldwide. This software is distributed without
any warranty.
You should have received a copy of the CC0 Public Domain
Dedication along with this software. If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
==================================
How to Get Help with MediaGoblin
==================================

View File

@ -1,3 +1,16 @@
.. MediaGoblin Documentation
Written in 2011, 2012 by MediaGoblin contributors
To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to
the public domain worldwide. This software is distributed without
any warranty.
You should have received a copy of the CC0 Public Domain
Dedication along with this software. If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
.. GNU MediaGoblin documentation master file, created by
sphinx-quickstart on Thu Apr 7 20:10:27 2011.
You can adapt this file completely to your liking, but it should at least

View File

@ -1,3 +1,16 @@
.. MediaGoblin Documentation
Written in 2011, 2012 by MediaGoblin contributors
To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to
the public domain worldwide. This software is distributed without
any warranty.
You should have received a copy of the CC0 Public Domain
Dedication along with this software. If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
.. _media-types-chapter:
====================
@ -32,3 +45,22 @@ Note that you almost certainly want to separate Celery from the normal
paste process or your users will probably find that their connections
time out as the video transcodes. To set that up, check out the
":doc:`production-deployments`" section of this manual.
Ascii art
=========
To enable ascii art support, first install the
`chardet <http://pypi.python.org/pypi/chardet>`_
library, which is necessary for creating thumbnails of ascii art::
./bin/easy_install chardet
Next, modify (and possibly copy over from ``mediagoblin.ini``) your
``mediagoblin_local.ini``. Uncomment or add to the media_types line
'mediagoblin.media_types.ascii' like so::
media_types = mediagoblin.media_types.image, mediagoblin.media_types.ascii
Now any .txt file you uploaded will be processed as ascii art!

View File

@ -1,44 +0,0 @@
from docutils import nodes
from sphinx.util.compat import Directive, make_admonition
class youcanhelp_node(nodes.Admonition, nodes.Element):
pass
class YouCanHelp(Directive):
has_content = True
required_arguments = 0
optional_arguments = 0
final_argument_whitespace = False
option_spec = {}
def run(self):
ad = make_admonition(
youcanhelp_node,
self.name,
["You Can Help!"],
self.options,
self.content,
self.lineno,
self.content_offset,
self.block_text,
self.state,
self.state_machine)
ad[0].line = self.lineno
return ad
def visit_youcanhelp_node(self, node):
self.visit_admonition(node)
def depart_youcanhelp_node(self, node):
self.depart_admonition(node)
def setup(app):
app.add_node(
youcanhelp_node,
html=(visit_youcanhelp_node, depart_youcanhelp_node),
latex=(visit_youcanhelp_node, depart_youcanhelp_node),
text=(visit_youcanhelp_node, depart_youcanhelp_node)
)
app.add_directive('youcanhelp', YouCanHelp)

View File

@ -1,3 +1,16 @@
.. MediaGoblin Documentation
Written in 2011, 2012 by MediaGoblin contributors
To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to
the public domain worldwide. This software is distributed without
any warranty.
You should have received a copy of the CC0 Public Domain
Dedication along with this software. If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
=========================================
Considerations for Production Deployments
=========================================

View File

@ -1,3 +1,16 @@
.. MediaGoblin Documentation
Written in 2011, 2012 by MediaGoblin contributors
To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to
the public domain worldwide. This software is distributed without
any warranty.
You should have received a copy of the CC0 Public Domain
Dedication along with this software. If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
.. _theming-chapter:
=====================

1
extlib/exif/LICENSE Normal file
View File

@ -0,0 +1 @@
See top of EXIF.py for license and copyright.

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -23,4 +23,4 @@
# see http://www.python.org/dev/peps/pep-0386/
__version__ = "0.3.0.dev"
__version__ = "0.3.0-dev"

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -60,7 +60,9 @@ def register(request):
if request.method == 'POST' and register_form.validate():
# TODO: Make sure the user doesn't exist already
username = unicode(request.POST['username'].lower())
email = unicode(request.POST['email'].lower())
em_user, em_dom = unicode(request.POST['email']).split("@", 1)
em_dom = em_dom.lower()
email = em_user + "@" + em_dom
users_with_username = request.db.User.find(
{'username': username}).count()
users_with_email = request.db.User.find(

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011,2012 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -29,6 +29,7 @@ real objects.
from mediagoblin.auth import lib as auth_lib
from mediagoblin.tools import common, licenses
from mediagoblin.tools.text import cleaned_markdown_conversion
class UserMixin(object):
@ -39,8 +40,20 @@ class UserMixin(object):
return auth_lib.bcrypt_check_password(
password, self.pw_hash)
@property
def bio_html(self):
return cleaned_markdown_conversion(self.bio)
class MediaEntryMixin(object):
@property
def description_html(self):
"""
Rendered version of the description, run through
Markdown and cleaned with our cleaning tool.
"""
return cleaned_markdown_conversion(self.description)
def get_display_media(self, media_map,
fetch_order=common.DISPLAY_IMAGE_FETCHING_ORDER):
"""
@ -91,3 +104,13 @@ class MediaEntryMixin(object):
def get_license_data(self):
"""Return license dict for requested license"""
return licenses.SUPPORTED_LICENSES[self.license or ""]
class MediaCommentMixin(object):
@property
def content_html(self):
"""
the actual html-rendered version of the comment displayed.
Run through Markdown and the HTML cleaner.
"""
return cleaned_markdown_conversion(self.content)

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -29,6 +29,16 @@ def add_table_field(db, table_name, field_name, default_value):
multi=True)
def drop_table_field(db, table_name, field_name):
"""
Drop an old field from a table/collection
"""
db[table_name].update(
{field_name: {'$exists': True}},
{'$unset': {field_name: 1}},
multi=True)
# Please see mediagoblin/tests/test_migrations.py for some examples of
# basic migrations.
@ -115,3 +125,17 @@ def mediaentry_add_license(database):
Add the 'license' field for entries that don't have it.
"""
add_table_field(database, 'media_entries', 'license', None)
@RegisterMigration(9)
def remove_calculated_html(database):
"""
Drop pre-rendered html again and calculate things
on the fly (and cache):
- User.bio_html
- MediaEntry.description_html
- MediaComment.content_html
"""
drop_table_field(database, 'users', 'bio_html')
drop_table_field(database, 'media_entries', 'description_html')
drop_table_field(database, 'media_comments', 'content_html')

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -23,7 +23,7 @@ from mediagoblin.db.mongo import migrations
from mediagoblin.db.mongo.util import ASCENDING, DESCENDING, ObjectId
from mediagoblin.tools.pagination import Pagination
from mediagoblin.tools import url
from mediagoblin.db.mixin import UserMixin, MediaEntryMixin
from mediagoblin.db.mixin import UserMixin, MediaEntryMixin, MediaCommentMixin
###################
# Custom validators
@ -59,7 +59,6 @@ class User(Document, UserMixin):
- is_admin: Whether or not this user is an administrator or not.
- url: this user's personal webpage/website, if appropriate.
- bio: biography of this user (plaintext, in markdown)
- bio_html: biography of the user converted to proper HTML.
"""
__collection__ = 'users'
use_dot_notation = True
@ -76,7 +75,6 @@ class User(Document, UserMixin):
'is_admin': bool,
'url': unicode,
'bio': unicode, # May contain markdown
'bio_html': unicode, # May contain plaintext, or HTML
'fp_verification_key': unicode, # forgotten password verification key
'fp_token_expire': datetime.datetime,
}
@ -112,9 +110,6 @@ class MediaEntry(Document, MediaEntryMixin):
up with MarkDown for slight fanciness (links, boldness, italics,
paragraphs...)
- description_html: Rendered version of the description, run through
Markdown and cleaned with our cleaning tool.
- media_type: What type of media is this? Currently we only support
'image' ;)
@ -179,7 +174,6 @@ class MediaEntry(Document, MediaEntryMixin):
'slug': unicode,
'created': datetime.datetime,
'description': unicode, # May contain markdown/up
'description_html': unicode, # May contain plaintext, or HTML
'media_type': unicode,
'media_data': dict, # extra data relevant to this media_type
'plugin_data': dict, # plugins can dump stuff here.
@ -257,7 +251,7 @@ class MediaEntry(Document, MediaEntryMixin):
return self.db.User.find_one({'_id': self.uploader})
class MediaComment(Document):
class MediaComment(Document, MediaCommentMixin):
"""
A comment on a MediaEntry.
@ -266,8 +260,6 @@ class MediaComment(Document):
- author: user who posted this comment
- created: when the comment was created
- content: plaintext (but markdown'able) version of the comment's content.
- content_html: the actual html-rendered version of the comment displayed.
Run through Markdown and the HTML cleaner.
"""
__collection__ = 'media_comments'
@ -278,7 +270,7 @@ class MediaComment(Document):
'author': ObjectId,
'created': datetime.datetime,
'content': unicode,
'content_html': unicode}
}
required_fields = [
'media_entry', 'author', 'created', 'content']

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011,2012 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011,2012 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -56,7 +56,7 @@ def convert_users(mk_db):
copy_attrs(entry, new_entry,
('username', 'email', 'created', 'pw_hash', 'email_verified',
'status', 'verification_key', 'is_admin', 'url',
'bio', 'bio_html',
'bio',
'fp_verification_key', 'fp_token_expire',))
# new_entry.fp_verification_expire = entry.fp_token_expire
@ -77,7 +77,7 @@ def convert_media_entries(mk_db):
new_entry = MediaEntry()
copy_attrs(entry, new_entry,
('title', 'slug', 'created',
'description', 'description_html',
'description',
'media_type', 'state', 'license',
'fail_error',
'queued_task_id',))
@ -133,7 +133,7 @@ def convert_media_comments(mk_db):
new_entry = MediaComment()
copy_attrs(entry, new_entry,
('created',
'content', 'content_html',))
'content',))
copy_reference_attr(entry, new_entry, "media_entry")
copy_reference_attr(entry, new_entry, "author")

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011,2012 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -25,8 +25,10 @@ class PathTupleWithSlashes(TypeDecorator):
def process_bind_param(self, value, dialect):
if value is not None:
assert len(value), "Does not support empty lists"
value = '/'.join(value)
if len(value) == 0:
value = None
else:
value = '/'.join(value)
return value
def process_result_value(self, value, dialect):

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011,2012 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011,2012 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -14,6 +14,10 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
TODO: indexes on foreignkeys, where useful.
"""
import datetime
@ -27,7 +31,7 @@ from sqlalchemy.ext.associationproxy import association_proxy
from mediagoblin.db.sql.extratypes import PathTupleWithSlashes
from mediagoblin.db.sql.base import Base, DictReadAttrProxy
from mediagoblin.db.mixin import UserMixin, MediaEntryMixin
from mediagoblin.db.mixin import UserMixin, MediaEntryMixin, MediaCommentMixin
# It's actually kind of annoying how sqlalchemy-migrate does this, if
# I understand it right, but whatever. Anyway, don't remove this :P
@ -50,6 +54,10 @@ class SimpleFieldAlias(object):
class User(Base, UserMixin):
"""
TODO: We should consider moving some rarely used fields
into some sort of "shadow" table.
"""
__tablename__ = "users"
id = Column(Integer, primary_key=True)
@ -57,13 +65,12 @@ class User(Base, UserMixin):
email = Column(Unicode, nullable=False)
created = Column(DateTime, nullable=False, default=datetime.datetime.now)
pw_hash = Column(Unicode, nullable=False)
email_verified = Column(Boolean)
email_verified = Column(Boolean, default=False)
status = Column(Unicode, default=u"needs_email_verification", nullable=False)
verification_key = Column(Unicode)
is_admin = Column(Boolean, default=False, nullable=False)
url = Column(Unicode)
bio = Column(UnicodeText) # ??
bio_html = Column(UnicodeText) # ??
fp_verification_key = Column(Unicode)
fp_token_expire = Column(DateTime)
@ -74,6 +81,9 @@ class User(Base, UserMixin):
class MediaEntry(Base, MediaEntryMixin):
"""
TODO: Consider fetching the media_files using join
"""
__tablename__ = "media_entries"
id = Column(Integer, primary_key=True)
@ -82,9 +92,9 @@ class MediaEntry(Base, MediaEntryMixin):
slug = Column(Unicode)
created = Column(DateTime, nullable=False, default=datetime.datetime.now)
description = Column(UnicodeText) # ??
description_html = Column(UnicodeText) # ??
media_type = Column(Unicode, nullable=False)
state = Column(Unicode, nullable=False) # or use sqlalchemy.types.Enum?
state = Column(Unicode, default=u'unprocessed', nullable=False)
# or use sqlalchemy.types.Enum?
license = Column(Unicode)
fail_error = Column(Unicode)
@ -120,6 +130,8 @@ class MediaEntry(Base, MediaEntryMixin):
# attachment_files
# fail_error
_id = SimpleFieldAlias("id")
def get_comments(self, ascending=False):
order_col = MediaComment.created
if not ascending:
@ -149,6 +161,10 @@ class MediaEntry(Base, MediaEntryMixin):
class MediaFile(Base):
"""
TODO: Highly consider moving "name" into a new table.
TODO: Consider preloading said table in software
"""
__tablename__ = "mediafiles"
media_entry = Column(
@ -209,7 +225,7 @@ class MediaTag(Base):
return DictReadAttrProxy(self)
class MediaComment(Base):
class MediaComment(Base, MediaCommentMixin):
__tablename__ = "media_comments"
id = Column(Integer, primary_key=True)
@ -218,10 +234,11 @@ class MediaComment(Base):
author = Column(Integer, ForeignKey('users.id'), nullable=False)
created = Column(DateTime, nullable=False, default=datetime.datetime.now)
content = Column(UnicodeText, nullable=False)
content_html = Column(UnicodeText)
get_author = relationship(User)
_id = SimpleFieldAlias("id")
MODELS = [
User, MediaEntry, Tag, MediaTag, MediaComment]
@ -243,12 +260,20 @@ class MigrationData(Base):
######################################################
def show_table_init():
def show_table_init(engine_uri):
if engine_uri is None:
engine_uri = 'sqlite:///:memory:'
from sqlalchemy import create_engine
engine = create_engine('sqlite:///:memory:', echo=True)
engine = create_engine(engine_uri, echo=True)
Base.metadata.create_all(engine)
if __name__ == '__main__':
show_table_init()
from sys import argv
print repr(argv)
if len(argv) == 2:
uri = argv[1]
else:
uri = None
show_table_init(uri)

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011,2012 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -34,7 +34,7 @@ from mediagoblin.tools.response import render_to_response, redirect
from mediagoblin.tools.translate import pass_to_ugettext as _
from mediagoblin.tools.text import (
clean_html, convert_to_tag_list_of_dicts,
media_tags_as_string, cleaned_markdown_conversion)
media_tags_as_string)
from mediagoblin.tools.licenses import SUPPORTED_LICENSES
@ -72,9 +72,6 @@ def edit_media(request, media):
media.tags = convert_to_tag_list_of_dicts(
request.POST.get('tags'))
media.description_html = cleaned_markdown_conversion(
media.description)
media.license = unicode(request.POST.get('license', '')) or None
media.slug = unicode(request.POST['slug'])
@ -171,8 +168,6 @@ def edit_profile(request):
user.url = unicode(request.POST['url'])
user.bio = unicode(request.POST['bio'])
user.bio_html = cleaned_markdown_conversion(user.bio)
user.save()
messages.add_message(request,

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -8,7 +8,7 @@
# Elrond <elrond+mediagoblin.org@samba-tng.org>, 2011, 2012.
# <jakob.kramer@gmx.de>, 2011, 2012.
# Jan-Christoph Borchardt <JanCBorchardt@fsfe.org>, 2011.
# Jan-Christoph Borchardt <jan@unhosted.org>, 2011.
# Jan-Christoph Borchardt <jan@unhosted.org>, 2011, 2012.
# <kyoo@kyoo.ch>, 2011.
# <mediagoblin.org@samba-tng.org>, 2011.
# Rafael Maguiña <rafael.maguina@gmail.com>, 2011.
@ -16,10 +16,10 @@
msgid ""
msgstr ""
"Project-Id-Version: GNU MediaGoblin\n"
"Report-Msgid-Bugs-To: http://bugs.foocorp.net/projects/mediagoblin/issues\n"
"POT-Creation-Date: 2012-01-29 13:31-0600\n"
"PO-Revision-Date: 2012-01-29 19:44+0000\n"
"Last-Translator: Elrond <elrond+mediagoblin.org@samba-tng.org>\n"
"Report-Msgid-Bugs-To: http://issues.mediagoblin.org/\n"
"POT-Creation-Date: 2012-01-29 13:47-0600\n"
"PO-Revision-Date: 2012-02-05 20:23+0000\n"
"Last-Translator: Jan-Christoph Borchardt <jan@unhosted.org>\n"
"Language-Team: German (http://www.transifex.net/projects/p/mediagoblin/team/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -84,6 +84,8 @@ msgstr "Bestätigungs-E-Mail wurde erneut versandt."
msgid ""
"An email has been sent with instructions on how to change your password."
msgstr ""
"Es wurde eine Email mit Anweisungen für die Änderung des Passwortes an dich "
"gesendet."
#: mediagoblin/auth/views.py:270
msgid ""
@ -96,11 +98,11 @@ msgstr ""
#: mediagoblin/auth/views.py:282
msgid "Couldn't find someone with that username or email."
msgstr ""
msgstr "Es konnte niemand mit diesem Nutzernamen oder Email gefunden werden."
#: mediagoblin/auth/views.py:330
msgid "You can now log in using your new password."
msgstr ""
msgstr "Du kannst dich jetzt mit deinem neuen Passwort anmelden."
#: mediagoblin/edit/forms.py:25 mediagoblin/submit/forms.py:28
msgid "Title"
@ -117,10 +119,13 @@ msgid ""
" <a href=\"http://daringfireball.net/projects/markdown/basics\">\n"
" Markdown</a> for formatting."
msgstr ""
"Für Formatierung kannst du\n"
" <a href=\"http://daringfireball.net/projects/markdown/basics\">\n"
" Markdown</a> benutzen."
#: mediagoblin/edit/forms.py:33 mediagoblin/submit/forms.py:36
msgid "Tags"
msgstr "Markierungen"
msgstr "Schlagworte"
#: mediagoblin/edit/forms.py:35 mediagoblin/submit/forms.py:38
msgid "Separate tags by commas."
@ -161,6 +166,7 @@ msgstr "Altes Passwort"
#: mediagoblin/edit/forms.py:65
msgid "Enter your old password to prove you own this account."
msgstr ""
"Gib dein altes Passwort ein, um zu bestätigen dass du dieses Konto besitzt."
#: mediagoblin/edit/forms.py:68
msgid "New password"
@ -188,15 +194,15 @@ msgstr "Falsches Passwort"
#: mediagoblin/edit/views.py:222
msgid "Account settings saved"
msgstr ""
msgstr "Kontoeinstellungen gespeichert"
#: mediagoblin/media_types/__init__.py:77
msgid "Could not extract any file extension from \"{filename}\""
msgstr ""
msgstr "Es konnten keine Dateierweiterungen von »{filename}« gelesen werden."
#: mediagoblin/media_types/__init__.py:88
msgid "Sorry, I don't support that file type :("
msgstr ""
msgstr "Entschuldigung, dieser Dateityp wird nicht unterstützt."
#: mediagoblin/submit/forms.py:26
msgid "File"
@ -306,11 +312,11 @@ msgstr "Neuste Medien"
#: mediagoblin/templates/mediagoblin/auth/change_fp.html:32
msgid "Set your new password"
msgstr ""
msgstr "Dein neues Passwort"
#: mediagoblin/templates/mediagoblin/auth/change_fp.html:35
msgid "Set password"
msgstr ""
msgstr "Passwort setzen"
#: mediagoblin/templates/mediagoblin/auth/forgot_password.html:27
msgid "Recover password"
@ -400,7 +406,7 @@ msgstr "Änderungen speichern"
#: mediagoblin/templates/mediagoblin/edit/edit_account.html:34
#, python-format
msgid "Changing %(username)s's account settings"
msgstr ""
msgstr "%(username)s's Kontoeinstellungen werden geändert"
#: mediagoblin/templates/mediagoblin/edit/edit_profile.html:29
#, python-format
@ -411,7 +417,7 @@ msgstr "%(username)ss Profil bearbeiten"
#: mediagoblin/templates/mediagoblin/listings/tag.html:35
#, python-format
msgid "Media tagged with: %(tag_name)s"
msgstr "Medien markiert mit: %(tag_name)s"
msgstr "Medien mit Schlagwort: %(tag_name)s"
#: mediagoblin/templates/mediagoblin/media_displays/ascii.html:34
#: mediagoblin/templates/mediagoblin/media_displays/video.html:46
@ -424,6 +430,9 @@ msgid ""
"\t your web browser does not support HTML5 \n"
"\t video."
msgstr ""
"Entschuldige, dieses Video wird nicht funktionieren weil \n"
"<span class=\"whitespace other\" title=\"Tab\">»</span> dein Webbrowser kein HTML5 \n"
"<span class=\"whitespace other\" title=\"Tab\">»</span> Video unterstützt."
#: mediagoblin/templates/mediagoblin/media_displays/video.html:36
msgid ""
@ -431,14 +440,17 @@ msgid ""
"\t can play this video at <a href=\"http://getfirefox.com\">\n"
"\t http://getfirefox.com</a>!"
msgstr ""
"Hol dir einen modernen Webbrowser, der \n"
"<span class=\"whitespace other\" title=\"Tab\">»</span> dieses Video abspielen kann, <a href=\"http://getfirefox.com\">\n"
"<span class=\"whitespace other\" title=\"Tab\">»</span> Firefox</a>!"
#: mediagoblin/templates/mediagoblin/submit/start.html:26
msgid "Add your media"
msgstr ""
msgstr "Deine Medien"
#: mediagoblin/templates/mediagoblin/submit/start.html:30
msgid "Add"
msgstr ""
msgstr "Hinzufügen"
#: mediagoblin/templates/mediagoblin/user_pages/gallery.html:30
#, python-format
@ -453,7 +465,7 @@ msgstr "<a href=\"%(user_url)s\">%(username)s</a>s Medien"
#: mediagoblin/templates/mediagoblin/user_pages/media.html:72
#, python-format
msgid "Added on %(date)s."
msgstr ""
msgstr "Hinzugefügt am %(date)s."
#: mediagoblin/templates/mediagoblin/user_pages/media.html:81
msgid "Edit"
@ -475,11 +487,11 @@ msgstr "%(comment_count)s Kommentare"
#: mediagoblin/templates/mediagoblin/user_pages/media.html:95
msgid "No comments yet."
msgstr ""
msgstr "Bisher keine Kommentare."
#: mediagoblin/templates/mediagoblin/user_pages/media.html:103
msgid "Add one"
msgstr ""
msgstr "Kommentiere etwas"
#: mediagoblin/templates/mediagoblin/user_pages/media.html:112
msgid ""
@ -487,10 +499,13 @@ msgid ""
"href=\"http://daringfireball.net/projects/markdown/basics\">Markdown</a> for"
" formatting."
msgstr ""
"Für Formatierung kannst du <a "
"href=\"http://daringfireball.net/projects/markdown/basics\">Markdown</a> "
"benutzen."
#: mediagoblin/templates/mediagoblin/user_pages/media.html:116
msgid "Add this comment"
msgstr ""
msgstr "Kommentar absenden"
#: mediagoblin/templates/mediagoblin/user_pages/media.html:138
msgid "at"
@ -499,7 +514,7 @@ msgstr "bei"
#: mediagoblin/templates/mediagoblin/user_pages/media.html:153
#, python-format
msgid "<p>❖ Browsing media by <a href=\"%(user_url)s\">%(username)s</a></p>"
msgstr ""
msgstr "<p>❖ Medien von <a href=\"%(user_url)s\">%(username)s</a></p>"
#: mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html:30
#, python-format
@ -600,7 +615,7 @@ msgstr "Dieser Benutzer hat (noch) keine Daten in seinem Profil."
#: mediagoblin/templates/mediagoblin/user_pages/user.html:125
msgid "Change account settings"
msgstr ""
msgstr "Kontoeinstellungen ändern"
#: mediagoblin/templates/mediagoblin/user_pages/user.html:138
#, python-format
@ -628,11 +643,11 @@ msgstr "Atom-Feed"
#: mediagoblin/templates/mediagoblin/utils/license.html:21
msgid "License:"
msgstr ""
msgstr "Lizenz:"
#: mediagoblin/templates/mediagoblin/utils/license.html:25
msgid "All rights reserved"
msgstr ""
msgstr "Alle Rechte vorbehalten"
#: mediagoblin/templates/mediagoblin/utils/pagination.html:39
msgid "← Newer"
@ -649,16 +664,16 @@ msgstr "Zu Seite:"
#: mediagoblin/templates/mediagoblin/utils/prev_next.html:27
#: mediagoblin/templates/mediagoblin/utils/prev_next.html:32
msgid "newer"
msgstr ""
msgstr "neuer"
#: mediagoblin/templates/mediagoblin/utils/prev_next.html:38
#: mediagoblin/templates/mediagoblin/utils/prev_next.html:43
msgid "older"
msgstr ""
msgstr "älter"
#: mediagoblin/templates/mediagoblin/utils/tags.html:20
msgid "View more media tagged with"
msgstr ""
msgstr "Mehr Medien anschauen mit dem Schlagwort"
#: mediagoblin/templates/mediagoblin/utils/tags.html:25
msgid "or"
@ -666,7 +681,7 @@ msgstr "oder"
#: mediagoblin/tools/exif.py:68
msgid "Could not read the image file."
msgstr ""
msgstr "Die Bilddatei konnte nicht gelesen werden."
#: mediagoblin/user_pages/forms.py:30
msgid "I am sure I want to delete this"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2012-01-29 13:47-0600\n"
"POT-Creation-Date: 2012-02-09 09:30-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.6\n"
#: mediagoblin/processing.py:143
#: mediagoblin/processing.py:153
msgid "Invalid file given for media type."
msgstr ""

View File

@ -9,10 +9,10 @@
msgid ""
msgstr ""
"Project-Id-Version: GNU MediaGoblin\n"
"Report-Msgid-Bugs-To: http://bugs.foocorp.net/projects/mediagoblin/issues\n"
"POT-Creation-Date: 2012-01-29 13:31-0600\n"
"PO-Revision-Date: 2012-01-29 19:29+0000\n"
"Last-Translator: cwebber <cwebber@dustycloud.org>\n"
"Report-Msgid-Bugs-To: http://issues.mediagoblin.org/\n"
"POT-Creation-Date: 2012-01-29 13:47-0600\n"
"PO-Revision-Date: 2012-02-05 21:07+0000\n"
"Last-Translator: aleksejrs <deletesoftware@yandex.ru>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -109,6 +109,9 @@ msgid ""
" <a href=\"http://daringfireball.net/projects/markdown/basics\">\n"
" Markdown</a> for formatting."
msgstr ""
"Vi povas uzi por markado la lingvon\n"
" «<a href=\"http://daringfireball.net/projects/markdown/basics\">\n"
" Markdown</a>»."
#: mediagoblin/edit/forms.py:33 mediagoblin/submit/forms.py:36
msgid "Tags"
@ -136,7 +139,7 @@ msgstr ""
#: mediagoblin/edit/forms.py:44 mediagoblin/submit/forms.py:41
msgid "License"
msgstr ""
msgstr "Permesilo"
#: mediagoblin/edit/forms.py:50
msgid "Bio"
@ -184,7 +187,7 @@ msgstr "Kontagordoj estis konservitaj"
#: mediagoblin/media_types/__init__.py:77
msgid "Could not extract any file extension from \"{filename}\""
msgstr ""
msgstr "Ne eblis eltrovi finaĵon de la dosiernomo «{filename}»"
#: mediagoblin/media_types/__init__.py:88
msgid "Sorry, I don't support that file type :("
@ -289,6 +292,9 @@ msgid ""
" or\n"
" <a class=\"button_action\" href=\"http://wiki.mediagoblin.org/HackingHowto\">Set up MediaGoblin on your own server</a>"
msgstr ""
"<a class=\"button_action_highlight\" href=\"%(register_url)s\">Kreu konton en ĉi tiu retejo</a>\n"
" aŭ\n"
" <a class=\"button_action\" href=\"http://wiki.mediagoblin.org/HackingHowto\">ekfunkciigu MediaGoblinon en via propra servilo</a>"
#: mediagoblin/templates/mediagoblin/root.html:40
msgid "Most recent media"
@ -296,11 +302,11 @@ msgstr "Laste aldonitaj dosieroj"
#: mediagoblin/templates/mediagoblin/auth/change_fp.html:32
msgid "Set your new password"
msgstr ""
msgstr "Enigu vian novan pasvorton"
#: mediagoblin/templates/mediagoblin/auth/change_fp.html:35
msgid "Set password"
msgstr ""
msgstr "Difini pasvorton"
#: mediagoblin/templates/mediagoblin/auth/forgot_password.html:27
msgid "Recover password"
@ -475,7 +481,7 @@ msgstr "Estas neniom da komentoj."
#: mediagoblin/templates/mediagoblin/user_pages/media.html:103
msgid "Add one"
msgstr "Aldoni sian."
msgstr "Komenti"
#: mediagoblin/templates/mediagoblin/user_pages/media.html:112
msgid ""
@ -483,6 +489,8 @@ msgid ""
"href=\"http://daringfireball.net/projects/markdown/basics\">Markdown</a> for"
" formatting."
msgstr ""
"Vi povas uzi por markado la lingvon «&lt;a "
"href=\"http://daringfireball.net/projects/markdown/basics\"&gt;Markdown&lt;/a&gt;»."
#: mediagoblin/templates/mediagoblin/user_pages/media.html:116
msgid "Add this comment"
@ -496,6 +504,7 @@ msgstr "je"
#, python-format
msgid "<p>❖ Browsing media by <a href=\"%(user_url)s\">%(username)s</a></p>"
msgstr ""
"<p>❖ Foliumado de dosieraro de <a href=\"%(user_url)s\">%(username)s</a></p>"
#: mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html:30
#, python-format
@ -623,19 +632,19 @@ msgstr "Atom-a informfluo"
#: mediagoblin/templates/mediagoblin/utils/license.html:21
msgid "License:"
msgstr ""
msgstr "Permesilo:"
#: mediagoblin/templates/mediagoblin/utils/license.html:25
msgid "All rights reserved"
msgstr ""
msgstr "Ĉiuj rajtoj estas rezervitaj"
#: mediagoblin/templates/mediagoblin/utils/pagination.html:39
msgid "← Newer"
msgstr ""
msgstr "← Pli novaj"
#: mediagoblin/templates/mediagoblin/utils/pagination.html:45
msgid "Older →"
msgstr ""
msgstr "Malpli novaj →"
#: mediagoblin/templates/mediagoblin/utils/pagination.html:48
msgid "Go to page:"
@ -644,12 +653,12 @@ msgstr "Iri al paĝo:"
#: mediagoblin/templates/mediagoblin/utils/prev_next.html:27
#: mediagoblin/templates/mediagoblin/utils/prev_next.html:32
msgid "newer"
msgstr ""
msgstr "pli nova"
#: mediagoblin/templates/mediagoblin/utils/prev_next.html:38
#: mediagoblin/templates/mediagoblin/utils/prev_next.html:43
msgid "older"
msgstr ""
msgstr "malpli nova"
#: mediagoblin/templates/mediagoblin/utils/tags.html:20
msgid "View more media tagged with"
@ -661,7 +670,7 @@ msgstr "aŭ"
#: mediagoblin/tools/exif.py:68
msgid "Could not read the image file."
msgstr ""
msgstr "Malsukcesis lego de la bildodosiero"
#: mediagoblin/user_pages/forms.py:30
msgid "I am sure I want to delete this"

View File

@ -7,10 +7,10 @@
msgid ""
msgstr ""
"Project-Id-Version: GNU MediaGoblin\n"
"Report-Msgid-Bugs-To: http://bugs.foocorp.net/projects/mediagoblin/issues\n"
"POT-Creation-Date: 2012-01-29 13:31-0600\n"
"PO-Revision-Date: 2012-01-29 19:29+0000\n"
"Last-Translator: cwebber <cwebber@dustycloud.org>\n"
"Report-Msgid-Bugs-To: http://issues.mediagoblin.org/\n"
"POT-Creation-Date: 2012-01-29 13:47-0600\n"
"PO-Revision-Date: 2012-02-05 20:14+0000\n"
"Last-Translator: schendje <mail@jefvanschendel.nl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -140,7 +140,7 @@ msgstr ""
#: mediagoblin/edit/forms.py:44 mediagoblin/submit/forms.py:41
msgid "License"
msgstr ""
msgstr "Licentie"
#: mediagoblin/edit/forms.py:50
msgid "Bio"
@ -488,6 +488,9 @@ msgid ""
"href=\"http://daringfireball.net/projects/markdown/basics\">Markdown</a> for"
" formatting."
msgstr ""
"Voor opmaak kun je &lt;a "
"href=\"http://daringfireball.net/projects/markdown/basics\"&gt;Markdown&lt;/a&gt;"
" gebruiken."
#: mediagoblin/templates/mediagoblin/user_pages/media.html:116
msgid "Add this comment"
@ -630,11 +633,11 @@ msgstr "Atom feed"
#: mediagoblin/templates/mediagoblin/utils/license.html:21
msgid "License:"
msgstr ""
msgstr "Licentie:"
#: mediagoblin/templates/mediagoblin/utils/license.html:25
msgid "All rights reserved"
msgstr ""
msgstr "Alle rechten voorbehouden"
#: mediagoblin/templates/mediagoblin/utils/pagination.html:39
msgid "← Newer"
@ -668,7 +671,7 @@ msgstr "of"
#: mediagoblin/tools/exif.py:68
msgid "Could not read the image file."
msgstr ""
msgstr "Kon het afbeeldingsbestand niet lezen."
#: mediagoblin/user_pages/forms.py:30
msgid "I am sure I want to delete this"

View File

@ -7,10 +7,10 @@
msgid ""
msgstr ""
"Project-Id-Version: GNU MediaGoblin\n"
"Report-Msgid-Bugs-To: http://bugs.foocorp.net/projects/mediagoblin/issues\n"
"POT-Creation-Date: 2012-01-29 13:31-0600\n"
"PO-Revision-Date: 2012-01-29 19:29+0000\n"
"Last-Translator: cwebber <cwebber@dustycloud.org>\n"
"Report-Msgid-Bugs-To: http://issues.mediagoblin.org/\n"
"POT-Creation-Date: 2012-01-29 13:47-0600\n"
"PO-Revision-Date: 2012-02-05 21:04+0000\n"
"Last-Translator: aleksejrs <deletesoftware@yandex.ru>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -76,7 +76,7 @@ msgstr "Переслать сообщение с подтверждением а
#: mediagoblin/auth/views.py:260
msgid ""
"An email has been sent with instructions on how to change your password."
msgstr ""
msgstr "Вам отправлено электронное письмо с инструкциями по смене пароля."
#: mediagoblin/auth/views.py:270
msgid ""
@ -90,10 +90,11 @@ msgstr ""
#: mediagoblin/auth/views.py:282
msgid "Couldn't find someone with that username or email."
msgstr ""
"Не найдено никого с таким именем пользователя или адресом электронной почты."
#: mediagoblin/auth/views.py:330
msgid "You can now log in using your new password."
msgstr ""
msgstr "Теперь вы можете войти, используя ваш новый пароль."
#: mediagoblin/edit/forms.py:25 mediagoblin/submit/forms.py:28
msgid "Title"
@ -110,6 +111,9 @@ msgid ""
" <a href=\"http://daringfireball.net/projects/markdown/basics\">\n"
" Markdown</a> for formatting."
msgstr ""
"Для разметки можете использовать язык\n"
" <a href=\"http://daringfireball.net/projects/markdown/basics\">\n"
" Markdown</a>."
#: mediagoblin/edit/forms.py:33 mediagoblin/submit/forms.py:36
msgid "Tags"
@ -137,7 +141,7 @@ msgstr ""
#: mediagoblin/edit/forms.py:44 mediagoblin/submit/forms.py:41
msgid "License"
msgstr ""
msgstr "Лицензия"
#: mediagoblin/edit/forms.py:50
msgid "Bio"
@ -154,6 +158,8 @@ msgstr "Старый пароль"
#: mediagoblin/edit/forms.py:65
msgid "Enter your old password to prove you own this account."
msgstr ""
"Введите свой старый пароль в качестве доказательства, что это ваша учётная "
"запись."
#: mediagoblin/edit/forms.py:68
msgid "New password"
@ -174,7 +180,7 @@ msgstr "Вы редактируете профиль пользователя.
#: mediagoblin/edit/views.py:180
msgid "Profile changes saved"
msgstr ""
msgstr "Изменения профиля сохранены"
#: mediagoblin/edit/views.py:206
msgid "Wrong password"
@ -182,15 +188,15 @@ msgstr "Неправильный пароль"
#: mediagoblin/edit/views.py:222
msgid "Account settings saved"
msgstr ""
msgstr "Настройки учётной записи записаны"
#: mediagoblin/media_types/__init__.py:77
msgid "Could not extract any file extension from \"{filename}\""
msgstr ""
msgstr "Не удалось найти расширение в имени файла «{filename}»"
#: mediagoblin/media_types/__init__.py:88
msgid "Sorry, I don't support that file type :("
msgstr ""
msgstr "Увы, я не поддерживаю этот тип файлов :("
#: mediagoblin/submit/forms.py:26
msgid "File"
@ -289,6 +295,9 @@ msgid ""
" or\n"
" <a class=\"button_action\" href=\"http://wiki.mediagoblin.org/HackingHowto\">Set up MediaGoblin on your own server</a>"
msgstr ""
"&lt;a class=\"button_action_highlight\" href=\"%(register_url)s\"&gt;Создайте учётную запись на этом сайте&lt;/a&gt;\n"
" или\n"
" &lt;a class=\"button_action\" href=\"http://wiki.mediagoblin.org/HackingHowto\"&gt;установите MediaGoblin на собственный сервер&lt;/a&gt;"
#: mediagoblin/templates/mediagoblin/root.html:40
msgid "Most recent media"
@ -296,11 +305,11 @@ msgstr "Самые новые файлы"
#: mediagoblin/templates/mediagoblin/auth/change_fp.html:32
msgid "Set your new password"
msgstr ""
msgstr "Введите свой новый пароль"
#: mediagoblin/templates/mediagoblin/auth/change_fp.html:35
msgid "Set password"
msgstr ""
msgstr "Установить пароль"
#: mediagoblin/templates/mediagoblin/auth/forgot_password.html:27
msgid "Recover password"
@ -392,7 +401,7 @@ msgstr "Сохранить изменения"
#: mediagoblin/templates/mediagoblin/edit/edit_account.html:34
#, python-format
msgid "Changing %(username)s's account settings"
msgstr ""
msgstr "Настройка учётной записи %(username)s"
#: mediagoblin/templates/mediagoblin/edit/edit_profile.html:29
#, python-format
@ -416,6 +425,9 @@ msgid ""
"\t your web browser does not support HTML5 \n"
"\t video."
msgstr ""
"Сожалеем, этот ролик не проиграется, ⏎\n"
"» потому что ваш браузер не поддерживает ⏎\n"
"» видео в соответствии со стандартом HTML5."
#: mediagoblin/templates/mediagoblin/media_displays/video.html:36
msgid ""
@ -474,7 +486,7 @@ msgstr "Комментариев пока нет."
#: mediagoblin/templates/mediagoblin/user_pages/media.html:103
msgid "Add one"
msgstr "Добавить свой"
msgstr "Комментировать"
#: mediagoblin/templates/mediagoblin/user_pages/media.html:112
msgid ""
@ -482,6 +494,8 @@ msgid ""
"href=\"http://daringfireball.net/projects/markdown/basics\">Markdown</a> for"
" formatting."
msgstr ""
"Для разметки можете использовать язык <a "
"href=\"http://daringfireball.net/projects/markdown/basics\">Markdown</a>."
#: mediagoblin/templates/mediagoblin/user_pages/media.html:116
msgid "Add this comment"
@ -495,6 +509,8 @@ msgstr "в"
#, python-format
msgid "<p>❖ Browsing media by <a href=\"%(user_url)s\">%(username)s</a></p>"
msgstr ""
"<p>❖ Просмотр файлов пользователя <a "
"href=\"%(user_url)s\">%(username)s</a></p>"
#: mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html:30
#, python-format
@ -620,11 +636,11 @@ msgstr "лента в формате Atom"
#: mediagoblin/templates/mediagoblin/utils/license.html:21
msgid "License:"
msgstr ""
msgstr "Лицензия:"
#: mediagoblin/templates/mediagoblin/utils/license.html:25
msgid "All rights reserved"
msgstr ""
msgstr "Все права сохранены"
#: mediagoblin/templates/mediagoblin/utils/pagination.html:39
msgid "← Newer"
@ -658,7 +674,7 @@ msgstr "или"
#: mediagoblin/tools/exif.py:68
msgid "Could not read the image file."
msgstr ""
msgstr "Не удалось прочитать файл с изображением."
#: mediagoblin/user_pages/forms.py:30
msgid "I am sure I want to delete this"

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -91,7 +91,7 @@ def tag_atom_feed(request):
'type': 'text/html'}])
for entry in cursor:
feed.add(entry.get('title'),
entry.get('description_html'),
entry.description_html,
id=entry.url_for_self(request.urlgen,qualified=True),
content_type='html',
author={'name': entry.get_uploader.username,

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -24,4 +24,4 @@ MEDIA_MANAGER = {
"display_template": "mediagoblin/media_displays/ascii.html",
"default_thumb": "images/media_thumbs/ascii.jpg",
"accepted_extensions": [
"txt"]}
"txt", "asc", "nfo"]}

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -59,13 +59,14 @@ class AsciiToImage(object):
if kw.get('font_size'):
self._font_size = kw.get('font_size')
_log.info('Setting font to {0}, size {1}'.format(
self._font,
self._font_size))
self._if = ImageFont.truetype(
self._font,
self._font_size)
self._font_size,
encoding='unic')
_log.info('Font set to {0}, size {1}'.format(
self._font,
self._font_size))
# ,-,-^-'-^'^-^'^-'^-.
# ( I am a wall socket )Oo, ___
@ -91,6 +92,10 @@ class AsciiToImage(object):
- Character set detection and decoding,
http://pypi.python.org/pypi/chardet
'''
_log.debug('Drawing image')
# Convert the input from str to unicode
text = text.decode('utf-8')
# TODO: Account for alternative line endings
lines = text.split('\n')
@ -123,8 +128,8 @@ class AsciiToImage(object):
px_pos = self._px_pos(char_pos)
_log.debug('Writing character "{0}" at {1} (px pos {2}'.format(
char,
_log.debug('Writing character "{0}" at {1} (px pos {2})'.format(
char.encode('ascii', 'replace'),
char_pos,
px_pos))
@ -152,21 +157,3 @@ class AsciiToImage(object):
px_pos[index] = char_pos[index] * self._if_dims[index]
return px_pos
if __name__ == "__main__":
import urllib
txt = urllib.urlopen('file:///home/joar/Dropbox/ascii/install-all-the-dependencies.txt')
_log.setLevel(logging.DEBUG)
logging.basicConfig()
converter = AsciiToImage()
converter.convert(txt.read(), '/tmp/test.png')
'''
im, x, y, duration = renderImage(h, 10)
print "Rendered image in %.5f seconds" % duration
im.save('tldr.png', "PNG")
'''

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -13,14 +13,16 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import asciitoimage
import chardet
import os
import Image
import logging
from mediagoblin import mg_globals as mgg
from mediagoblin.processing import create_pub_filepath, THUMB_SIZE
from mediagoblin.media_types.ascii import asciitoimage
_log = logging.getLogger(__name__)
def process_ascii(entry):
'''
@ -42,6 +44,17 @@ def process_ascii(entry):
with queued_file:
queued_file_charset = chardet.detect(queued_file.read())
# Only select a non-utf-8 charset if chardet is *really* sure
# Tested with "Feli\x0109an superjaron", which was detecte
if queued_file_charset['confidence'] < 0.9:
interpreted_charset = 'utf-8'
else:
interpreted_charset = queued_file_charset['encoding']
_log.info('Charset detected: {0}\nWill interpret as: {1}'.format(
queued_file_charset,
interpreted_charset))
queued_file.seek(0) # Rewind the queued file
thumb_filepath = create_pub_filepath(
@ -59,6 +72,7 @@ def process_ascii(entry):
thumb.thumbnail(THUMB_SIZE, Image.ANTIALIAS)
thumb.save(thumb_file)
_log.debug('Copying local file to public storage')
mgg.public_store.copy_local_to_storage(
tmp_thumb_filename, thumb_filepath)
@ -73,13 +87,16 @@ def process_ascii(entry):
queued_file.seek(0) # Rewind *again*
unicode_filepath = create_pub_filepath(entry, 'unicode.txt')
unicode_filepath = create_pub_filepath(entry, 'ascii-portable.txt')
with mgg.public_store.get_file(unicode_filepath, 'wb') \
as unicode_file:
# Decode the original file from its detected charset (or UTF8)
# Encode the unicode instance to ASCII and replace any non-ASCII
# with an HTML entity (&#
unicode_file.write(
unicode(queued_file.read().decode(
queued_file_charset['encoding'])).encode(
unicode(queued_file.read().decode(
interpreted_charset)).encode(
'ascii',
'xmlcharrefreplace'))

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -14,6 +14,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
from celery.task import Task
from mediagoblin.db.util import ObjectId
@ -23,6 +25,7 @@ from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
from mediagoblin.media_types import get_media_manager
_log = logging.getLogger(__name__)
THUMB_SIZE = 180, 180
MEDIUM_SIZE = 640, 640
@ -57,12 +60,19 @@ class ProcessMedia(Task):
try:
#__import__(entry.media_type)
manager = get_media_manager(entry.media_type)
_log.debug('Processing {0}'.format(entry))
manager['processor'](entry)
except BaseProcessingFail, exc:
mark_entry_failed(entry._id, exc)
return
except ImportError, exc:
mark_entry_failed(entry[u'_id'], exc)
_log.error(
'Entry {0} failed to process due to an import error: {1}'\
.format(
entry.title,
exc))
mark_entry_failed(entry._id, exc)
entry.state = u'processed'
entry.save()

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -79,6 +79,22 @@ a.highlight {
color: #fff;
}
em {
font-style: italic;
}
strong {
font-weight: bold;
}
ul {
list-style: disc inside;
}
ol {
list-style: decimal inside;
}
label {
font-weight: normal;
}

View File

@ -1,6 +1,6 @@
/**
* GNU MediaGoblin -- federated, autonomous media hosting
* Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
* Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by

View File

@ -1,6 +1,6 @@
/**
* GNU MediaGoblin -- federated, autonomous media hosting
* Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
* Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by

View File

@ -1,6 +1,6 @@
/**
* GNU MediaGoblin -- federated, autonomous media hosting
* Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
* Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

View File

@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by

Some files were not shown because too many files have changed in this diff Show More