Пример #1
0
 def __check_perms(self):
     perms = None
     if self._options:  
         try:
             perms = get_perms(self.configFile)
         except OSError, data:
             self._options.print_help()
             raise Exception("*** could not find config file: %s" % data)
             sys.exit(1)
Пример #2
0
 def __check_perms(self):
     perms = None
     if self._options:
         try:
             perms = get_perms(self.configFile)
         except OSError, data:
             self._options.print_help()
             raise Exception("*** could not find config file: %s" % data)
             sys.exit(1)
Пример #3
0
                              self._dict[section][option] = \
                                               self._options[section][option]

    ## UNUSED METHOD
    ## zim: is too :)
    def __check_perms(self):
        perms = None
        if self._options:  
            try:
                perms = get_perms(self.configFile)
            except OSError, data:
                self._options.print_help()
                raise Exception("*** could not find config file: %s" % data)
                sys.exit(1)
        else:
            perms = get_perms(self.configFile)
               
        if perms != requiredPerms:
            error = "*** '%s' has invalid permission: %s should be %s\n" % \
                (self.configFile, perms, requiredPerms)
            raise Exception( error)
            sys.exit(1)

    def replace_escape_seqs(self):
      """ replace any escaped characters """
      replace_escapes(self)

class formatter(IndentedHelpFormatter):
    def format_option_strings(self, option):
        """Return a comma-separated list of option strings & metavariables."""
        if option.takes_value():
Пример #4
0
                                self._dict[section][option] = \
                                                 self._options[section][option]

    ## UNUSED METHOD
    ## zim: is too :)
    def __check_perms(self):
        perms = None
        if self._options:
            try:
                perms = get_perms(self.configFile)
            except OSError, data:
                self._options.print_help()
                raise Exception("*** could not find config file: %s" % data)
                sys.exit(1)
        else:
            perms = get_perms(self.configFile)

        if perms != requiredPerms:
            error = "*** '%s' has invalid permission: %s should be %s\n" % \
                (self.configFile, perms, requiredPerms)
            raise Exception(error)
            sys.exit(1)

    def replace_escape_seqs(self):
        """ replace any escaped characters """
        replace_escapes(self)


class formatter(IndentedHelpFormatter):
    def format_option_strings(self, option):
        """Return a comma-separated list of option strings & metavariables."""