Cannot share code between __init__.py and search service

I have written a plug-in (MythRecordings - see elsewhere on this forum) with an __init__.py file that works fine. Now I want to add a search service - and I've got a lot of code I want to share between the two.
 
But I cannot figure that out - and I suspect it's because I've structured my directories wrong.
 
Here's my best shot at a directory tree - the channel (__init__.py) runs, it uses the SharedCodeService to access the shared code (plexmythlib.pys), which can get hold of the shared resource (somedata.json): 
+ MythRecordings.bundle
	+ Contents
		  Info.plist
		+ Code
			__init__.py
		+ Services
			  ServiceInfo.plist
			+ Search
				+ MythRecordings
					ServiceCode.pys
			+ Shared Code
				plexmythlib.pys
			+ Resources
				somedata.json

I've registered my services as folllows in ServiceInfo.plist:

<?xml version="1.0" encoding="UTF-8"?>



	Search
	
		MythRecordings
		
			Identifier
			dk.schaumburg-it.plexapp.mythrecordings
		
	


But I cannot get Plex to recognize my search service - looking at the error message, it seems to expect to find that code under

 
MythRecordings.bundle/Contents/Search Services/MythRecordings/ServiceCode.pys
 
instead of
 
MythRecordings.bundle/Contents/Services/Search/MythRecordings/ServiceCode.pys
 
But if I rename Services/Search => Search Services, my __init__.py cannot find the shared code anymore. And if I just move the ServiceCode.pys to the expected location, and leave the shared code where it is, the ServiceCode.pys cannot find the shared code in plexmythlib.pys.
 
Whenever I move things around, one thing starts working, and another stops.
 
Gaaarh - I'm confused!
 
Edit:
 
Specifically, if I try to load the shared code as follows (from the ServiceCode.pys):
GetMythTVRecordings = SharedCodeService.plexmythlib.GetMythTVRecordings

def Search(query):
oc = ObjectContainer(title1=‘Myth Search service results – Contents/Services/Search/MythRecordings/ServiceCode.pys’, title2=‘Search Results’)
return oc

I get
 
FrameworkException: ('No shared code object named "%s" was found.', 'plexmythlib')

Read the answer to the following thread

https://forums.plex.tv/topic/96745-help-with-librariesshared-for-sharing-code/

It is explained how and with a link to a channel code that actually does it.

In __init__.py it is used the way you did:

GetMythTVRecordings = SharedCodeService.plexmythlib.GetMythTVRecordings

And in ServiceCode.pys you will have to import it this way:

from plexmythlib import GetMythTVRecordings

@manfer

Thanks for helping out - however, I had followed the directions in that exact post, which was what made the whole thing so perplexing!

However - it turned out that there was an error in the shared code. It was clearly stated in the log, about half a page up, but I just fixated on the last "No shared code object named "%s" was found" line.

My apologies for wasting everyones time here  :(

For those having trouble with shared code, the conclusion is: the directory structure I outlined actually does work, as does the ServiceInfo.plist

Glad you got it worked out.  Sometimes finding things in the various logs can get interesting for sure ... that sort of stuff has tripped me up many times.