コード例 #1
0
 def fetch(self, key):
     self.create_db_if_needed()
     with self.cursor() as cursor:
         cursor.execute("""
             select value from hypothesis_data_mapping
             where key = ?
         """, (b64encode(key),))
         for (value,) in cursor:
             try:
                 yield b64decode(value)
             except (binascii.Error, TypeError):
                 pass
コード例 #2
0
ファイル: database.py プロジェクト: E-Tahta/python-hypothesis
 def fetch(self, key):
     self.create_db_if_needed()
     with self.cursor() as cursor:
         cursor.execute("""
             select value from hypothesis_data_mapping
             where key = ?
         """, (b64encode(key),))
         for (value,) in cursor:
             try:
                 yield b64decode(value)
             except (binascii.Error, TypeError):
                 pass