Close whole collection instead of just the database
This commit is contained in:
		
							parent
							
								
									60f12cf0a0
								
							
						
					
					
						commit
						9831159653
					
				@ -5,7 +5,6 @@ import tempfile
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
from anki import Collection
 | 
					from anki import Collection
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
class CollectionUtils:
 | 
					class CollectionUtils:
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Provides utility methods for creating, inspecting and manipulating anki
 | 
					    Provides utility methods for creating, inspecting and manipulating anki
 | 
				
			||||||
@ -26,7 +25,7 @@ class CollectionUtils:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        file_path = os.path.join(self.tempdir, "collection.anki2")
 | 
					        file_path = os.path.join(self.tempdir, "collection.anki2")
 | 
				
			||||||
        master_col = Collection(file_path)
 | 
					        master_col = Collection(file_path)
 | 
				
			||||||
        master_col.db.close()
 | 
					        master_col.close()
 | 
				
			||||||
        self.master_db_path = file_path
 | 
					        self.master_db_path = file_path
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __enter__(self):
 | 
					    def __enter__(self):
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user