| 
			
			 | 
		#1 | 
| 
			
			
			
			 Generally Awesome Person 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,100 
				Karma: 2191133 
				Join Date: Jan 2013 
				Location: /dev/kmem 
				
				
				Device: Kobo Clara HD, Kindle Oasis 
				
				
				 | 
	
	
	
		
		
			
			 
				
				Unit testing calibre plugins
			 
			
			
			I just realized I can run arbitrary Python scripts through calibre-debug, which is finally allowing me to start writing some proper tests. There's a couple things I'm wondering about though. I'll be running everything on a Linux machine which I hope makes it all easier. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	
  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			1) You append to sys.path 
		
	
		
		
		
		
		
		
		
		
		
		
	
	2, 3) See the various environment variables calibre uses, including controlling interface language and config directory https://manual.calibre-ebook.com/cus...ment-variables Note that binary builds of calibre from the python 3 betas onward always use UTF-8 regardless of environment variables. For python 2 calibre things are more complicated, since there python's internal encoding selection mechanics are used. 4) Just create your own empyt config dir and tell calibre to use it via the env var above and then use calibre-customize -b to install your plugin into that config dir.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
![]()  | 
            
        
    
| Thread Tools | Search this Thread | 
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Calibre-server systemd socket unit example | davidreads | Server | 1 | 01-10-2020 05:38 PM | 
| Beta testing calibre 4 | kovidgoyal | Calibre | 385 | 10-17-2019 04:15 AM | 
| Calibre Companion connecting unit / computer | jayp2013mobile | Calibre Companion | 23 | 03-03-2016 03:07 PM | 
| Calibre Portable like the Calibre on PC (espec. settings and plugins)? | manawydan | Devices | 6 | 01-23-2013 07:45 AM | 
| Calibre has no choice on font size unit in css? | naisren | ePub | 6 | 09-30-2012 10:41 AM |