예제 #1
0
파일: views.py 프로젝트: NuadaAndre/ezlog
def import_settings(request):
    from forms import ImportSettingsForm

    title = _("Import Settings")
    if request.method == "POST":
        form = ImportSettingsForm(request.POST, request.FILES)
        if form.is_valid():
            ezsettings.reset_settings_with_json_data(request.FILES["file"].read())
            return HttpResponseRedirect(reverse("ezconf.index"))
    else:
        form = ImportSettingsForm()
    return render_to_response("ezconf/import_settings.html", locals(), context_instance=RequestContext(request))
예제 #2
0
파일: views.py 프로젝트: lrbmx/ezlog
def import_settings(request):
    from forms import ImportSettingsForm
    title = _('Import Settings')
    if request.method == 'POST':
        form = ImportSettingsForm(request.POST, request.FILES)
        if form.is_valid():
            ezsettings.reset_settings_with_json_data(
                request.FILES['file'].read())
            return HttpResponseRedirect(reverse('ezconf.index'))
    else:
        form = ImportSettingsForm()
    return render_to_response('ezconf/import_settings.html',
                              locals(),
                              context_instance=RequestContext(request))
예제 #3
0
 def handle(self, *args, **options):
     from ezconf import ezsettings
     original_settings = ezsettings.as_readable_json()
     ezsettings.reset_settings_with_json_data(sys.stdin.read())
     print "//** Below are original settings were overridden:\n"
     sys.stdout.write(original_settings)
예제 #4
0
 def handle(self, *args, **options):
     from ezconf import ezsettings
     original_settings = ezsettings.as_readable_json()
     ezsettings.reset_settings_with_json_data(sys.stdin.read())
     print "//** Below are original settings were overridden:\n"
     sys.stdout.write(original_settings)