VirtualMailManager/common.py
branchv0.6.x
changeset 350 b7a4d7828608
parent 347 586367ee042b
child 366 d6573da35b5f
equal deleted inserted replaced
349:d60ffbc0124b 350:b7a4d7828608
    57     Throws a `VMMError` if the `binary` isn't a file or is not
    57     Throws a `VMMError` if the `binary` isn't a file or is not
    58     executable.
    58     executable.
    59     """
    59     """
    60     binary = expand_path(binary)
    60     binary = expand_path(binary)
    61     if not os.path.isfile(binary):
    61     if not os.path.isfile(binary):
    62         raise VMMError(_(u"'%s' is not a file") % get_unicode(binary),
    62         raise VMMError(_(u"No such file: '%s'") % get_unicode(binary),
    63                        NO_SUCH_BINARY)
    63                        NO_SUCH_BINARY)
    64     if not os.access(binary, os.X_OK):
    64     if not os.access(binary, os.X_OK):
    65         raise VMMError(_(u"File is not executable: '%s'") %
    65         raise VMMError(_(u"File is not executable: '%s'") %
    66                        get_unicode(binary), NOT_EXECUTABLE)
    66                        get_unicode(binary), NOT_EXECUTABLE)
    67     return binary
    67     return binary