strange error Plex global objects

hoi,

 

i am getting a strange error after i use a function from an imported file that uses the plex global objects. 

this doesn't always happen when i use plex global but is does happen after an couple imports.

 

in this case it is the Unit object. see the error below but if i replace the Unit with an standard python module the next plex object causes the same error

 

  File "C:\Users\Koos\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\runtime.py", line 837, in handle_request
    result = f(**d)
  File "C:\Users\Koos\AppData\Local\Plex Media Server\Plug-ins\PlexSpotnet.bundle\Contents\Code\Spotnet\BaseSpotnet.py", line 161, in post_download
    respons = SABnzbd.Helper.add_spotnet_post(post)
  File "C:\Users\Koos\AppData\Local\Plex Media Server\Plug-ins\PlexSpotnet.bundle\Contents\Code\SABnzbd\Helper.py", line 12, in add_spotnet_post
    resp = Api.add_file(post.get_nzb_content() , post.title , **kwargs)
  File "C:\Users\Koos\AppData\Local\Plex Media Server\Plug-ins\PlexSpotnet.bundle\Contents\Code\SABnzbd\Api.py", line 111, in add_file
    content_type , body = encode_multipart_formdata([("agent" , "Plex_spotnet")] , [("nzbfile" , "%s.nzb" % name , content)])
  File "C:\Users\Koos\AppData\Local\Plex Media Server\Plug-ins\PlexSpotnet.bundle\Contents\Code\SABnzbd\Api.py", line 122, in encode_multipart_formdata
    BOUNDARY = '----------%s' % ''.join (Util.RandomItemFromList(string.ascii_letters) for ii in range (30 + 1))
  File "C:\Users\Koos\AppData\Local\Plex Media Server\Plug-ins\PlexSpotnet.bundle\Contents\Code\SABnzbd\Api.py", line 122, in 
    BOUNDARY = '----------%s' % ''.join (Util.RandomItemFromList(string.ascii_letters) for ii in range (30 + 1))
NameError: global name 'Util' is not defined

the source code is here : %5Burl="https://github.com/loek17/PlexSpotnet.bundle"]https://github.com/loek17/PlexSpotnet.bundle

 

because this plugin uses data from newsservers it will only work after you set the correct data in the prefences.

 

i will try to create a simple plugin withs mimics this error

 

greets Loek

 

sorry for the bad english

 

 

 

------EDIT-----------

 

got the problem it was because i added an python importpath tot the sys module

Don't know how to fix it

relative import not working for my don't know why

 

the attached file is a simple plugin that shows the problem

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.