Skip to content

Commit

Permalink
Reformating and building locales
Browse files Browse the repository at this point in the history
  • Loading branch information
luzip665 committed Feb 14, 2023
1 parent 7fce86c commit ec9f749
Show file tree
Hide file tree
Showing 152 changed files with 27,732 additions and 23,413 deletions.
2 changes: 0 additions & 2 deletions exaile_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def __open_inheritance_hack(*args, **kwargs):


def error(message1, message2=None, die=True):

import logging

"""Show error message and exit.
Expand All @@ -49,7 +48,6 @@ def error(message1, message2=None, die=True):


def main():

import logging

logging.basicConfig(
Expand Down
1 change: 0 additions & 1 deletion plugins/audioscrobbler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ def initialize(self, username, password, server):
logger.info("Attempting to connect to AudioScrobbler (%s)", server)
scrobbler.login(username, password, hashpw=False, post_url=server)
except Exception:

try:
scrobbler.login(username, password, hashpw=True, post_url=server)
except Exception:
Expand Down
2 changes: 1 addition & 1 deletion plugins/bookmarks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def __load_db_callback(self, loaded_bookmarks):
if not self.menu:
return # this plugin is shutting down

for (key, pos) in loaded_bookmarks:
for key, pos in loaded_bookmarks:
self.__add_bookmark(key, pos, save_db=False)

def __save_db(self):
Expand Down
3 changes: 0 additions & 3 deletions plugins/bpm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ def _set_bpm(self, result, bpm, track):

@GtkTemplate('msg.ui', relto=__file__)
class BPMAutodetectResponse(Gtk.Dialog):

__gtype_name__ = 'BPMAutodetectResponse'

q_label, r1, r2, r3 = GtkTemplate.Child.widgets(4)
Expand All @@ -175,7 +174,6 @@ def get_bpm(self):

@GtkTemplate('bpm.ui', relto=__file__)
class BPMWidget(Gtk.Frame):

__gtype_name__ = 'BPMWidget'

eventbox, bpm_label, apply_button = GtkTemplate.Child.widgets(3)
Expand Down Expand Up @@ -251,7 +249,6 @@ def on_apply_button_clicked(self, widget):

@GtkTemplate.Callback
def on_eventbox_key_press_event(self, widget, event):

if event.keyval == Gdk.KEY_Return:
self.set_bpm()
return False
Expand Down
3 changes: 0 additions & 3 deletions plugins/bpm/bpmdetect.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def detect_bpm(uri, on_complete):
bpm = [None]

def _on_message(bus, msg):

if msg.type == Gst.MessageType.TAG:
tags = msg.parse_tag()

Expand All @@ -52,7 +51,6 @@ def _on_message(bus, msg):
bpm[0] = v

elif msg.type == Gst.MessageType.ERROR:

playbin.set_state(Gst.State.NULL)

gerror, debug_info = msg.parse_error()
Expand Down Expand Up @@ -103,7 +101,6 @@ def _on_message(bus, msg):


if __name__ == '__main__':

Gst.init(None)

if len(sys.argv) != 2:
Expand Down
4 changes: 2 additions & 2 deletions plugins/cd/musicbrainzngs_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def __choose_release_and_medium(suitable_releases):
chosen_prio = -10 # this is a threshold
chosen_release = None
chosen_release_media = None
for (prio, release_media, release) in suitable_releases:
for prio, release_media, release in suitable_releases:
if prio > chosen_prio:
chosen_prio = prio
chosen_release_media = release_media
Expand All @@ -185,7 +185,7 @@ def __choose_release_and_medium(suitable_releases):
# find the most suitable medium
chosen_prio = -50 # this is a threshold
chosen_medium = None
for (prio, medium) in chosen_release_media:
for prio, medium in chosen_release_media:
if prio > chosen_prio:
chosen_prio = prio
chosen_medium = medium
Expand Down
3 changes: 1 addition & 2 deletions plugins/daapclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def load(self):
except (IOError, EOFError):
# no file
pass
except (IOError):
except IOError:
# file not present
pass

Expand Down Expand Up @@ -720,7 +720,6 @@ def save_items(self, items, folder):


class DaapClientPlugin:

__exaile = None
__manager = None

Expand Down
1 change: 0 additions & 1 deletion plugins/daapclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ def tracks(self):


class DAAPTrack:

attrmap = {
'name': 'minm',
'artist': 'asar',
Expand Down
2 changes: 0 additions & 2 deletions plugins/developer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def teardown(self, exaile):
providers.unregister('menubar-tools-menu', self.menu)

def on_gui_loaded(self):

# add a thing to the view menu
self.menu = menu.simple_menu_item(
'developer', '', _('Developer Tools'), callback=self.on_view_menu
Expand Down Expand Up @@ -112,7 +111,6 @@ def get_event_data(self, last_count):

@GtkTemplate('developer_window.ui', relto=__file__)
class DeveloperWindow(Gtk.Window):

__gtype_name__ = 'DeveloperWindow'

(
Expand Down
1 change: 0 additions & 1 deletion plugins/dist_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@


for dir in args:

if not os.path.exists(dir):
print("No such folder %s" % dir)
break
Expand Down
1 change: 0 additions & 1 deletion plugins/equalizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ def adjust_preamp(self, widget):

@GtkTemplate.Callback
def add_preset(self, _widget):

new_preset = []
new_preset.append(self.combo_presets.get_child().get_text())
new_preset.append(settings.get_option("plugin/equalizer/pre"))
Expand Down
2 changes: 0 additions & 2 deletions plugins/grouptagger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def enable(self, exaile):
self.exaile = exaile

def on_gui_loaded(self):

self.track = None
self.tag_dialog = None

Expand Down Expand Up @@ -242,7 +241,6 @@ def on_export_tags(self, widget, name, parent, exaile):
gt_export.export_tags(exaile)

def on_get_tags_menu(self, widget, name, parent, exaile):

if self.tag_dialog is None:
self.tag_dialog = gt_widgets.AllTagsDialog(
exaile, self.panel.tagger.add_groups
Expand Down
2 changes: 0 additions & 2 deletions plugins/grouptagger/gt_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def migrate_settings():
'''Automatically migrate group tagger 0.1 settings to 0.2'''

if settings.get_option(migrated_option, False):

default_groups = settings.get_option('plugin/grouptagger/default_groups', None)
if default_groups is not None:
group_categories = {_('Uncategorized'): [True, default_groups]}
Expand Down Expand Up @@ -117,7 +116,6 @@ def get_group_categories():


def get_groups_from_categories():

groups = set()
categories = get_group_categories()
for category, (expanded, cgroups) in categories.items():
Expand Down
1 change: 0 additions & 1 deletion plugins/grouptagger/gt_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def export_tags(exaile):
)

if uri is not None:

# collect the data
trackdata = {}
for strack in search.search_tracks_from_string(exaile.collection, ''):
Expand Down
6 changes: 0 additions & 6 deletions plugins/grouptagger/gt_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ def _on_import_done(self, thread):

@idle_add()
def _on_update_done(self, thread):

if self.update_thread is None:
return

Expand All @@ -150,7 +149,6 @@ def _on_update_done(self, thread):

@GtkTemplate.Callback
def on_cancel_button_clicked(self, widget):

if self.rescan_thread is not None:
self.rescan_thread.stop()
elif self.import_thread is not None:
Expand All @@ -166,7 +164,6 @@ def on_import_checkbox_toggled(self, cell, path):

@GtkTemplate.Callback
def on_ok_button_clicked(self, widget):

self.ok_button.set_sensitive(False)
self.tags_vbox.set_sensitive(False)

Expand Down Expand Up @@ -204,7 +201,6 @@ def track_import_thread(import_collection, user_collection, track_data):
# determine which tracks in this collection match existing
# tracks in the exaile collection. grab the groups from them
for i, track in enumerate(import_collection):

# search for a matching track
# -> currently exaile doesn't index tracks, and linear searches
# for the track instead. Oh well.
Expand All @@ -214,7 +210,6 @@ def track_import_thread(import_collection, user_collection, track_data):

# if there are matches, add the data to the track data
for matched_track in matched_tracks:

# ignore exact duplicates
if track is matched_track:
exact_dups += 1
Expand Down Expand Up @@ -247,7 +242,6 @@ def track_update_thread(trackdata, replace):
total = len(trackdata)

for i, (curtrack, newgroups) in enumerate(trackdata):

if replace:
set_track_groups(curtrack, newgroups)
else:
Expand Down
6 changes: 0 additions & 6 deletions plugins/grouptagger/gt_mass.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

@GtkTemplate('gt_mass.ui', relto=__file__)
class GtMassRename(Gtk.Window):

__gtype_name__ = 'GTMassRename'

(
Expand Down Expand Up @@ -73,7 +72,6 @@ def reset(self):

@GtkTemplate.Callback
def on_find_clicked(self, widget):

self.search_str = self.search_entry.get_text().strip()
self.tagname = gt_common.get_tagname()

Expand All @@ -86,7 +84,6 @@ def on_find_clicked(self, widget):

idx = self.playlists.get_active()
if idx != -1 and self.search_str != '':

smart, name = self.playlists.get_model()[idx]
if smart:
pl = self.exaile.smart_playlists.get_playlist(name)
Expand All @@ -97,7 +94,6 @@ def on_find_clicked(self, widget):
pl = pl.get_playlist(self.exaile.collection)

for track in pl:

groups = gt_common._get_track_groups(track, self.tagname)

if self.search_str != '' and self.search_str not in groups:
Expand Down Expand Up @@ -126,7 +122,6 @@ def on_find_clicked(self, widget):

@GtkTemplate.Callback
def on_replace_clicked(self, widget):

tracks = [row[2] for row in self.tracks_list.get_model() if row[1]]
replace_str = self.replace_entry.get_text().strip()

Expand All @@ -151,7 +146,6 @@ def on_replace_clicked(self, widget):
return

for track in tracks:

groups = gt_common._get_track_groups(track, self.tagname)

if self.search_str != '':
Expand Down
12 changes: 0 additions & 12 deletions plugins/grouptagger/gt_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def __init__(self, name, after):
menu.MenuItem.__init__(self, name, None, after)

def factory(self, menu, parent, context):

groups = context['groups']

if len(groups) == 0:
Expand Down Expand Up @@ -120,7 +119,6 @@ class GroupTaggerView(Gtk.TreeView):
}

def __init__(self, exaile, model=None, editable=False):

super(GroupTaggerView, self).__init__()

self.exaile = exaile
Expand Down Expand Up @@ -167,7 +165,6 @@ def __init__(self, exaile, model=None, editable=False):
self.connect('button-press-event', self.on_button_press)

if editable:

item = smi('addgrp', [], _('Add new tag'), callback=self.on_menu_add_group)
self.menu.add_item(item)

Expand Down Expand Up @@ -350,7 +347,6 @@ def on_menu_add_category(self, widget, name, parent, context):
self.emit('category-changed', category_change.added, category)

def on_menu_del_category(self, widget, name, parent, context):

model, paths = context['selected-rows']
categories = model.delete_selected_categories(paths)

Expand Down Expand Up @@ -440,7 +436,6 @@ def change_name(self, path, name):
return old

def delete_selected_categories(self, paths):

categories = {}
iters = [self.get_iter(path) for path in paths if self[path].parent is None]

Expand Down Expand Up @@ -615,7 +610,6 @@ def set_track_info(self, track):
self.set_artist(track.get_tag_display('artist'))

def add_groups(self, groups):

added = False

self.view.freeze_child_notify()
Expand Down Expand Up @@ -676,7 +670,6 @@ class GroupTaggerPanel(notebook.NotebookPage):
menu_provider_name = 'panel-tab-context'

def __init__(self, exaile):

notebook.NotebookPage.__init__(self)

# add the tagger widget
Expand Down Expand Up @@ -744,7 +737,6 @@ def get_active_groups(self):

class AllTagsDialog(Gtk.Window):
def __init__(self, exaile, callback):

Gtk.Window.__init__(self)
self.set_title(_('Get all tags from collection'))
self.set_resizable(True)
Expand Down Expand Up @@ -792,7 +784,6 @@ class GroupTaggerQueryDialog(Gtk.Dialog):
"""

def __init__(self, groups):

Gtk.Dialog.__init__(self, title=_('Show tracks with groups'))

# setup combo box selections
Expand Down Expand Up @@ -825,7 +816,6 @@ def __init__(self, groups):
# TODO: Add/remove groups to/from table

for i, group in enumerate(sorted(groups)):

# label
gcombo = self._init_combo(self.group_model)
gcombo.set_active(self._get_group_index(group))
Expand Down Expand Up @@ -871,7 +861,6 @@ def get_search_params(self):

# gather the data
for gcombo, combo in self.combos:

active_group = self.group_model[gcombo.get_active()][0]
wsel = self.combo_model[combo.get_active()][0]

Expand Down Expand Up @@ -938,7 +927,6 @@ def get_search_params(self):

class GroupTaggerAddRemoveDialog(Gtk.Dialog):
def __init__(self, add, tracks, exaile):

self.add = add
self.tracks = tracks

Expand Down

0 comments on commit ec9f749

Please sign in to comment.