<commit_before>import elementary
import evas
import urllib
import time
import os
import shutil

class playerWindow(elementary.Table):
    def __init__( self, parent ):
        #Builds an elementary tabel that displays our information
        elementary.Table.__init__(self, parent.mainWindow)

        #Store our parent window
        self.rent = parent

        #Access the player function we need to talk to
        self.ourPlayer = parent.ourPlayer
        self.ourPlayer.setGUI(self)

        #These are widgets that appear at the player page of our window
        self.songList = elementary.List(parent.mainWindow)
        self.stationButton = elementary.Button(parent.mainWindow)
        self.thumb = elementary.Button(parent.mainWindow)
        self.song = elementary.Button(parent.mainWindow)
        self.artist = elementary.Label(parent.mainWindow)
        self.album = elementary.Button(parent.mainWindow)
        self.rating = elementary.Button(parent.mainWindow)
        self.menubutton = elementary.Toolbar(parent.mainWindow)
        self.mainmenu = elementary.Menu(parent.mainWindow)
        self.counter = [elementary.Clock(parent.mainWindow), elementary.Label(parent.mainWindow), elementary.Label(parent.mainWindow)]
        self.pauseTime = None

        #Build the page layout
        home = os.path.expanduser("~")
        if os.path.exists("%s/.config/eAndora/stationinfo"%home):
            f = open('%s/.config/eAndora/stationinfo'%home, 'r')
            lines = f.readlines()
            self.ourPlayer.setStation(self.ourPlayer.getStationFromName(lines[0].rstrip("\n")))
        else:
            self.ourPlayer.setStation(self.ourPlayer.getStations()[0])

        self.stationButton.tooltip_text_set("Change Stations")
        self.stationButton.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.stationButton.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.stationButton.callback_unpressed_add(self.station_selection)
        self.pack(self.stationButton, 4, 0, 2, 3)

        self.songList.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.songList.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.pack(self.songList, 0, 4, 4, 3)

        #Our main menu
        self.menubutton.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.menubutton.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        item = self.menubutton.item_append("images/eAndora.png", "Menu", None, None)
        item.menu_set(True)
        self.menubutton.menu_parent_set(parent.mainWindow)
        menu = item.menu_get()
        menu.item_add(None, "Logout", "refresh", self.logout)
        self.pack(self.menubutton, 5, 3, 1, 1)
        self.menubutton.show()

        ic = elementary.Icon(parent.mainWindow)
        ic.file_set("images/skip.png")
        bt = elementary.Button(parent.mainWindow)
        bt.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        bt.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        bt.content_set(ic)
        bt.callback_unpressed_add(self.skip_track)
        self.pack(bt, 4, 4, 1, 1)
        bt.show()

        ic = elementary.Icon(parent.mainWindow)
        ic.file_set("images/pause.png")
        bt = elementary.Button(parent.mainWindow)
        bt.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        bt.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        bt.content_set(ic)
        bt.callback_unpressed_add(self.play_pause)
        self.pack(bt, 4, 5, 1, 1)
        bt.show()

        ic = elementary.Icon(parent.mainWindow)
        ic.file_set("images/ban.png")
        bt = elementary.Button(parent.mainWindow)
        bt.tooltip_text_set("Ban Song")
        bt.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        bt.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        bt.content_set(ic)
        bt.callback_unpressed_add(self.ban_track)
        self.pack(bt, 5, 5, 1, 1)
        bt.show()

        #Define callbacks for all our buttons that will be updated
        #Button content is generated on song change

        self.thumb.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.thumb.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.pack(self.thumb, 2, 0, 2, 3)

        self.song.callback_pressed_add(self.show_song)
        self.song.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.song.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.pack(self.song, 0, 0, 2, 1)

        self.album.callback_pressed_add(self.show_album)
        self.album.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.album.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.pack(self.album, 0, 1, 2, 1)

        self.rating.callback_unpressed_add(self.love_track)
        self.artist.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.artist.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.pack(self.artist, 0, 2, 2, 1)

        self.counter[0].size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.counter[0].size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.counter[0].show_seconds_set(True)
        self.pack(self.counter[0], 0, 3, 1, 1)

        self.counter[1].size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.counter[1].size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.pack(self.counter[1], 2, 3, 1, 1)

        self.rating.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.rating.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.pack(self.rating, 5, 4, 1, 1)

        self.ourPlayer.addSongs()

    def ban_track( self, bt ):
        #Tell pandora we don't want this song played anymore, then skip to the next track
        self.ourPlayer.banSong()
        self.ourPlayer.skipSong()

    def love_track( self, bt ):
        #Tell pandora we love this song, then update the GUI so it reflects this change
        self.ourPlayer.loveSong()
        ic = elementary.Icon(parent.mainWindow)
        ic.file_set('images/love.png')
        self.rating.hide()<commit_msg>Fixed a typo from moving files around<commit_after>import elementary
import evas
import urllib
import time
import os
import shutil

class playerWindow(elementary.Table):
    def __init__( self, parent ):
        #Builds an elementary tabel that displays our information
        elementary.Table.__init__(self, parent.mainWindow)

        #Store our parent window
        self.rent = parent

        #Access the player function we need to talk to
        self.ourPlayer = parent.ourPlayer
        self.ourPlayer.setGUI(self)

        #These are widgets that appear at the player page of our window
        self.songList = elementary.List(parent.mainWindow)
        self.stationButton = elementary.Button(parent.mainWindow)
        self.thumb = elementary.Button(parent.mainWindow)
        self.song = elementary.Button(parent.mainWindow)
        self.artist = elementary.Label(parent.mainWindow)
        self.album = elementary.Button(parent.mainWindow)
        self.rating = elementary.Button(parent.mainWindow)
        self.menubutton = elementary.Toolbar(parent.mainWindow)
        self.mainmenu = elementary.Menu(parent.mainWindow)
        self.counter = [elementary.Clock(parent.mainWindow), elementary.Label(parent.mainWindow), elementary.Label(parent.mainWindow)]
        self.pauseTime = None

        #Build the page layout
        home = os.path.expanduser("~")
        if os.path.exists("%s/.config/eAndora/stationinfo"%home):
            f = open('%s/.config/eAndora/stationinfo'%home, 'r')
            lines = f.readlines()
            self.ourPlayer.setStation(self.ourPlayer.getStationFromName(lines[0].rstrip("\n")))
        else:
            self.ourPlayer.setStation(self.ourPlayer.getStations()[0])

        self.stationButton.tooltip_text_set("Change Stations")
        self.stationButton.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.stationButton.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.stationButton.callback_unpressed_add(self.station_selection)
        self.pack(self.stationButton, 4, 0, 2, 3)

        self.songList.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.songList.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.pack(self.songList, 0, 4, 4, 3)

        #Our main menu
        self.menubutton.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.menubutton.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        item = self.menubutton.item_append("images/eAndora.png", "Menu", None, None)
        item.menu_set(True)
        self.menubutton.menu_parent_set(parent.mainWindow)
        menu = item.menu_get()
        menu.item_add(None, "Logout", "refresh", self.logout)
        self.pack(self.menubutton, 5, 3, 1, 1)
        self.menubutton.show()

        ic = elementary.Icon(parent.mainWindow)
        ic.file_set("images/skip.png")
        bt = elementary.Button(parent.mainWindow)
        bt.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        bt.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        bt.content_set(ic)
        bt.callback_unpressed_add(self.skip_track)
        self.pack(bt, 4, 4, 1, 1)
        bt.show()

        ic = elementary.Icon(parent.mainWindow)
        ic.file_set("images/pause.png")
        bt = elementary.Button(parent.mainWindow)
        bt.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        bt.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        bt.content_set(ic)
        bt.callback_unpressed_add(self.play_pause)
        self.pack(bt, 4, 5, 1, 1)
        bt.show()

        ic = elementary.Icon(parent.mainWindow)
        ic.file_set("images/ban.png")
        bt = elementary.Button(parent.mainWindow)
        bt.tooltip_text_set("Ban Song")
        bt.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        bt.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        bt.content_set(ic)
        bt.callback_unpressed_add(self.ban_track)
        self.pack(bt, 5, 5, 1, 1)
        bt.show()

        #Define callbacks for all our buttons that will be updated
        #Button content is generated on song change

        self.thumb.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.thumb.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.pack(self.thumb, 2, 0, 2, 3)

        self.song.callback_pressed_add(self.show_song)
        self.song.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.song.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.pack(self.song, 0, 0, 2, 1)

        self.album.callback_pressed_add(self.show_album)
        self.album.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.album.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.pack(self.album, 0, 1, 2, 1)

        self.rating.callback_unpressed_add(self.love_track)
        self.artist.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.artist.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.pack(self.artist, 0, 2, 2, 1)

        self.counter[0].size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.counter[0].size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.counter[0].show_seconds_set(True)
        self.pack(self.counter[0], 0, 3, 1, 1)

        self.counter[1].size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.counter[1].size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.pack(self.counter[1], 2, 3, 1, 1)

        self.rating.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        self.rating.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
        self.pack(self.rating, 5, 4, 1, 1)

        self.ourPlayer.addSongs()

    def ban_track( self, bt ):
        #Tell pandora we don't want this song played anymore, then skip to the next track
        self.ourPlayer.banSong()
        self.ourPlayer.skipSong()

    def love_track( self, bt ):
        #Tell pandora we love this song, then update the GUI so it reflects this change
        self.ourPlayer.loveSong()
        ic = elementary.Icon(self.rent.mainWindow)
        ic.file_set('images/love.png')
        self.rating.hide()
{'fraction_non_alphanumeric': 0.10316049764314968, 'fraction_numerical': 0.009427401282744765, 'mean_word_length': 3.182934712346477, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4975395', 'n_tokens_mistral': 4784, 'n_tokens_neox': 4607, 'n_words': 661}