Skip to content

Commit

Permalink
minor: pep8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Fiers committed Nov 7, 2012
1 parent fdc4223 commit dcbdb4d
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions moa/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,59 +1,73 @@
# Copyright 2009-2011 Mark Fiers
# The New Zealand Institute for Plant & Food Research
#
#
# This file is part of Moa - http://github.com/mfiers/Moa
#
#
# Licensed under the GPL license (see 'COPYING')
#
#


class InvalidTemplate(Exception):
pass


class CannotGetAFileLock(Exception):
"""Cannot get a file lock"""
def __init__(self, f):
self.d = dir

def __str__(self):
return "Cannot get a file lock on %s" % self.f


class NotAMoaDirectory(Exception):
"""This is not a moa directory"""
def __init__(self, dir):
self.dir = dir

def __str__(self):
return "%s is not a MOA directory" % self.dir


class NotAMoaTemplate(Exception):
"""This is not a valid moa template"""
def __init__(self, template):
self.template = template

def __str__(self):
return "%s is not a MOA template" % self.template


class MoaFileError(Exception):
"""Error handling a file """
def __str__(self):
return "Moa error handling file"


class MoaDirNotWritable(Exception):
"""
Moa directory is not writable
"""
def __str__(self):
return "Moa directory (.moa) is not writable"


class MoaCommandDoesNotExist(Exception):
"""Command does not exists?"""
def __str__(self):
return "Command does not exist"



class MoaPermissionDenied(Exception):
"""Permission denied - you do not have the rights to perform this opperation """
"""Permission denied - you do not have the rights to perform this
operation
"""
def __str__(self):
return "Permission denied"


class MoaInvalidCommandLine(Exception):
"""Invalid command line"""
def __str__(self):
return "Invalid command line"

return "Invalid command line"

0 comments on commit dcbdb4d

Please sign in to comment.