Merge pull request #400 from MarkusHackspacher/codestyle2
fix E305 expected 2 blank lines after class or function definition
This commit is contained in:
commit
40778c8373
|
@ -178,6 +178,7 @@ def fixup_home(old_home):
|
|||
|
||||
return old_home
|
||||
|
||||
|
||||
# Default locations for configuration and data files
|
||||
default_home = os.path.expanduser(os.path.join('~', 'gPodder'))
|
||||
default_home = fixup_home(default_home)
|
||||
|
|
|
@ -171,6 +171,7 @@ class FixedOpmlFileProvider(Provider):
|
|||
def on_static(self):
|
||||
return directory_entry_from_opml(self.filename)
|
||||
|
||||
|
||||
PROVIDERS = [
|
||||
GPodderRecommendationsProvider,
|
||||
None,
|
||||
|
|
|
@ -66,9 +66,11 @@ class UnknownStatusCode(ExceptionWithData): pass
|
|||
# Authentication error
|
||||
class AuthenticationRequired(Exception): pass
|
||||
|
||||
|
||||
# Successful status codes
|
||||
UPDATED_FEED, NEW_LOCATION, NOT_MODIFIED, CUSTOM_FEED = list(range(4))
|
||||
|
||||
|
||||
class Result:
|
||||
def __init__(self, status, feed=None):
|
||||
self.status = status
|
||||
|
|
|
@ -45,6 +45,7 @@ class TextExtents(object):
|
|||
tuple = ctx.text_extents(text)
|
||||
(self.x_bearing, self.y_bearing, self.width, self.height, self.x_advance, self.y_advance) = tuple
|
||||
|
||||
|
||||
EPISODE_LIST_ICON_SIZE = 16
|
||||
|
||||
RRECT_LEFT_SIDE = 1
|
||||
|
|
|
@ -28,6 +28,7 @@ class TagCloud(Gtk.Layout):
|
|||
(GObject.TYPE_STRING,))
|
||||
}
|
||||
|
||||
|
||||
def __init__(self, min_size=20, max_size=36):
|
||||
Gtk.Layout.__init__(self)
|
||||
self._min_weight = 0
|
||||
|
@ -101,4 +102,6 @@ class TagCloud(Gtk.Layout):
|
|||
return False
|
||||
GObject.idle_add(unrelayout)
|
||||
|
||||
|
||||
GObject.type_register(TagCloud)
|
||||
|
||||
|
|
|
@ -187,6 +187,7 @@ class Store(object):
|
|||
else:
|
||||
return None
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
class Person(object):
|
||||
__slots__ = {'username': str, 'id': int}
|
||||
|
|
|
@ -81,6 +81,7 @@ class gPodderFetcher(feedcore.Fetcher):
|
|||
def register(cls, handler):
|
||||
cls.custom_handlers.append(handler)
|
||||
|
||||
|
||||
# The "register" method is exposed here for external usage
|
||||
register_custom_handler = gPodderFetcher.register
|
||||
|
||||
|
|
|
@ -242,6 +242,7 @@ class SoundcloudFavFeed(SoundcloudFeed):
|
|||
def get_new_episodes(self, channel, existing_guids):
|
||||
return self._get_new_episodes(channel, existing_guids, 'favorites')
|
||||
|
||||
|
||||
# Register our URL handlers
|
||||
model.register_custom_handler(SoundcloudFeed)
|
||||
model.register_custom_handler(SoundcloudFavFeed)
|
||||
|
@ -249,3 +250,4 @@ model.register_custom_handler(SoundcloudFavFeed)
|
|||
def search_for_user(query):
|
||||
json_url = 'https://api.soundcloud.com/users.json?q=%s&consumer_key=%s' % (urllib.parse.quote(query), CONSUMER_KEY)
|
||||
return json.loads(util.urlopen(json_url).read().decode('utf-8'))
|
||||
|
||||
|
|
|
@ -127,6 +127,7 @@ def _sanitize_char(c):
|
|||
|
||||
return c.encode('utf-8')
|
||||
|
||||
|
||||
SANITIZATION_TABLE = b''.join(map(_sanitize_char, list(map(chr, list(range(256))))))
|
||||
del _sanitize_char
|
||||
|
||||
|
|
|
@ -11,4 +11,6 @@ class SessionBus(object):
|
|||
def name_has_owner(self, *args, **kwargs):
|
||||
return False
|
||||
|
||||
|
||||
SystemBus = SessionBus
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ class Language(object):
|
|||
def __cmp__(self, other):
|
||||
return cmp(self.get_translated_ratio(), other.get_translated_ratio())
|
||||
|
||||
|
||||
languages = []
|
||||
|
||||
COUNTS_RE = '((\d+) translated message[s]?)?(, (\d+) fuzzy translation[s]?)?(, (\d+) untranslated message[s]?)?\.'
|
||||
|
|
|
@ -34,6 +34,7 @@ def get_tarball_url(modulename):
|
|||
match = re.search(r'(http[s]?://[^>]*%s-([0-9.]*)(?:\.post\d+)?\.tar\.gz)' % modulename, html)
|
||||
return match.group(0) if match is not None else None
|
||||
|
||||
|
||||
for module, required_files in MODULES:
|
||||
print('Fetching', module, '...', end=' ')
|
||||
tarball_url = get_tarball_url(module)
|
||||
|
|
|
@ -16,6 +16,7 @@ def gen(percentage):
|
|||
pixbuf = draw_cake_pixbuf(percentage)
|
||||
return Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
|
||||
|
||||
w = Gtk.Window()
|
||||
w.connect('destroy', Gtk.main_quit)
|
||||
v = Gtk.VBox()
|
||||
|
|
Loading…
Reference in a new issue