Skip to content
This repository was archived by the owner on Apr 8, 2022. It is now read-only.

Commit 8447e0d

Browse files
committed
Remove spacing from blank lines
1 parent 97fea40 commit 8447e0d

File tree

8 files changed

+415
-455
lines changed

8 files changed

+415
-455
lines changed

common.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99
class printDebug:
1010

1111
def __init__(self, main, sub=None):
12-
12+
1313
self.main=main
1414
if sub:
1515
self.sub="."+sub
1616
else:
1717
self.sub=''
18-
18+
1919
self.level=settings.get_debug()
20-
20+
2121
self.DEBUG_OFF=0
2222
self.DEBUG_INFO=1
2323
self.DEBUG_DEBUG=2
2424
self.DEBUG_DEBUGPLUS=3
2525
self.token_regex=re.compile('-Token=[a-z|0-9].*[&|$]')
2626
self.ip_regex=re.compile('\.\d{1,3}\.\d{1,3}\.')
27-
27+
2828
self.DEBUG_MAP={ self.DEBUG_OFF : "off",
2929
self.DEBUG_INFO : "info",
3030
self.DEBUG_DEBUG : "debug",
@@ -35,26 +35,26 @@ def get_name(self, level):
3535

3636
def error(self,message):
3737
return self.__printDebug(message, 0)
38-
38+
3939
def info(self, message):
4040
return self.__printDebug(message, 1)
41-
41+
4242
def debug(self, message):
4343
return self.__printDebug(message, 2)
44-
44+
4545
def dev(self, message):
4646
return self.__printDebug(message, 3)
47-
47+
4848
def debugplus(self, message):
4949
return self.__printDebug(message, 3)
50-
50+
5151
def __printDebug( self, msg, level=1 ):
5252
if self.level >= level :
5353
#msg=self.token_regex.sub("-Token=XXXXXXXXXX&", str(msg))
5454
#msg=self.ip_regex.sub(".X.X.", msg)
5555
print "%s%s -> %s : %s" % (self.main, self.sub, inspect.stack(0)[2][3], msg)
5656
return
57-
57+
5858
def __call__(self, msg, level=1):
5959
return self.__printDebug(msg, level)
6060

@@ -99,7 +99,7 @@ def setup_python_locations():
9999
setup['__resources__'] = xbmc.translatePath(os.path.join(setup['__cwd__'], 'resources', 'lib'))
100100
sys.path.append(setup['__resources__'])
101101
return setup
102-
102+
103103
def is_ip(address):
104104
'''from http://www.seanelavelle.com/2012/04/16/checking-for-a-valid-ip-in-python/'''
105105
try:
@@ -109,7 +109,7 @@ def is_ip(address):
109109
ip = False
110110

111111
return ip
112-
112+
113113
GLOBAL_SETUP=setup_python_locations()
114114
GLOBAL_SETUP['platform']=get_platform()
115115
GENERIC_THUMBNAIL = "%s/resource/thumb.png" % GLOBAL_SETUP['__cwd__']
@@ -153,4 +153,3 @@ def is_ip(address):
153153
SUB_AUDIO_XBMC_CONTROL="0"
154154
SUB_AUDIO_PLEX_CONTROL="1"
155155
SUB_AUDIO_NEVER_SHOW="2"
156-

resources/lib/CacheControl.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@
1515
import cPickle as pickle
1616
except ImportError:
1717
import pickle
18-
18+
1919
from common import *
20-
20+
2121
printDebug=printDebug("PleXBMC", "cachecontrol")
22-
22+
2323
class CacheControl:
2424

2525
def __init__(self, cache_location, enabled=True):
26-
26+
2727
self.cache_location=cache_location
2828
self.enabled=enabled
2929

3030
if self.enabled:
3131

3232
if self.cache_location[-1] != "/":
3333
self.cache_location+="/"
34-
34+
3535
if not xbmcvfs.exists(self.cache_location):
3636
printDebug.debug("CACHE [%s]: Location does not exist. Creating" % self.cache_location)
3737
if not xbmcvfs.mkdirs(self.cache_location):
@@ -40,11 +40,10 @@ def __init__(self, cache_location, enabled=True):
4040
return
4141
printDebug.debug("Running with cache location: %s" % self.cache_location)
4242

43-
4443
else:
4544
self.cache_location=None
4645
printDebug.debug("Cache is disabled")
47-
46+
4847
def readCache(self, cache_name):
4948
if self.cache_location is None:
5049
return (False, None)
@@ -56,7 +55,7 @@ def readCache(self, cache_name):
5655
cache.close()
5756
except Exception, e:
5857
printDebug.debug("CACHE [%s]: read error [%s]" % ( cache_name, e))
59-
58+
6059
if cachedata:
6160
printDebug.debug("CACHE [%s]: read" % cache_name)
6261
printDebug.debugplus("CACHE [%s]: data: [%s]" % ( cache_name, cachedata))
@@ -78,8 +77,7 @@ def writeCache(self,cache_name,object):
7877
cache.close()
7978
except Exception, e:
8079
printDebug.debug("CACHE [%s]: Writing error [%s]" % (self.cache_location+cache_name, e))
81-
82-
80+
8381
return True
8482

8583
def checkCache(self,cache_name, life=3600):
@@ -95,7 +93,7 @@ def checkCache(self,cache_name, life=3600):
9593

9694
if ( modified < 0) or ( now - modified ) > life:
9795
printDebug.debug("CACHE [%s]: too old, delete" % cache_name)
98-
96+
9997
if xbmcvfs.delete(self.cache_location+cache_name):
10098
printDebug.debug("CACHE [%s]: deleted" % cache_name)
10199
else:
@@ -108,7 +106,7 @@ def checkCache(self,cache_name, life=3600):
108106
printDebug.debug("CACHE [%s]: does not exist" % cache_name)
109107

110108
return (False, None)
111-
109+
112110
def deleteCache(self, force=False):
113111
printDebug.debug("== ENTER: deleteCache ==")
114112
cache_suffix = ".cache"
@@ -117,7 +115,7 @@ def deleteCache(self, force=False):
117115

118116
printDebug.debug("List of file: [%s]" % file_list)
119117
printDebug.debug("List of dirs: [%s]" % dirs)
120-
118+
121119
for file in file_list:
122120

123121
if force and persistant_cache_suffix in file:
@@ -129,4 +127,3 @@ def deleteCache(self, force=False):
129127
printDebug.debug("SUCCESSFUL: removed %s" % file)
130128
else:
131129
printDebug.debug("UNSUCESSFUL: did not remove %s" % file )
132-

0 commit comments

Comments
 (0)