parameters: (self)
docstring: Verify integrity of the license file is integral, cnippet's version, and
          expiration date.
docstring_summary: Verify integrity of the license file is integral, cnippet's version, and
          expiration date.
docstring_tokens: Verify integrity of the license file is integral cnippet s version and expiration date .
function: def verify(self):
          """
          Verify integrity of the license file is integral, cnippet's version, and
          expiration date.
          """
  
          secret = '$*we#j238@#WA!%'
          h = hashlib.sha1()
          h.update(secret[10:12])
          h.update(base64.b64encode(self.product))
          h.update(secret[1:4])
          h.update(self.version[0])
          h.update(secret[6:9])
          h.update(self.email)
          h.update(self.expiration)
          digest = h.hexdigest()
  
          # If the hash doesn't match, data has been corrupted.
          if self.key != digest:
              sys.exit(DiagnosticReporter.fatal(CORRUPTED_LICENSE_FILE))
  
          # Verify product version.
          if int(self.version[0]) != Version().major:
              sys.exit(DiagnosticReporter.fatal(INCOMPATIBLE_LICENSE_PRODUCT_VERSION))
  
          # Verify expiration.
          exp_date = datetime.datetime.strptime(self.expiration, '%d/%B/%Y')
          if datetime.datetime.today() > exp_date:
              sys.exit(DiagnosticReporter.fatal(LICENSE_EXPIRED))
function_tokens: def verify ( self ) : secret = '$*we#j238@#WA!%' h = hashlib . sha1 ( ) h . update ( secret [ 10 : 12 ] ) h . update ( base64 . b64encode ( self . product ) ) h . update ( secret [ 1 : 4 ] ) h . update ( self . version [ 0 ] ) h . update ( secret [ 6 : 9 ] ) h . update ( self . email ) h . update ( self . expiration ) digest = h . hexdigest ( ) # If the hash doesn't match, data has been corrupted. if self . key != digest : sys . exit ( DiagnosticReporter . fatal ( CORRUPTED_LICENSE_FILE ) ) # Verify product version. if int ( self . version [ 0 ] ) != Version ( ) . major : sys . exit ( DiagnosticReporter . fatal ( INCOMPATIBLE_LICENSE_PRODUCT_VERSION ) ) # Verify expiration. exp_date = datetime . datetime . strptime ( self . expiration , '%d/%B/%Y' ) if datetime . datetime . today ( ) > exp_date : sys . exit ( DiagnosticReporter . fatal ( LICENSE_EXPIRED ) )