Mercurial > hg > gcmultimerge
comparison multimerge.py @ 76:a63cc3633adb
Put log levels array into its own global variable.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 13 Jul 2016 11:50:25 +0300 |
parents | ee05430f1a4d |
children | e5e7b6e9bd44 |
comparison
equal
deleted
inserted
replaced
75:ee05430f1a4d | 76:a63cc3633adb |
---|---|
34 ### | 34 ### |
35 gcm_no_compare_fields = [ | 35 gcm_no_compare_fields = [ |
36 "id", "iCalUID", "etag", "sequence", "gcm_cal_id", | 36 "id", "iCalUID", "etag", "sequence", "gcm_cal_id", |
37 "created", "updated", "htmlLink", "organizer", "creator", | 37 "created", "updated", "htmlLink", "organizer", "creator", |
38 ] | 38 ] |
39 | |
40 gcm_log_levels = ["CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG"] | |
39 | 41 |
40 | 42 |
41 ## Wrapper for print() that does not break when redirecting stdin/out | 43 ## Wrapper for print() that does not break when redirecting stdin/out |
42 ## because of piped output not having a defined encoding. We default | 44 ## because of piped output not having a defined encoding. We default |
43 ## to UTF-8 encoding in output here. | 45 ## to UTF-8 encoding in output here. |
258 | 260 |
259 def is_log_level(self, mvalue): | 261 def is_log_level(self, mvalue): |
260 if not self.is_str(mvalue): | 262 if not self.is_str(mvalue): |
261 return False | 263 return False |
262 else: | 264 else: |
263 return mvalue.upper() in ["CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG"] | 265 return mvalue.upper() in gcm_log_levels |
264 | 266 |
265 def trans_log_level(self, mvalue): | 267 def trans_log_level(self, mvalue): |
266 return mvalue.upper() | 268 return mvalue.upper() |
267 | 269 |
268 def is_filename(self, mvalue): | 270 def is_filename(self, mvalue): |