"""
Command to create symlink admin extras media 
"""

import os

from django.core.management.base import NoArgsCommand
from django.conf import settings

from rldjango.apps.destinfo.makepdf import createPdfInMemory


def createPdf():
    "Make one on the disk"
    filename = 'output.pdf'
    data = createPdfInMemory()
    f = open(filename, 'wb')
    f.write(data)
    f.close()
    print 'saved', filename
    
    

class Command(NoArgsCommand):
    """
    Ads desinfo_media command to manage.py
    """
    def handle_noargs(self, **options):
        """
        Prepares media for destinfo
        """
        createPdf()
