Ticket #851: uppercase_labels.diff

File uppercase_labels.diff, 918 bytes (added by ianmartin, 15 years ago)

Allow upercase letters and spaces in labels

  • deluge/plugins/label/label/core.py

     
    4747import traceback 
    4848import re 
    4949 
    50 RE_VALID = re.compile("[a-z0-9_\-\.]*\Z") 
     50RE_VALID = re.compile("\A[\w\-\. ]*\Z") 
    5151 
    5252KNOWN_STATES = ['Downloading','Seeding','Paused','Checking','Queued','Error'] 
    5353STATE = "state" 
     
    185185        """add a label 
    186186        see label_set_options for more options. 
    187187        """ 
    188         label_id = label_id.lower() 
    189         CheckInput(RE_VALID.match(label_id) , _("Invalid label, valid characters:[a-z0-9_-]")) 
     188        CheckInput(RE_VALID.match(label_id) , _("Invalid label, valid characters:[a-zA-Z0-9_- ]")) 
    190189        CheckInput(label_id, _("Empty Label")) 
    191190        CheckInput(not (label_id in self.labels) , _("Label already exists")) 
    192191