Changeset 92 for trunk/pysvnmanager/hooks/plugins/EolStyleCheck.py
- Timestamp:
- 2009年08月23日 12时15分25秒 (3 years ago)
- Files:
-
- 1 modified
-
trunk/pysvnmanager/hooks/plugins/EolStyleCheck.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pysvnmanager/hooks/plugins/EolStyleCheck.py
r50 r92 39 39 40 40 # Plugin config option/value in config ini file. 41 key = "eol_style_check"42 value = "yes"41 key_switch = "eol_style_check" 42 key_force = "eol_style_check_force" 43 43 44 44 section = 'pre_commit' … … 49 49 Simply call 'has_config()'. 50 50 """ 51 return self.has_config( )51 return self.has_config(self.key_switch) 52 52 53 53 def install_info(self): … … 58 58 reST reference: http://docutils.sourceforge.net/docs/user/rst/quickref.html 59 59 """ 60 return self.description 60 result = self.description 61 if self.enabled(): 62 result += "\n\n" 63 result += "**" + _("Current configuration") + "**\n\n" 64 force = self.get_config(self.key_force) 65 if force == "no": 66 result += "- " + _("Loose mode: permit checkin without svn:eol-style properity if no CRLF in text file.") 67 else: 68 result += "- " + _("Strict mode: must have svn:eol-style even if not CRLF in text file.") 69 70 return result 71 61 72 62 73 def install_config_form(self): … … 66 77 Any html and javascript are welcome. 67 78 """ 68 return "" 79 if self.get_config(self.key_force)=="no": 80 enable_checked = "" 81 disable_checked = "checked" 82 else: 83 enable_checked = "checked" 84 disable_checked = "" 85 86 result = "" 87 result += "<p><strong>%s</strong></p>" % _("Fill this form") 88 result += "<blockquote>" 89 result += "<dl>" 90 result += "\n<dt>" 91 result += "<input type='radio' name='force' value='yes' " + \ 92 enable_checked + ">" + _("Strict mode") + " " 93 result += "\n<dd>" 94 result += _("Must set svn:eol-style even if CRLF not in text file (in Unix format).") 95 result += "\n<dt>" 96 result += "<input type='radio' name='force' value='no' " + \ 97 disable_checked + ">" + _("Loose mode") + "<br>" 98 result += "\n<dd>" 99 result += _("Permit checkin without svn:eol-style properity if is in Unix file format (no crlf in text file).") 100 result += "\n</dl>" 101 result += "</blockquote>" 102 return result 69 103 70 104 def uninstall(self): … … 73 107 Simply call 'unset_config()' and 'save()'. 74 108 """ 75 self.unset_config() 109 self.unset_config(self.key_switch) 110 self.unset_config(self.key_force) 76 111 self.save() 77 112 … … 83 118 Form fields in setup_config() will pass as params. 84 119 """ 85 self.set_config() 120 force = params.get('force', 'no') 121 if force != 'no': 122 force = 'yes' 123 self.set_config(self.key_switch, 'yes') 124 self.set_config(self.key_force, force) 86 125 self.save() 87 126
![(please configure the [header_logo] section in trac.ini)](/trac/pysvnmanager/chrome/common/trac_banner.png)