| 
			
			 | 
		#121 | 
| 
			
			
			
			 Ex-Helpdesk Junkie 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421 
				Karma: 85400180 
				Join Date: Nov 2012 
				Location: The Beaten Path, USA, Roundworld, This Side of Infinity 
				
				
				Device: Kindle Touch fw5.3.7 (Wifi only) 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Also, note that it is now important to rely on the plugin launcher's recorded preferences dir, since Sigil 0.9.2 has the ability to relocate the preferences dir via an environment variable.  
		
	
		
		
		
		
		
		
		
		
		
		
	
	![]() I have mentioned that at portableapps.com so hopefully they will be using that once they publish a portable Sigil 0.9.2  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#122 | |
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,892 
				Karma: 207182180 
				Join Date: Jan 2010 
				
				
				
				Device: Nexus 7, Kindle Fire HD 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
  
		Last edited by DiapDealer; 12-21-2015 at 07:19 PM.  | 
|
| 
		
 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#123 | 
| 
			
			
			
			 Sigil Developer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,072 
				Karma: 6361556 
				Join Date: Nov 2009 
				
				
				
				Device: many 
				
				
				 | 
	
	
	
		
		
			
			 
				
				Head's Up for Plugin Developers:  autostart capability for plugins being added
			 
			
			
			This is a head's up for all plugin developers.  In my dev tree I have made changes to support the following new plugin.xml tag. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Code: 
	<autostart>true</autostart> Therefore this change should be completely backwards compatible and my plan is to add it for the next release of Sigil unless there is no interest from plugin developers. Also, if there is interest from plugin developers, I could also add an: Code: 
	<autoclose>true</autoclose> Please let me know what you think of the autostart capability and if you would like an autoclose tag as well. Thanks, KevinH  | 
| 
		
 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#124 | 
| 
			
			
			
			 Banned 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 272 
				Karma: 1224588 
				Join Date: Sep 2014 
				
				
				
				Device: Sony PRS 650 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I would appreciate both
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#125 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,763 
				Karma: 24088559 
				Join Date: Dec 2010 
				
				
				
				Device: Kindle PW2 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Both would be extremely helpful for validation plugins.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#126 | 
| 
			
			
			
			 Sigil Developer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,072 
				Karma: 6361556 
				Join Date: Nov 2009 
				
				
				
				Device: many 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Hi Doitsu, 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Validation plugins that report no errors (return an error value of 0 from run()) should already autoclose. That said, I went and added support for autoclose to my tree as well. If anyone builds their own, grab master today and you should have both for testing with. Take care, KevinH  | 
| 
		
 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#127 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,892 
				Karma: 207182180 
				Join Date: Jan 2010 
				
				
				
				Device: Nexus 7, Kindle Fire HD 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			That's quite lovely, thanks!
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		
 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#128 | 
| 
			
			
			
			 Banned 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 272 
				Karma: 1224588 
				Join Date: Sep 2014 
				
				
				
				Device: Sony PRS 650 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I'm adding a file with 
		
	
		
		
		
		
		
		
		
		
		
		
		
			Code: 
	bk.addfile(uid, basename, data, mt) Last edited by rubeus; 12-20-2015 at 03:40 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#129 | 
| 
			
			
			
			 Sigil Developer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,072 
				Karma: 6361556 
				Join Date: Nov 2009 
				
				
				
				Device: many 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			You have to add it to the spine.  You can add many file types that should not be added directly to the spine.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		
 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#130 | |
| 
			
			
			
			 Banned 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 272 
				Karma: 1224588 
				Join Date: Sep 2014 
				
				
				
				Device: Sony PRS 650 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Code: 
	bk._w.spine.append((uid, None)) Code: 
	Traceback (most recent call last):
  File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 301, in <module>
    sys.exit(main())
  File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 268, in main
    ps.launch()
  File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 149, in launch
    container._w.write_opf()
  File "C:\Program Files\Sigil\plugin_launchers\python\wrapper.py", line 268, in write_opf
    data = utf8_str(self.build_opf())
  File "C:\Program Files\Sigil\plugin_launchers\python\wrapper.py", line 256, in build_opf
    data.append(self.build_spine_xml())
  File "C:\Program Files\Sigil\plugin_launchers\python\wrapper.py", line 230, in build_spine_xml
    for (id, linear, properties) in self.spine:
ValueError: need more than 2 values to unpack
 | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#131 | 
| 
			
			
			
			 Sigil Developer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,072 
				Karma: 6361556 
				Join Date: Nov 2009 
				
				
				
				Device: many 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			No, you should not use calls to the wrapper directly.  ie. not bk._w ... 
		
	
		
		
		
		
		
		
		
		
		
		
		
			The correct call is direct to the bk object. See the bookcontainer.py code in the developers manual. bk.spine_insert_before(pos, sid, linear, properties=None) If you set the position, pos, to -1 or something greater than the number of current spine entries, it will append it to the end of the current spine. Last edited by KevinH; 12-20-2015 at 04:23 PM.  | 
| 
		
 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#132 | 
| 
			
			
			
			 Banned 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 272 
				Karma: 1224588 
				Join Date: Sep 2014 
				
				
				
				Device: Sony PRS 650 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Sorry i'm to dumb for that, what is linear? 
		
	
		
		
		
		
		
		
		
		
		
		
		
			Code: 
	bk.spine_insert_before(-1, uid, linear, properties=None) Last edited by rubeus; 12-20-2015 at 04:32 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#133 | 
| 
			
			
			
			 Sigil Developer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,072 
				Karma: 6361556 
				Join Date: Nov 2009 
				
				
				
				Device: many 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			That is the spine itemref linear attribute.  You can set it to None for default. 
		
	
		
		
		
		
		
		
		
		
		
		
		
			According to the spec, it determines if the referenced content is "primary" or not. It takes values "yes", "no", and can be left out entirely by setting it to None which then defaults to "yes". Last edited by KevinH; 12-20-2015 at 04:39 PM.  | 
| 
		
 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#134 | 
| 
			
			
			
			 Sigil Developer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,072 
				Karma: 6361556 
				Join Date: Nov 2009 
				
				
				
				Device: many 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I will test this from my end and get back to you soon. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	KevinH  | 
| 
		
 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#135 | |
| 
			
			
			
			 Banned 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 272 
				Karma: 1224588 
				Join Date: Sep 2014 
				
				
				
				Device: Sony PRS 650 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Code: 
	    uid = 'T12345' 
    bk.addfile(uid, 'Test0001.xhtml', xml, 'application/xhtml+xml')
    bk.spine_insert_before(-1, uid, None, properties=None)
Code: 
	Traceback (most recent call last):
  File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 301, in <module>
    sys.exit(main())
  File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 268, in main
    ps.launch()
  File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 149, in launch
    container._w.write_opf()
  File "C:\Program Files\Sigil\plugin_launchers\python\wrapper.py", line 268, in write_opf
    data = utf8_str(self.build_opf())
  File "C:\Program Files\Sigil\plugin_launchers\python\wrapper.py", line 256, in build_opf
    data.append(self.build_spine_xml())
  File "C:\Program Files\Sigil\plugin_launchers\python\wrapper.py", line 230, in build_spine_xml
    for (id, linear, properties) in self.spine:
TypeError: 'NoneType' object is not iterable
 | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
            
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Loading Plugin in development | Sladd | Development | 6 | 06-17-2014 07:57 PM | 
| Question for plugin development gurus | DiapDealer | Plugins | 2 | 02-05-2012 12:33 AM | 
| DR800 Plugin development for DR800/DR1000 | yuri_b | iRex Developer's Corner | 0 | 09-18-2010 10:46 AM | 
| Device plugin development | reader42 | Plugins | 10 | 03-29-2010 01:39 PM | 
| Calibre plugin development - Newbie problems | minstrel | Plugins | 5 | 04-12-2009 01:44 PM |