code
stringlengths
1
1.72M
language
stringclasses
1 value
''' Created on 7 2010 @author: ivan ''' from __future__ import with_statement from foobnix.model.entity import CommonBean import os from foobnix.util.time_utils import normilize_time from foobnix.util import LOG, file_utils import chardet ''' Created on 4 @author: ivan ''' TITLE = "TITLE" PERFORMER = "PERFORMER" F...
Python
''' Created on Mar 16, 2010 @author: ivan ''' from foobnix.util import LOG ''' Created on Mar 11, 2010 @author: ivan ''' import gtk from foobnix.model.entity import CommonBean class RadioListModel: POS_ICON = 0 POS_TRACK_NUMBER = 1 POS_NAME = 2 POS_PATH = 3 POS_COLOR = 4 POS_INDEX = 5 ...
Python
''' Created on 15 2010 @author: ivan ''' from __future__ import with_statement import os from foobnix.util import LOG FOOBNIX_DIR = (os.getenv("HOME") or os.getenv('USERPROFILE')) + "/.foobnix" FOOBNIX_DIR_RADIO = "/opt/foobnix/radio" EXTENSION = ".fpl" class FPL(): def __init__(self, name, urls_dict): ...
Python
''' Created on Jul 16, 2010 @author: ivan ''' import urllib2 site = "http://www.screamer-radio.com/" site_full = site + "directory/browsegenre/51/" def load_urls_name_page(): connect = urllib2.urlopen(site_full) data = connect.read() file = open("SKY.FM.fpl", "w") for line in data.split("\n"): ...
Python
# -*- coding: utf-8 -*- ''' Created on Jul 16, 2010 @author: ivan ''' import urllib2 import re site = "http://guzei.com/online_radio/?search=france" def load_urls_name_page(): file = open("GUZEI.COM.fpl", "w") for j in xrange(33): j = j + 1; site ="http://guzei.com/online_rad...
Python
''' Created on Jul 16, 2010 @author: ivan '''
Python
''' Created on 16 2010 @author: ivan ''' import urllib2 site = "http://di.fm" def load_urls_name_page(): connect = urllib2.urlopen(site) data = connect.read() result = {} file = open("DI_FM.fpl", "w") for line in data.split("\n"): pre = '<td><a href="http://listen.di.fm/public3/' ...
Python
''' Created on 16 2010 @author: ivan ''' import urllib2 site = "http://myradio.ua/" def load_urls_name_page(): connect = urllib2.urlopen(site) data = connect.read() result = {} file = open("MYRADIO_UA.fpl", "w") for line in data.split("\n"): line = line.decode("cp1251") pre =...
Python
''' Created on Mar 16, 2010 @author: ivan ''' from foobnix.radio.radio_model import RadioListModel from foobnix.util.plsparser import getStationPath, getPlsName, get_content from foobnix.model.entity import CommonBean from foobnix.util.mouse_utils import is_double_click import urllib2 from foobnix.util import LOG ...
Python
''' Created on Mar 14, 2010 @author: ivan ''' from foobnix.base import BaseController class PrefController(BaseController): def __init__(self, gx_preferences_window): self.pref = gx_preferences_window.get_widget("window") self.pref.connect("delete-event", self.hide) def show(self, sender): ...
Python
''' Created on 01.06.2010 @author: ivan ''' from foobnix.online.google.search import GoogleSearch import time from foobnix.util import LOG def googleHelp(query): LOG.info("Not Found, wait for results from google ...") results = [] ask = query.encode('utf-8') LOG.info(ask) gs = GoogleSearch(ask, Tr...
Python
''' Created on Jun 10, 2010 @author: ivan ''' from foobnix.util.configuration import FConfiguration from foobnix.util import LOG import os import urllib import thread from foobnix.online.song_resource import update_song_path from mutagen.id3 import ID3NoHeaderError, ID3, TIT2, COMM, TPE1, TENC, TDRC, \ TALB def d...
Python
# -*- coding: utf-8 -*- #TODO: This file is under heavy refactoring, don't touch anything you think is wrong ''' Created on Mar 16, 2010 @author: ivan ''' import os import gtk from gobject import GObject #@UnresolvedImport from foobnix.directory.directory_controller import DirectoryCntr from foobnix.model.entity imp...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-sponsored-links-search/ # # Code is licensed under MIT license. # import re import urllib import random from htmlentitydefs imp...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-search/ # # Code is licensed under MIT license. # import re import urllib from htmlentitydefs import name2codepoint from BeautifulSoup impor...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-sponsored-links-search/ # # Code is licensed under MIT license. # import re import urllib import random from htmlentitydefs imp...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-search/ # # Code is licensed under MIT license. # import re import urllib from htmlentitydefs import name2codepoint from BeautifulSoup impor...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-search/ # # Code is licensed under MIT license. # import random import socket import urllib import urllib2 import httplib B...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-sets/ # # Code is licensed under MIT license. # import re import urllib import random from htmlentitydefs import name2codepoint...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # A Google Python library: # http://www.catonmat.net/blog/python-library-for-google-search/ # # Distributed under MIT license: # # Copyright (c) 2009 Peteris Krumins # # Permission is hereby granted...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-search/ # # Code is licensed under MIT license. # import random import socket import urllib import urllib2 import httplib B...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # A Google Python library: # http://www.catonmat.net/blog/python-library-for-google-search/ # # Distributed under MIT license: # # Copyright (c) 2009 Peteris Krumins # # Permission is hereby granted...
Python
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup parses a (possibly invalid) XML or HTML document into a tree representation. It provides methods and Pythonic idioms that make it easy to navigate, search, and modify the tree. A well-formed X...
Python
import re import sys import urllib import simplejson baseUrl = "http://ajax.googleapis.com/ajax/services/language/translate" def getSplits(text,splitLength=4500): ''' Translate Api has a limit on length of text(4500 characters) that can be translated at once, ''' return (text[index:index+s...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-sets/ # # Code is licensed under MIT license. # import re import urllib import random from htmlentitydefs import name2codepoint...
Python
# -*- coding: utf-8 -*- ''' Created on Mar 17, 2010 @author: ivan ''' import urllib2 import urllib import re import time from string import replace from foobnix.util import LOG from foobnix.util.configuration import FConfiguration from foobnix.model.entity import CommonBean from xml.sax.saxutils import unescape fro...
Python
''' Created on 24 Apr 2010 @author: Matik ''' from foobnix.model.entity import CommonBean from foobnix.thirdparty import pylast from foobnix.thirdparty.pylast import WSError from foobnix.util import LOG from foobnix.util.configuration import FConfiguration from foobnix.online.google.translate import transl...
Python
''' Created on 20.04.2010 @author: ivan ''' from foobnix.model.entity import CommonBean import os from foobnix.util import LOG from foobnix.online.vk import Vkontakte from foobnix.util.configuration import FConfiguration try: vk = Vkontakte(FConfiguration().vk_login, FConfiguration().vk_password) except: vk ...
Python
''' Created on 18.04.2010 @author: ivan ''' from foobnix.util import LOG from foobnix.thirdparty import pylast import urllib import gtk import thread from foobnix.model.entity import CommonBean from foobnix.base.base_list_controller import BaseListController from foobnix.util.configuration import FConfiguration from f...
Python
''' Created on Jun 10, 2010 @author: ivan ''' from foobnix.online.google.search import GoogleSearch from foobnix.util import LOG """Get search result titles from google""" def google_search_resutls(query, results_count=10): results = [] try: LOG.debug("Start google search", query) ask = query.e...
Python
''' Created on Mar 16, 2010 @author: ivan ''' from random import randint from foobnix.util import LOG ''' Created on Mar 11, 2010 @author: ivan ''' import gtk from foobnix.model.entity import CommonBean class OnlineListModel: POS_ICON = 0 POS_TRACK_NUMBER = 1 POS_NAME = 2 POS_PATH = 3 POS_COLOR = ...
Python
''' Created on 25 Apr 2010 @author: Matik ''' from __future__ import with_statement import gtk from gobject import TYPE_NONE, TYPE_PYOBJECT, TYPE_STRING #@UnresolvedImport from foobnix.util import LOG import foobnix.online.integration.lastfm as lastfm from foobnix.base import BaseController, SIGNAL_RUN_FIR...
Python
# -*- coding: utf-8 -*- ''' Created on Mar 18, 2010 @author: ivan ''' import urllib2 import re from string import replace def _engine_search(value): value = replace(value, " ", "+") host = "http://en.vpleer.ru/?q=" + value LOG.info(host) data = urllib2.urlopen(host) return data.read() def get_s...
Python
# -*- coding: utf-8 -*- # lyricwiki.py # # Copyright 2009 Amr Hassan <amr.hassan@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either v...
Python
# -*- coding: utf-8 -*- ''' Created on Mar 30, 2010 @author: ivan ''' import gtk from foobnix.util import LOG class PrefListModel(): POS_NAME = 0 def __init__(self, widget, prefListMap): self.widget = widget self.prefListMap = prefListMap self.current_list_model = gtk.ListStore(str) ...
Python
''' Created on Mar 11, 2010 @author: ivan ''' from foobnix.model.entity import CommonBean from foobnix.util import LOG class VirturalLIstCntr(): def __init__(self): self.items = [] def get_items(self): return self.items def get_item_by_index(self, index): ...
Python
''' Created on Mar 11, 2010 @author: ivan ''' import gtk import gobject from foobnix.model.entity import CommonBean from foobnix.util import LOG class DirectoryModel(): POS_NAME = 0 POS_PATH = 1 POS_FONT = 2 POS_VISIBLE = 3 POS_TYPE = 4 POS_INDEX = 5 POS_PARENT = 6 POS_FILTER_CHILD_COU...
Python
# -*- coding: utf-8 -*- ''' Created on Mar 11, 2010 @author: ivan ''' import os from foobnix.util import LOG from foobnix.directory.directory_model import DirectoryModel from foobnix.model.entity import CommonBean from foobnix.util.configuration import FConfiguration from foobnix.util.file_utils import isDirectory...
Python
''' Created on Feb 26, 2010 @author: ivan ''' from mutagen.easyid3 import EasyID3 from mutagen.mp3 import MP3, HeaderNotFoundError from mutagen import File import os import gtk from foobnix.util.configuration import FConfiguration class CommonBean(): TYPE_FOLDER = "TYPE_FOLDER" TYPE_LABEL = "TYPE_LABEL" ...
Python
import gtk def is_double_click(event): if event.button == 1 and event.type == gtk.gdk._2BUTTON_PRESS: #@UndefinedVariable return True else: return False def is_double_left_click(event): if event.button == 1 and event.type == gtk.gdk._2BUTTON_PRESS: #@UndefinedVariable return True ...
Python
''' Created on Feb 26, 2010 @author: ivan ''' import sys import platform import logging def init(): LOG_FILENAME = '/tmp/foobnix.log' LEVELS = {'debug': logging.DEBUG, 'info': logging.INFO, 'warning': logging.WARNING, 'error': logging.ERROR, 'critical': logging.CRITIC...
Python
''' Created on Jul 27, 2010 @author: ivan ''' import os import ConfigParser from foobnix.util import LOG from foobnix.util.singleton import Singleton class Config: __metaclass__ = Singleton FOOBNIX = "foobnix" SUPPORTED_AUDIO_FORMATS = 'supported_audio_formats' USER_DIR = os.getenv("HOME...
Python
''' Created on Feb 26, 2010 @author: ivan ''' import os def isDirectory(path): return os.path.isdir(path) def get_file_extenstion(fileName): return os.path.splitext(fileName)[1].lower()
Python
''' Created on Feb 26, 2010 @author: ivan ''' def convert_ns(time_int): time_int = time_int / 1000000000 time_str = "" if time_int >= 3600: _hours = time_int / 3600 time_int = time_int - (_hours * 3600) time_str = str(_hours) + ":" if time_int >= 600: _mins = time_in...
Python
''' Created on Jul 27, 2010 @author: ivan ''' class Singleton(type): def __call__(self, *args, **kw): if self.instance is None: self.instance = super(Singleton, self).__call__(*args, **kw) return self.instance def __init__(self, name, bases, dict): super(Singleton, self...
Python
''' Created on Mar 3, 2010 @author: ivan ''' import urllib2 from foobnix.util import LOG "Get content of the url" def get_content(url): if not url: return None try: connect = urllib2.urlopen(url) data = connect.read() return data except: LOG.error("INCORREC...
Python
# -*- coding: utf-8 -*- ''' Created on Feb 27, 2010 @author: ivan ''' from __future__ import with_statement import pickle import os import tempfile import ConfigParser from foobnix.util.singleton import Singleton from foobnix.util import LOG FOOBNIX_TMP = "/opt/foobnix" FOOBNIX_TMP_RADIO = os.path.join(FOOBNIX_TMP, "...
Python
''' Created on Apr 19, 2010 @author: matik ''' from gobject import GObject, type_register, signal_new #@UnresolvedImport import gobject SIGNAL_RUN_FIRST = gobject.SIGNAL_RUN_FIRST #@UndefinedVariable TYPE_NONE = gobject.TYPE_NONE TYPE_PYOBJECT = gobject.TYPE_PYOBJECT class BaseController(GObje...
Python
''' Created on 20.04.2010 @author: ivan ''' import gtk """Base list controller for similar functional on any listview or treeview""" class BaseListController(): POSITION_NAME = 0 def __init__(self, widget): self.widget = widget self.model = gtk.ListStore(str) self.title = None...
Python
# -*- coding: utf-8 -*- ''' Created on Mar 11, 2010 @author: ivan ''' from foobnix.lyric.lyr import get_lyrics import thread from foobnix.util import LOG from foobnix.util.configuration import FConfiguration from foobnix.online.google.translate import translate from foobnix.util.mouse_utils import is_double_click impo...
Python
''' Created on Mar 11, 2010 @author: ivan ''' import os import gst import gtk import time import urllib import thread from foobnix.util.time_utils import convert_ns from foobnix.model.entity import CommonBean from foobnix.util import LOG from foobnix.base import BaseController from foobnix.base import SIGNAL_RUN_FIRS...
Python
''' Created on Mar 11, 2010 @author: ivan ''' import gtk from foobnix.model.entity import CommonBean from foobnix.util import LOG class PlaylistModel: POS_ICON = 0 POS_TRACK_NUMBER = 1 POS_NAME = 2 POS_PATH = 3 POS_COLOR = 4 POS_INDEX = 5 POS_TYPE = 6 def __init__(self, widget): ...
Python
''' Created on Mar 11, 2010 @author: ivan ''' from foobnix.playlist.playlist_model import PlaylistModel from foobnix.model.entity import CommonBean from foobnix.util.mouse_utils import is_double_click from foobnix.player.player_controller import PlayerController from random import randint from foobnix.util.configura...
Python
''' Created on Mar 14, 2010 @author: ivan ''' import gtk from foobnix.window.window_controller import WindowController from foobnix.player.player_controller import PlayerController from foobnix.player.player_widgets_cntr import PlayerWidgetsCntl from foobnix.directory.directory_controller import DirectoryCntr from fo...
Python
''' Created on Mar 14, 2010 @author: ivan ''' import gtk.glade class AppView(): gladeMain = "foobnix/glade/foobnix.glade" gladePref = "foobnix/glade/preferences.glade" def __init__(self): self.gxMain = self.glade_XML(self.gladeMain, "foobnixWindow") self.gxTrayIcon = se...
Python
''' Created on Mar 14, 2010 @author: ivan ''' from foobnix.util.configuration import FConfiguration from foobnix.util import LOG class AppConfigurationCntrl(): def __init__(self, gxMain, directoryCntr): self.directoryCntr = directoryCntr self.folderChoser = gxMain.get_widget("music_dir_filechooserb...
Python
''' Created on Mar 13, 2010 @author: ivan ''' import gtk import os.path from foobnix.base import BaseController from foobnix.base import SIGNAL_RUN_FIRST, TYPE_NONE class TrayIcon(BaseController): """ A class that represents tray icon and a widget that pops up when the icon is right-clicked. ...
Python
''' Created on Mar 13, 2010 @author: ivan ''' import gtk from foobnix.util.configuration import VERSION from foobnix.base import BaseController from foobnix.base import SIGNAL_RUN_FIRST, TYPE_NONE class WindowController(BaseController): __gsignals__ = { 'exit' : (SIGNAL_RUN_FIRST, TYPE_NONE, ()), ...
Python
#!/usr/bin/env python import os, glob, shutil from distutils.core import setup from foobnix.util.configuration import VERSION, FOOBNIX_TMP, FOOBNIX_TMP_RADIO if not os.path.exists(FOOBNIX_TMP): os.mkdir(FOOBNIX_TMP) os.mkdir(FOOBNIX_TMP_RADIO) def capture(cmd): return os.popen(cmd).read().strip() def re...
Python
#!/usr/bin/env python ''' Created on Mar 10, 2010 @author: ivan ''' import pygst from foobnix.util import LOG pygst.require('0.10') import pygtk pygtk.require20() import gtk import gobject import gettext from foobnix.application.app_view import AppView from foobnix.application.app_controller import AppController imp...
Python
#!/usr/bin/env python # # Copyright 2006, 2007 Google Inc. All Rights Reserved. # Author: danderson@google.com (David Anderson) # # Script for uploading files to a Google Code project. # # This is intended to be both a useful script for people who want to # streamline project uploads and a reference implementation for ...
Python
#!/usr/bin/env python # # Copyright 2006, 2007 Google Inc. All Rights Reserved. # Author: danderson@google.com (David Anderson) # # Script for uploading files to a Google Code project. # # This is intended to be both a useful script for people who want to # streamline project uploads and a reference implementation for ...
Python
#!/usr/bin/env python import os, glob, shutil from distutils.core import setup, Extension from foobnix.util.confguration import VERSION def capture(cmd): return os.popen(cmd).read().strip() def removeall(path): if not os.path.isdir(path): return files = os.listdir(path) for x in files: ...
Python
#!/usr/bin/env python ''' Created on Mar 10, 2010 @author: ivan ''' import os import gtk import gettext from foobnix.application.app_view import AppView from foobnix.application.app_controller import AppController class App(): def __init__(self): v = AppView() AppController(v) if __name...
Python
''' Created on Mar 16, 2010 @author: ivan ''' ''' Created on Mar 11, 2010 @author: ivan ''' import gtk from foobnix.model.entity import CommonBean class RadioListModel: POS_ICON = 0 POS_TRACK_NUMBER = 1 POS_NAME = 2 POS_PATH = 3 POS_COLOR = 4 POS_INDEX = 5 def __init__(self, widget): ...
Python
''' Created on Mar 16, 2010 @author: ivan ''' from foobnix.radio.radio_model import RadioListModel from foobnix.util.plsparser import getStationPath, getPlsName ''' Created on Mar 11, 2010 @author: ivan ''' import gtk from foobnix.playlist.playlist_model import PlaylistModel from foobnix.model.entity import Common...
Python
''' Created on Mar 14, 2010 @author: ivan ''' class PrefController(): def __init__(self, gxPref): self.gxPref = gxPref self.pref = gxPref.get_widget("window") self.pref.connect("delete-event", self.hide) def show(self): print "show" self.pref.show()...
Python
# -*- coding: utf-8 -*- ''' Created on Mar 16, 2010 @author: ivanf ''' from foobnix.radio.radio_model import RadioListModel from foobnix.util.plsparser import getStationPath, getPlsName from foobnix.online import pylast import time from foobnix.online.online_model import OnlineListModel from foobnix.online.rupleer im...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-sponsored-links-search/ # # Code is licensed under MIT license. # import re import urllib import random from htmlentitydefs imp...
Python
# -*- coding: utf-8 -*- #!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-search/ # # Code is licensed under MIT license. # import re import urllib from htmlentitydefs import name2codepoint ...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-sponsored-links-search/ # # Code is licensed under MIT license. # import re import urllib import random from htmlentitydefs imp...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-translate/ # # Code is licensed under MIT license. # from browser import Browser, BrowserError from urllib import quote_plus imp...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-search/ # # Code is licensed under MIT license. # import random import socket import urllib import urllib2 import httplib B...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-sets/ # # Code is licensed under MIT license. # import re import urllib import random from htmlentitydefs import name2codepoint...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-search/ # # Code is licensed under MIT license. # import random import socket import urllib import urllib2 import httplib B...
Python
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup parses a (possibly invalid) XML or HTML document into a tree representation. It provides methods and Pythonic idioms that make it easy to navigate, search, and modify the tree. A well-formed X...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-translate/ # # Code is licensed under MIT license. # from browser import Browser, BrowserError from urllib import quote_plus imp...
Python
#!/usr/bin/python # # Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-sets/ # # Code is licensed under MIT license. # import re import urllib import random from htmlentitydefs import name2codepoint...
Python
# -*- coding: utf-8 -*- ''' Created on Mar 17, 2010 @author: ivan ''' # -*- coding: utf-8 -*- import urllib2 import urllib import re import gst import time from string import replace from base64 import encode import sys # -*- coding: utf-8 -*- class Vkontakte: def __init__(self, email, password): self...
Python
''' Created on Mar 18, 2010 @author: ivan ''' from foobnix.model.entity import CommonBean from foobnix.online.pylast import WSError def search_top_albums(network, query): #unicode(query, "utf-8") artist = network.get_artist(query) if not artist: return None try: albums = artist.get_top...
Python
''' Created on Mar 16, 2010 @author: ivan ''' ''' Created on Mar 11, 2010 @author: ivan ''' import gtk from foobnix.model.entity import CommonBean class OnlineListModel: POS_ICON = 0 POS_TRACK_NUMBER = 1 POS_NAME = 2 POS_PATH = 3 POS_COLOR = 4 POS_INDEX = 5 POS_TYPE = 6 POS_PARENT = 7 ...
Python
# -*- coding: utf-8 -*- # # pylast - A Python interface to Last.fm (and other API compatible social networks) # Copyright (C) 2008-2009 Amr Hassan # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundati...
Python
# -*- coding: utf-8 -*- ''' Created on Mar 18, 2010 @author: ivan ''' import urllib2 import re from base64 import encode import urllib from string import replace def _engine_search(value): value = replace(value, " ", "+") host = "http://en.vpleer.ru/?q=" + value print host data = urllib2.urlopen(hos...
Python
# -*- coding: utf-8 -*- # lyricwiki.py # # Copyright 2009 Amr Hassan <amr.hassan@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either v...
Python
# -*- coding: utf-8 -*- ''' Created on Mar 30, 2010 @author: ivan ''' import gtk import time from foobnix.util import LOG class PrefListModel(): POS_NAME = 0 def __init__(self, widget, prefListMap): self.widget = widget self.prefListMap = prefListMap self.model = gtk.ListStore(str) ...
Python
''' Created on Mar 11, 2010 @author: ivan ''' from foobnix.model.entity import CommonBean class VirturalLIstCntr(): def __init__(self): self.items = [] def get_items(self): return self.items def get_item_by_index(self, index): return self.items[index...
Python
''' Created on Mar 11, 2010 @author: ivan ''' import gtk import gobject from foobnix.model.entity import CommonBean class DirectoryModel(): POS_NAME = 0 POS_PATH = 1 POS_FONT = 2 POS_VISIBLE = 3 POS_TYPE = 4 POS_INDEX = 5 POS_PARENT = 5 def __init__(self, widget): self.wid...
Python
# -*- coding: utf-8 -*- ''' Created on Mar 11, 2010 @author: ivan ''' import os from foobnix.util import LOG from foobnix.directory.directory_model import DirectoryModel from foobnix.model.entity import CommonBean from foobnix.util.confguration import FConfiguration from foobnix.util.file_utils import isDirectory,...
Python
''' Created on Feb 26, 2010 @author: ivan ''' from mutagen.easyid3 import EasyID3 from mutagen.mp3 import MP3, HeaderNotFoundError from mutagen import File import os import gtk class CommonBean(): TYPE_FOLDER = "TYPE_FOLDER" TYPE_LABEL = "TYPE_LABEL" TYPE_GOOGLE_HELP = "TYPE_GOOGLE_HELP" TYPE_MUSIC...
Python
import gtk def is_double_click(event): if event.button == 1 and event.type == gtk.gdk._2BUTTON_PRESS: #@UndefinedVariable return True else: return False
Python
''' Created on Feb 26, 2010 @author: ivan ''' def debug(*args): print "DEBUG:", args def info(*args): print "INFO:", args def error(*args): print "ERROR:", args
Python
import sys, os, time, atexit from signal import SIGTERM class Daemon: """ A generic daemon class. Usage: subclass the Daemon class and override the run() method """ def __init__(self, pidfile): self.pidfile = pidfile def daemonize(self...
Python
''' Created on Feb 26, 2010 @author: ivan ''' import os def isDirectory(path): return os.path.isdir(path) def getExtenstion(fileName): return fileName[-4:].lower()
Python
''' Created on Feb 26, 2010 @author: ivan ''' def convert_ns(time_int): time_int = time_int / 1000000000 time_str = "" if time_int >= 3600: _hours = time_int / 3600 time_int = time_int - (_hours * 3600) time_str = str(_hours) + ":" if time_int >= 600: _mins = time_in...
Python
''' Created on Mar 3, 2010 @author: ivan ''' import urllib2 def getStationPath(url): print "get station" if not url: return None _file_url = url urls = [] try: connect = urllib2.urlopen(url) data = connect.read() urls = getStations(dat...
Python
# -*- coding: utf-8 -*- ''' Created on Feb 27, 2010 @author: ivan ''' import pickle import os from foobnix.util import LOG import tempfile VERSION = "0.1.0" class Singleton(type): def __call__(self, *args, **kw): if self.instance is None: self.instance = super(Singleton, self).__call__(*args,...
Python
# -*- coding: utf-8 -*- ''' Created on Mar 11, 2010 @author: ivan ''' from foobnix.lyric.lyr import get_lyrics import thread import gtk from foobnix.util import LOG from foobnix.util.confguration import FConfiguration class PlayerWidgetsCntl(): ''' ''' def __init__(self, gxMain, playerCntr): ...
Python
''' Created on Mar 11, 2010 @author: ivan ''' import gst import gtk import time import thread from foobnix.util.time_utils import convert_ns from foobnix.model.entity import CommonBean from foobnix.util import LOG from foobnix.util.confguration import FConfiguration class PlayerController: MODE_RADIO = "RADIO" ...
Python
''' Created on Mar 11, 2010 @author: ivan ''' import gtk from foobnix.model.entity import CommonBean from foobnix.util import LOG class PlaylistModel: POS_ICON = 0 POS_TRACK_NUMBER = 1 POS_NAME = 2 POS_PATH = 3 POS_COLOR = 4 POS_INDEX = 5 POS_TYPE = 6 def __init__(self, widget): ...
Python
''' Created on Mar 11, 2010 @author: ivan ''' import gtk from foobnix.playlist.playlist_model import PlaylistModel from foobnix.model.entity import CommonBean from foobnix.util.mouse_utils import is_double_click from foobnix.player.player_controller import PlayerController from random import random, randint from foo...
Python