Merge branch 'master' into Ocarina-4.2
This commit is contained in:
commit
fdcbec5389
|
@ -4,10 +4,10 @@ __all__ = [ "collection", "music",
|
||||||
"data", "event", "map", "path", "plugin"]
|
"data", "event", "map", "path", "plugin"]
|
||||||
|
|
||||||
__major__ = 1
|
__major__ = 1
|
||||||
__minor__ = 1
|
__minor__ = 2
|
||||||
__dev__ = True
|
__dev__ = True
|
||||||
__vers__ = "Libsaria %s.%s" % (__major__, __minor__)
|
__vers__ = "Libsaria %s.%s" % (__major__, __minor__)
|
||||||
if __dev__ == False:
|
if __dev__ == True:
|
||||||
__vers__ += "-dev"
|
__vers__ += "-dev"
|
||||||
|
|
||||||
import event
|
import event
|
||||||
|
|
|
@ -14,9 +14,16 @@ PLAYLIST = 1
|
||||||
QUEUE = 2
|
QUEUE = 2
|
||||||
|
|
||||||
import lens
|
import lens
|
||||||
library = lens.Library()
|
import library
|
||||||
playlist = lens.Playlist()
|
playlist = lens.Playlist()
|
||||||
|
|
||||||
|
file_to_id = library.file_to_id
|
||||||
|
play_id = library.play_id
|
||||||
|
get_attr = library.get_attr
|
||||||
|
reset = library.reset
|
||||||
|
inc_score = library.inc_score
|
||||||
|
inc_count = library.inc_count
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
libsaria.init_pref("random", False)
|
libsaria.init_pref("random", False)
|
||||||
libsaria.event.invite("POSTINIT", init)
|
libsaria.event.invite("POSTINIT", init)
|
||||||
|
@ -33,44 +40,6 @@ def new_source(path, bg=True):
|
||||||
return 0
|
return 0
|
||||||
return call("NEWSOURCE", library.scan, path)
|
return call("NEWSOURCE", library.scan, path)
|
||||||
|
|
||||||
def walk_library():
|
|
||||||
global library
|
|
||||||
for track in library.walk_tags():
|
|
||||||
yield track
|
|
||||||
|
|
||||||
def lib_reset():
|
|
||||||
global library
|
|
||||||
library.reset()
|
|
||||||
library.save()
|
|
||||||
|
|
||||||
def lib_get_attr(id, attr):
|
|
||||||
global library
|
|
||||||
if id >= 0:
|
|
||||||
return library.get_attr(id, attr)
|
|
||||||
|
|
||||||
def lib_inc_count(id):
|
|
||||||
global library
|
|
||||||
if id >= 0:
|
|
||||||
library.inc_count(id)
|
|
||||||
library.save()
|
|
||||||
|
|
||||||
def lib_inc_score(id, amount=1):
|
|
||||||
global library
|
|
||||||
if id >= 0:
|
|
||||||
library.inc_score(id, amount)
|
|
||||||
library.save()
|
|
||||||
|
|
||||||
def lib_play_id(id):
|
|
||||||
global cur_lib_id
|
|
||||||
cur_lib_id = id
|
|
||||||
filepath = lib_get_attr(id, "filepath")
|
|
||||||
libsaria.music.load(filepath)
|
|
||||||
libsaria.music.play()
|
|
||||||
|
|
||||||
def lib_find_id(file):
|
|
||||||
global library
|
|
||||||
return library.find_id(file)
|
|
||||||
|
|
||||||
def lib_get_cur_id():
|
def lib_get_cur_id():
|
||||||
global cur_lib_id
|
global cur_lib_id
|
||||||
return cur_lib_id
|
return cur_lib_id
|
||||||
|
@ -101,9 +70,9 @@ def plist_add_libid(lib_id):
|
||||||
# Hey, Future Bryan. I really want to use a lib_get_attrs() function
|
# Hey, Future Bryan. I really want to use a lib_get_attrs() function
|
||||||
# to return a list of attributes. Can you do that for me, please?
|
# to return a list of attributes. Can you do that for me, please?
|
||||||
# Thank you, Past Bryan
|
# Thank you, Past Bryan
|
||||||
artist = lib_get_attr(lib_id, "artist")
|
artist = library.get_attr(lib_id, "artist")
|
||||||
album = lib_get_attr(lib_id, "album")
|
album = library.get_attr(lib_id, "album")
|
||||||
title = lib_get_attr(lib_id, "title")
|
title = library.get_attr(lib_id, "title")
|
||||||
playlist.insert_tags(artist, album, title, lib_id)
|
playlist.insert_tags(artist, album, title, lib_id)
|
||||||
|
|
||||||
def plist_is_visible(id):
|
def plist_is_visible(id):
|
||||||
|
@ -130,23 +99,23 @@ def choose_next():
|
||||||
else:
|
else:
|
||||||
next = playlist.next_id(cur_lib_id)
|
next = playlist.next_id(cur_lib_id)
|
||||||
if next != None:
|
if next != None:
|
||||||
return call("NEXT", lib_play_id, next)
|
return call("NEXT", play_id, next)
|
||||||
|
|
||||||
def change_score():
|
def change_score():
|
||||||
prcnt = libsaria.music.get_progress()
|
prcnt = libsaria.music.get_progress()
|
||||||
if prcnt > 0.75:
|
if prcnt > 0.75:
|
||||||
lib_inc_count(cur_lib_id)
|
inc_count(cur_lib_id)
|
||||||
lib_inc_score(cur_lib_id)
|
inc_score(cur_lib_id)
|
||||||
if prcnt < 0.33:
|
if prcnt < 0.33:
|
||||||
lib_inc_score(cur_lib_id, -1)
|
inc_score(cur_lib_id, -1)
|
||||||
|
|
||||||
def plist_next():
|
def plist_next():
|
||||||
change_score()
|
change_score()
|
||||||
choose_next()
|
choose_next()
|
||||||
|
|
||||||
def catch_eos(*args):
|
def catch_eos(*args):
|
||||||
lib_inc_count(cur_lib_id)
|
inc_count(cur_lib_id)
|
||||||
lib_inc_score(cur_lib_id)
|
inc_score(cur_lib_id)
|
||||||
choose_next()
|
choose_next()
|
||||||
libsaria.event.invite("POSTEOS", catch_eos)
|
libsaria.event.invite("POSTEOS", catch_eos)
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ class Playlist(collection.Collection):
|
||||||
def random(self):
|
def random(self):
|
||||||
if self.size == 0:
|
if self.size == 0:
|
||||||
return
|
return
|
||||||
getattr = libsaria.collection.lib_get_attr
|
getattr = libsaria.collection.get_attr
|
||||||
last = self.last_tracks
|
last = self.last_tracks
|
||||||
for i in xrange(15):
|
for i in xrange(15):
|
||||||
id = self.get_rand_candidate()
|
id = self.get_rand_candidate()
|
||||||
|
|
|
@ -0,0 +1,103 @@
|
||||||
|
# Bryan Schumaker (11/05/2010)
|
||||||
|
|
||||||
|
import libsaria
|
||||||
|
|
||||||
|
fs_tree = None
|
||||||
|
tag_tree = None
|
||||||
|
index = None
|
||||||
|
tracks = None
|
||||||
|
next_id = None
|
||||||
|
sources = None
|
||||||
|
size = None
|
||||||
|
|
||||||
|
def reset():
|
||||||
|
from tree import DLTree
|
||||||
|
from index import Index
|
||||||
|
fs_tree = DLTree()
|
||||||
|
tag_tree = DLTree()
|
||||||
|
index = Index()
|
||||||
|
tracks = dict()
|
||||||
|
next_id = 0
|
||||||
|
size = 0
|
||||||
|
sources = []
|
||||||
|
save()
|
||||||
|
|
||||||
|
def load():
|
||||||
|
global fs_tree
|
||||||
|
global tag_tree
|
||||||
|
global index
|
||||||
|
global tracks
|
||||||
|
global next_id
|
||||||
|
global sources
|
||||||
|
global size
|
||||||
|
objects = libsaria.data.load("library", ".dl_tree")
|
||||||
|
if objects == None or len(objects) != 6:
|
||||||
|
reset()
|
||||||
|
return
|
||||||
|
(fs_tree, tag_tree, index, tracks, next_id, size) = objects
|
||||||
|
load()
|
||||||
|
|
||||||
|
def save():
|
||||||
|
libsaria.data.save(
|
||||||
|
(fs_tree, tag_tree, index, tracks, next_id, size),
|
||||||
|
"library", ".dl_tree")
|
||||||
|
|
||||||
|
def walk_tags():
|
||||||
|
for tag in tag_tree.walk_forwards():
|
||||||
|
rec = tracks[tag[3]]
|
||||||
|
yield tag + [rec.year] + [rec.lenstr]
|
||||||
|
|
||||||
|
def file_to_id(file):
|
||||||
|
global fs_tree
|
||||||
|
stripped = file.strip(libsaria.path.sep)
|
||||||
|
split = stripped.split(libsaria.path.sep)
|
||||||
|
|
||||||
|
res = fs_tree.walk_path(split)
|
||||||
|
if res == False:
|
||||||
|
return None
|
||||||
|
return res[0]
|
||||||
|
|
||||||
|
def get_attr(id, attr):
|
||||||
|
rec = tracks.get(id, None)
|
||||||
|
if rec == None:
|
||||||
|
return None
|
||||||
|
if attr == "filepath":
|
||||||
|
cmp = rec.fs.walk_backwards()
|
||||||
|
return libsaria.path.sep.join([""] + cmp)
|
||||||
|
if attr == "playcount":
|
||||||
|
return rec.count
|
||||||
|
if attr == "year":
|
||||||
|
return rec.year
|
||||||
|
if attr == "lenstr":
|
||||||
|
return rec.lenstr
|
||||||
|
if attr == "score":
|
||||||
|
return rec.score
|
||||||
|
|
||||||
|
tags = rec.tags.walk_backwards()
|
||||||
|
if attr == "artist":
|
||||||
|
return tags[0]
|
||||||
|
if attr == "album":
|
||||||
|
return tags[1]
|
||||||
|
if attr == "title":
|
||||||
|
return tags[2]
|
||||||
|
|
||||||
|
def inc_score(id, amount=1):
|
||||||
|
rec = tracks.get(id, None)
|
||||||
|
if rec:
|
||||||
|
rec.score += amount
|
||||||
|
save()
|
||||||
|
|
||||||
|
def inc_count(id):
|
||||||
|
rec = tracks.get(id, None)
|
||||||
|
if rec:
|
||||||
|
rec.count += 1
|
||||||
|
save()
|
||||||
|
|
||||||
|
def play_id(id):
|
||||||
|
libsaria.collection.cur_lib_id = id
|
||||||
|
filepath = get_attr(id, "filepath")
|
||||||
|
libsaria.music.load(filepath)
|
||||||
|
libsaria.music.play()
|
||||||
|
|
||||||
|
def is_visible(id):
|
||||||
|
return True
|
|
@ -54,9 +54,9 @@ def universal_open(file):
|
||||||
plugin.install(file)
|
plugin.install(file)
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
id = libsaria.collection.lib_find_id(file)
|
id = libsaria.collection.file_to_id(file)
|
||||||
if id:
|
if id:
|
||||||
libsaria.collection.lib_play_id(id)
|
libsaria.collection.play_id(id)
|
||||||
else:
|
else:
|
||||||
libsaria.music.load(file)
|
libsaria.music.load(file)
|
||||||
except Exception,e:
|
except Exception,e:
|
||||||
|
|
|
@ -4,8 +4,9 @@ import libsaria
|
||||||
import web
|
import web
|
||||||
import xm
|
import xm
|
||||||
|
|
||||||
cache = libsaria.cache
|
file_to_id = libsaria.collection.file_to_id
|
||||||
pref_attr = xm.find_preferred_attribute
|
cache = libsaria.cache
|
||||||
|
pref_attr = xm.find_preferred_attribute
|
||||||
|
|
||||||
pref_sizes = ["extralarge", "large", "medium", "small"]
|
pref_sizes = ["extralarge", "large", "medium", "small"]
|
||||||
|
|
||||||
|
@ -61,11 +62,11 @@ def lfm_cache_album(file, artist, album):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_artwork(filepath):
|
def get_artwork(filepath):
|
||||||
id = libsaria.collection.lib_find_id(filepath)
|
id = file_to_id(filepath)
|
||||||
if id == None:
|
if id == None:
|
||||||
return
|
return
|
||||||
artist = libsaria.collection.lib_get_attr(id, "artist")
|
artist = libsaria.collection.get_attr(id, "artist")
|
||||||
album = libsaria.collection.lib_get_attr(id, "album")
|
album = libsaria.collection.get_attr(id, "album")
|
||||||
cached = cache[artist]
|
cached = cache[artist]
|
||||||
file = cached.get("%s.jpg" % album, lfm_cache_album, artist, album)
|
file = cached.get("%s.jpg" % album, lfm_cache_album, artist, album)
|
||||||
libsaria.event.start("POSTGETART", file)
|
libsaria.event.start("POSTGETART", file)
|
||||||
|
|
|
@ -8,10 +8,10 @@ import libsaria
|
||||||
gdk = gtk.gdk
|
gdk = gtk.gdk
|
||||||
|
|
||||||
__major__ = 4
|
__major__ = 4
|
||||||
__minor__ = 1
|
__minor__ = 2
|
||||||
__dev__ = True
|
__dev__ = True
|
||||||
__vers__ = "Ocarina %s.%s" % (__major__, __minor__)
|
__vers__ = "Ocarina %s.%s" % (__major__, __minor__)
|
||||||
if __dev__ == False:
|
if __dev__ == True:
|
||||||
__vers__ += "-dev"
|
__vers__ += "-dev"
|
||||||
|
|
||||||
gdk.threads_init()
|
gdk.threads_init()
|
||||||
|
|
|
@ -6,6 +6,7 @@ import menu
|
||||||
|
|
||||||
libsaria = ocarina.libsaria
|
libsaria = ocarina.libsaria
|
||||||
from libsaria import collection
|
from libsaria import collection
|
||||||
|
library = collection.library
|
||||||
|
|
||||||
event = ocarina.libsaria.event
|
event = ocarina.libsaria.event
|
||||||
gtk = ocarina.gtk
|
gtk = ocarina.gtk
|
||||||
|
@ -81,7 +82,7 @@ class Library(Collection):
|
||||||
def populate(self):
|
def populate(self):
|
||||||
#import datetime
|
#import datetime
|
||||||
#before = datetime.datetime.now()
|
#before = datetime.datetime.now()
|
||||||
Collection.populate(self, collection.walk_library)
|
Collection.populate(self, library.walk_tags)
|
||||||
#after = datetime.datetime.now()
|
#after = datetime.datetime.now()
|
||||||
#print "Populating took: %s" % (after - before)
|
#print "Populating took: %s" % (after - before)
|
||||||
|
|
||||||
|
@ -90,17 +91,17 @@ class Library(Collection):
|
||||||
self.populate()
|
self.populate()
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
collection.lib_reset()
|
collection.reset()
|
||||||
self.clear()
|
self.clear()
|
||||||
|
|
||||||
def mouse_motion(self, row):
|
def mouse_motion(self, row):
|
||||||
return (collection.lib_get_attr(row[0], "playcount"),
|
return (collection.get_attr(row[0], "playcount"),
|
||||||
collection.lib_get_attr(row[0], "score"))
|
collection.get_attr(row[0], "score"))
|
||||||
|
|
||||||
def select_row(self, row):
|
def select_row(self, row):
|
||||||
collection.change_score()
|
collection.change_score()
|
||||||
collection.lib_play_id(row[0])
|
collection.play_id(row[0])
|
||||||
collection.lib_inc_score(row[0], 1)
|
collection.inc_score(row[0], 1)
|
||||||
|
|
||||||
def filter(self, text):
|
def filter(self, text):
|
||||||
collection.lib_filter(text)
|
collection.lib_filter(text)
|
||||||
|
@ -138,13 +139,13 @@ class Playlist(Collection):
|
||||||
#print "Populating took: %s" % (after - before)
|
#print "Populating took: %s" % (after - before)
|
||||||
|
|
||||||
def mouse_motion(self, row):
|
def mouse_motion(self, row):
|
||||||
return (collection.lib_get_attr(row[0], "playcount"),
|
return (collection.get_attr(row[0], "playcount"),
|
||||||
collection.lib_get_attr(row[0], "score"))
|
collection.get_attr(row[0], "score"))
|
||||||
|
|
||||||
def select_row(self, row):
|
def select_row(self, row):
|
||||||
collection.change_score()
|
collection.change_score()
|
||||||
collection.lib_play_id(row[0])
|
collection.play_id(row[0])
|
||||||
collection.lib_inc_score(row[0], 1)
|
collection.inc_score(row[0], 1)
|
||||||
|
|
||||||
def filter(self, text):
|
def filter(self, text):
|
||||||
collection.plist_filter(text)
|
collection.plist_filter(text)
|
||||||
|
|
|
@ -11,7 +11,8 @@ label = None
|
||||||
image = None
|
image = None
|
||||||
|
|
||||||
lib_get_cur_id = libsaria.collection.lib_get_cur_id
|
lib_get_cur_id = libsaria.collection.lib_get_cur_id
|
||||||
lib_get_attr = libsaria.collection.lib_get_attr
|
get_attr = libsaria.collection.get_attr
|
||||||
|
file_to_id = libsaria.collection.file_to_id
|
||||||
|
|
||||||
filter = None
|
filter = None
|
||||||
info = None
|
info = None
|
||||||
|
@ -72,9 +73,9 @@ class InfoBar(Bar):
|
||||||
libsaria.event.invite("POSTLOAD", self.change_title)
|
libsaria.event.invite("POSTLOAD", self.change_title)
|
||||||
|
|
||||||
def change_title(self, filepath):
|
def change_title(self, filepath):
|
||||||
id = libsaria.collection.lib_find_id(filepath)
|
id = file_to_id(filepath)
|
||||||
title = lib_get_attr(id, "title")
|
title = get_attr(id, "title")
|
||||||
artist = libsaria.collection.lib_get_attr(id, "artist")
|
artist = get_attr(id, "artist")
|
||||||
self.title.set_text("%s by %s" % (title,artist))
|
self.title.set_text("%s by %s" % (title,artist))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,19 +7,19 @@ invite = ocarina.libsaria.event.invite
|
||||||
libsaria = ocarina.libsaria
|
libsaria = ocarina.libsaria
|
||||||
|
|
||||||
#update = None
|
#update = None
|
||||||
get_time = None
|
get_time = None
|
||||||
lib_get_attr = None
|
get_attr = None
|
||||||
lib_find_id = None
|
file_to_id = None
|
||||||
|
|
||||||
def set_fns():
|
def set_fns():
|
||||||
#global update
|
#global update
|
||||||
global get_time
|
global get_time
|
||||||
global lib_get_attr
|
global get_attr
|
||||||
global lib_find_id
|
global file_to_id
|
||||||
#update = ocarina.libsaria.music.get_progress
|
#update = ocarina.libsaria.music.get_progress
|
||||||
get_time = ocarina.libsaria.music.get_time
|
get_time = ocarina.libsaria.music.get_time
|
||||||
lib_get_attr = libsaria.collection.lib_get_attr
|
get_attr = libsaria.collection.get_attr
|
||||||
lib_find_id = libsaria.collection.lib_find_id
|
file_to_id = libsaria.collection.file_to_id
|
||||||
invite("POSTSTART", set_fns)
|
invite("POSTSTART", set_fns)
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,11 +45,10 @@ class AttrLabel(gtk.Alignment):
|
||||||
invite("POSTLOAD", self.update)
|
invite("POSTLOAD", self.update)
|
||||||
|
|
||||||
def update(self, filepath):
|
def update(self, filepath):
|
||||||
global lib_find_id
|
global get_attr
|
||||||
global lib_get_attr
|
id = file_to_id(filepath)
|
||||||
id = lib_find_id(filepath)
|
|
||||||
if id != None:
|
if id != None:
|
||||||
text = str(lib_get_attr(id, self.attr))
|
text = str(get_attr(id, self.attr))
|
||||||
if self.other:
|
if self.other:
|
||||||
text = "%s %s" % (self.other, text)
|
text = "%s %s" % (self.other, text)
|
||||||
self.label.set_text(text)
|
self.label.set_text(text)
|
||||||
|
|
|
@ -6,30 +6,48 @@ gtk = ocarina.gtk
|
||||||
Menu = gtk.Menu
|
Menu = gtk.Menu
|
||||||
MenuItem = gtk.MenuItem
|
MenuItem = gtk.MenuItem
|
||||||
|
|
||||||
lib_items = []
|
common_items = []
|
||||||
plist_items = []
|
lib_items = []
|
||||||
|
plist_items = []
|
||||||
|
|
||||||
def add_menu_item(items, text, func):
|
def add_menu_item(items, text, func):
|
||||||
items.append( (text, func) )
|
items.append( (text, func) )
|
||||||
items.sort()
|
items.sort()
|
||||||
|
|
||||||
|
def add_common_menu_item(text, func):
|
||||||
|
add_menu_item(common_items, text, func)
|
||||||
|
|
||||||
def add_lib_menu_item(text, func):
|
def add_lib_menu_item(text, func):
|
||||||
add_menu_item(lib_items, text, func)
|
add_menu_item(lib_items, text, func)
|
||||||
|
|
||||||
def add_plist_menu_item(text, func):
|
def add_plist_menu_item(text, func):
|
||||||
add_menu_item(plist_items, text, func)
|
add_menu_item(plist_items, text, func)
|
||||||
|
|
||||||
|
def make_menu_item(text, func):
|
||||||
|
item = MenuItem(text)
|
||||||
|
item.connect("activate", func)
|
||||||
|
item.show()
|
||||||
|
return item
|
||||||
|
|
||||||
def make_menu(items, button, time):
|
def make_menu(items, button, time):
|
||||||
if len(items) == 0:
|
show = False
|
||||||
return
|
if len(items) > 0:
|
||||||
|
show = True
|
||||||
menu = Menu()
|
menu = Menu()
|
||||||
|
|
||||||
|
if len(common_items) > 0:
|
||||||
|
show = True
|
||||||
|
for (text, func) in common_items:
|
||||||
|
menu.append(make_menu_item(text, func))
|
||||||
|
if len(items) > 0:
|
||||||
|
div = MenuItem()
|
||||||
|
div.show()
|
||||||
|
menu.append(div)
|
||||||
|
|
||||||
for (text, func) in items:
|
for (text, func) in items:
|
||||||
item = MenuItem(text)
|
menu.append(make_menu_item(text, func))
|
||||||
item.connect("activate", func)
|
if show == True:
|
||||||
item.show()
|
menu.popup(None, None, None, button, time)
|
||||||
menu.append(item)
|
|
||||||
menu.popup(None, None, None, button, time)
|
|
||||||
|
|
||||||
def make_lib_menu(button, time):
|
def make_lib_menu(button, time):
|
||||||
make_menu(lib_items, button, time)
|
make_menu(lib_items, button, time)
|
||||||
|
|
|
@ -17,8 +17,7 @@ def start():
|
||||||
text = "Pause after current song"
|
text = "Pause after current song"
|
||||||
libsaria.init_var("PAUSEAFTER", False)
|
libsaria.init_var("PAUSEAFTER", False)
|
||||||
|
|
||||||
menu.add_lib_menu_item(text, set_pause)
|
menu.add_common_menu_item(text, set_pause)
|
||||||
menu.add_plist_menu_item(text, set_pause)
|
|
||||||
libsaria.event.invite("POSTNEXT", check_pause)
|
libsaria.event.invite("POSTNEXT", check_pause)
|
||||||
|
|
||||||
def stop():
|
def stop():
|
||||||
|
@ -27,6 +26,6 @@ def stop():
|
||||||
def check_version():
|
def check_version():
|
||||||
if ocarina.__major__ != 4:
|
if ocarina.__major__ != 4:
|
||||||
return False
|
return False
|
||||||
if ocarina.__minor__ != 1:
|
if ocarina.__minor__ != 2:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -48,6 +48,6 @@ def stop():
|
||||||
def check_version():
|
def check_version():
|
||||||
if ocarina.__major__ != 4:
|
if ocarina.__major__ != 4:
|
||||||
return False
|
return False
|
||||||
if ocarina.__minor__ != 1:
|
if ocarina.__minor__ >= 1:
|
||||||
return False
|
return True
|
||||||
return True
|
return False
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# Bryan Schumaker (10/30/2010)
|
# Bryan Schumaker (10/30/2010)
|
||||||
|
|
||||||
import ocarina
|
import ocarina
|
||||||
gdk = ocarina.gdk
|
gdk = ocarina.gdk
|
||||||
libsaria = ocarina.libsaria
|
libsaria = ocarina.libsaria
|
||||||
lib_find_id = libsaria.collection.lib_find_id
|
file_to_id = libsaria.collection.file_to_id
|
||||||
lib_get_attr = libsaria.collection.lib_get_attr
|
get_attr = libsaria.collection.get_attr
|
||||||
invite = libsaria.event.invite
|
invite = libsaria.event.invite
|
||||||
|
|
||||||
|
|
||||||
def tweak_icon(file):
|
def tweak_icon(file):
|
||||||
|
@ -17,8 +17,8 @@ def tweak_icon(file):
|
||||||
|
|
||||||
def tweak_title(filepath):
|
def tweak_title(filepath):
|
||||||
if filepath != None:
|
if filepath != None:
|
||||||
id = lib_find_id(filepath)
|
id = file_to_id(filepath)
|
||||||
title = lib_get_attr(id, "title")
|
title = get_attr(id, "title")
|
||||||
else:
|
else:
|
||||||
title = ocarina.__vers__
|
title = ocarina.__vers__
|
||||||
ocarina.set_window_title(title)
|
ocarina.set_window_title(title)
|
||||||
|
@ -33,6 +33,6 @@ def stop():
|
||||||
def check_version():
|
def check_version():
|
||||||
if ocarina.__major__ != 4:
|
if ocarina.__major__ != 4:
|
||||||
return False
|
return False
|
||||||
if ocarina.__minor__ != 1:
|
if ocarina.__minor__ >= 1:
|
||||||
return False
|
return True
|
||||||
return True
|
return False
|
||||||
|
|
Loading…
Reference in New Issue