@@ -74,14 +74,6 @@ def cast(func, value):
7474 return value
7575
7676
77- def getattributeOrNone (obj , self , attr ):
78- """ Returns result from __getattribute__ or None if not found. """
79- try :
80- return super (obj , self ).__getattribute__ (attr )
81- except AttributeError :
82- return None
83-
84-
8577def joinArgs (args ):
8678 """ Returns a query string (uses for HTTP URLs) where only the value is URL encoded.
8779 Example return value: '?genre=action&type=1337'.
@@ -129,7 +121,7 @@ def rget(obj, attrstr, default=None, delim='.'): # pragma: no cover
129121 if attrstr :
130122 return rget (value , attrstr , default , delim )
131123 return value
132- except :
124+ except : # noqa: E722
133125 return default
134126
135127
@@ -198,7 +190,8 @@ def toList(value, itemcast=None, delim=','):
198190 return [itemcast (item ) for item in value .split (delim ) if item != '' ]
199191
200192
201- def downloadSessionImages (server , filename = None , height = 150 , width = 150 , opacity = 100 , saturation = 100 ):
193+ def downloadSessionImages (server , filename = None , height = 150 , width = 150 ,
194+ opacity = 100 , saturation = 100 ): # pragma: no cover
202195 """ Helper to download a bif image or thumb.url from plex.server.sessions.
203196
204197 Parameters:
@@ -243,7 +236,7 @@ def download(url, filename=None, savepath=None, session=None, chunksize=4024,
243236 mocked (bool): Helper to do evertything except write the file.
244237 unpack (bool): Unpack the zip file.
245238 showstatus(bool): Display a progressbar.
246-
239+
247240 Example:
248241 >>> download(a_episode.getStreamURL(), a_episode.location)
249242 /path/to/file
@@ -278,7 +271,7 @@ def download(url, filename=None, savepath=None, session=None, chunksize=4024,
278271
279272 # save the file to disk
280273 log .info ('Downloading: %s' , fullpath )
281- if showstatus :
274+ if showstatus : # pragma: no cover
282275 total = int (response .headers .get ('content-length' , 0 ))
283276 bar = tqdm (unit = 'B' , unit_scale = True , total = total , desc = filename )
284277
@@ -288,7 +281,7 @@ def download(url, filename=None, savepath=None, session=None, chunksize=4024,
288281 if showstatus :
289282 bar .update (len (chunk ))
290283
291- if showstatus :
284+ if showstatus : # pragma: no cover
292285 bar .close ()
293286 # check we want to unzip the contents
294287 if fullpath .endswith ('zip' ) and unpack :
@@ -314,7 +307,7 @@ def tag_helper(tag, items, locked=True, remove=False):
314307 return data
315308
316309
317- def getMyPlexAccount (opts = None ):
310+ def getMyPlexAccount (opts = None ): # pragma: no cover
318311 """ Helper function tries to get a MyPlex Account instance by checking
319312 the the following locations for a username and password. This is
320313 useful to create user-friendly command line tools.
@@ -341,7 +334,7 @@ def getMyPlexAccount(opts=None):
341334 return MyPlexAccount (username , password )
342335
343336
344- def choose (msg , items , attr ):
337+ def choose (msg , items , attr ): # pragma: no cover
345338 """ Command line helper to display a list of choices, asking the
346339 user to choose one of the options.
347340 """
0 commit comments