New filtering system, recognizing a ',' as an or
git-svn-id: file:///home/anna/Desktop/ocarina-legacy/mithos/ocarina@61 1daee41c-8060-4895-b1f0-2197c00d777a
This commit is contained in:
parent
47317b24b9
commit
072f5e38a9
|
@ -17,6 +17,9 @@ compile:
|
||||||
count:
|
count:
|
||||||
cat src/*.py | grep -v '[[:space:]]*\#' | cat -b
|
cat src/*.py | grep -v '[[:space:]]*\#' | cat -b
|
||||||
|
|
||||||
|
tar:
|
||||||
|
cd ../../ && tar -czf ocarina.tar.gz ocarina/
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# mkdir ~/bin/ocarina-bin
|
# mkdir ~/bin/ocarina-bin
|
||||||
rsync -avz src/ ~/bin/ocarina-bin/src
|
rsync -avz src/ ~/bin/ocarina-bin/src
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
- Cannot scan library twice in same session
|
||||||
|
- One song doesn't get added to list when scanning (probably last song)
|
||||||
|
- What happens when songs are selected to be added to library?
|
||||||
|
- Error updating liblist while scanning if library tab is visible
|
||||||
|
-
|
|
@ -0,0 +1,4 @@
|
||||||
|
- tagpy
|
||||||
|
- gstreamer-plugins-*
|
||||||
|
- pygst
|
||||||
|
|
|
@ -31,7 +31,10 @@ class ContentPane(gtk.HBox):
|
||||||
|
|
||||||
self.show()
|
self.show()
|
||||||
# Load up the last saved song
|
# Load up the last saved song
|
||||||
self.library.loadSong(self.data.library.files[self.data.curSong])
|
try:
|
||||||
|
self.library.loadSong(self.data.library.files[self.data.curSong])
|
||||||
|
except:
|
||||||
|
True == True
|
||||||
self.gotoCurSong()
|
self.gotoCurSong()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
for file in `ls *.py | cut -d '.' -f 1`
|
||||||
|
do
|
||||||
|
echo $file
|
||||||
|
cython $file.py
|
||||||
|
gcc -c -fPIC -O3 -I/usr/include/python2.6 $file.c
|
||||||
|
gcc -shared $file.o -o $file.so
|
||||||
|
done
|
|
@ -3,7 +3,7 @@ import re
|
||||||
import tagpy
|
import tagpy
|
||||||
#import cPickle as pickle
|
#import cPickle as pickle
|
||||||
from songInfo import SongInfo
|
from songInfo import SongInfo
|
||||||
import thread
|
#import thread
|
||||||
|
|
||||||
|
|
||||||
class Library:
|
class Library:
|
||||||
|
|
|
@ -38,6 +38,7 @@ class List(gtk.ScrolledWindow):
|
||||||
self.timeText()
|
self.timeText()
|
||||||
|
|
||||||
self.string = ""
|
self.string = ""
|
||||||
|
self.search = []
|
||||||
self.filter = self.list.filter_new()
|
self.filter = self.list.filter_new()
|
||||||
self.filter.set_visible_func(self.hideRows,"")
|
self.filter.set_visible_func(self.hideRows,"")
|
||||||
self.sort = gtk.TreeModelSort(self.filter)
|
self.sort = gtk.TreeModelSort(self.filter)
|
||||||
|
@ -152,6 +153,7 @@ class List(gtk.ScrolledWindow):
|
||||||
|
|
||||||
def filterRows(self,string):
|
def filterRows(self,string):
|
||||||
self.string = string
|
self.string = string
|
||||||
|
self.formatSearch(self.string)
|
||||||
self.seconds = 0
|
self.seconds = 0
|
||||||
self.count = 0
|
self.count = 0
|
||||||
self.filter.refilter()
|
self.filter.refilter()
|
||||||
|
@ -167,6 +169,7 @@ class List(gtk.ScrolledWindow):
|
||||||
self.count = 0
|
self.count = 0
|
||||||
self.seconds = 0
|
self.seconds = 0
|
||||||
self.string = string
|
self.string = string
|
||||||
|
self.formatSearch(self.string)
|
||||||
for file in list:
|
for file in list:
|
||||||
if self.hideRows(None,file,string) == True:
|
if self.hideRows(None,file,string) == True:
|
||||||
self.count+=1
|
self.count+=1
|
||||||
|
@ -174,19 +177,31 @@ class List(gtk.ScrolledWindow):
|
||||||
self.makeLabel()
|
self.makeLabel()
|
||||||
|
|
||||||
|
|
||||||
|
def formatSearch(self,string):
|
||||||
|
self.search = []
|
||||||
|
split = string.split(",")
|
||||||
|
for line in split:
|
||||||
|
line = line.strip()
|
||||||
|
if len(line) > 0:
|
||||||
|
self.search+=[line]
|
||||||
|
|
||||||
|
|
||||||
def hideRows(self,list,iter,string):
|
def hideRows(self,list,iter,string):
|
||||||
if list:
|
if list:
|
||||||
file = self.data.library.files[list[iter][0]]
|
file = self.data.library.files[list[iter][0]]
|
||||||
else:
|
else:
|
||||||
file = iter
|
file = iter
|
||||||
if self.string == "":
|
#if self.string == "":
|
||||||
return True
|
# return True
|
||||||
if re.search(self.string,file.titlel):
|
if len(self.search) == 0:
|
||||||
return True
|
|
||||||
elif re.search(self.string,file.artistl):
|
|
||||||
return True
|
|
||||||
elif re.search(self.string,file.albuml):
|
|
||||||
return True
|
return True
|
||||||
|
for term in self.search:
|
||||||
|
if re.search(term,file.titlel):
|
||||||
|
return True
|
||||||
|
elif re.search(term,file.artistl):
|
||||||
|
return True
|
||||||
|
elif re.search(term,file.albuml):
|
||||||
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue