Browse Source

set truthy values for Requests and Certificates

master
Edoardo Putti 8 years ago
parent
commit
7aa5b2a03c
2 changed files with 6 additions and 0 deletions
  1. +3
    -0
      certificate.py
  2. +3
    -0
      request.py

+ 3
- 0
certificate.py View File

@ -17,6 +17,9 @@ class Certificate(object):
def __repr__(self):
return ( "%s %s" % ( str(self.__class__.__name__), str(self.cert_id) ) )
def __bool__(self):
return os.path.exists(self.path)
@property
def path(self):
return os.path.join(OUTPUT_PATH, self.cert_id + '-cert.pub')

+ 3
- 0
request.py View File

@ -20,6 +20,9 @@ class SignRequest(object):
def __repr__(self):
return ( "%s %s" % ( str(self.__class__.__name__), str(self.req_id) ) )
def __bool__(self):
return os.path.exists(self.path)
@property
def name(self):
raise NotImplementedError()


Loading…
Cancel
Save