# 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/>.
+from mediagoblin.media_types import MediaManagerBase
from mediagoblin.media_types.ascii.processing import process_ascii, \
sniff_handler
-MEDIA_MANAGER = {
- "human_readable": "ASCII",
- "processor": process_ascii, # alternately a string,
- # 'mediagoblin.media_types.image.processing'?
- "sniff_handler": sniff_handler,
- "display_template": "mediagoblin/media_displays/ascii.html",
- "default_thumb": "images/media_thumbs/ascii.jpg",
- "accepted_extensions": [
- "txt", "asc", "nfo"]}
+class ASCIIMediaManager(MediaManagerBase):
+ human_readable = "ASCII"
+ processor = staticmethod(process_ascii)
+ sniff_handler = staticmethod(sniff_handler)
+ display_template = "mediagoblin/media_displays/ascii.html"
+ default_thumb = "images/media_thumbs/ascii.jpg"
+ accepted_extensions = ["txt", "asc", "nfo"]
+
+
+MEDIA_MANAGER = ASCIIMediaManager