Skip to content
Newer
Older
100644 46 lines (37 sloc) 1.44 KB
dfa05b3 @alobbs Adds two new plug-ins files for the GZip and Deflate encoders. It also
alobbs authored Dec 5, 2010
1 # -*- coding: utf-8 -*-
2 #
3 # Cherokee-admin
4 #
5 # Authors:
6 # Alvaro Lopez Ortega <alvaro@alobbs.com>
7 #
8 # Copyright (C) 2010 Alvaro Lopez Ortega
9 #
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of version 2 of the GNU General Public
12 # License as published by the Free Software Foundation.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 # 02110-1301, USA.
23 #
24
25 import CTK
6f37701 Turns compression level setting into a combobox
taher authored Dec 10, 2010
26 import consts
dfa05b3 @alobbs Adds two new plug-ins files for the GZip and Deflate encoders. It also
alobbs authored Dec 5, 2010
27
28 URL_APPLY = '/plugin/gzip/apply'
29 HELPS = [('modules_encoders_gzip', _("GZip encoder"))]
30
c5c86ef @skarcha Mark a couple of sentences as internationalizable.
skarcha authored Dec 8, 2010
31 NOTE_LEVEL = N_("Compression Level from 0 to 9, where 0 is no compression, 1 best speed, and 9 best compression.")
dfa05b3 @alobbs Adds two new plug-ins files for the GZip and Deflate encoders. It also
alobbs authored Dec 5, 2010
32
33 class Plugin_gzip (CTK.Plugin):
34 def __init__ (self, key, **kwargs):
35 CTK.Plugin.__init__ (self, key, **kwargs)
36
37 table = CTK.PropsTable()
6f37701 Turns compression level setting into a combobox
taher authored Dec 10, 2010
38 table.Add (_("Compression Level"), CTK.ComboCfg('%s!compression_level'%(key), consts.COMPRESSION_LEVELS), _(NOTE_LEVEL))
dfa05b3 @alobbs Adds two new plug-ins files for the GZip and Deflate encoders. It also
alobbs authored Dec 5, 2010
39
40 submit = CTK.Submitter (URL_APPLY)
41 submit += table
42
43 self += submit
44
45 CTK.publish ('^%s'%(URL_APPLY), CTK.cfg_apply_post, method="POST")
Something went wrong with that request. Please try again.