[gpapers] 3 new revisions pushed by marcelCo...@gmail.com on 2012-06-30 23:43 GMT

5 views
Skip to first unread message

codesite...@google.com

unread,
Jun 30, 2012, 7:43:04 PM6/30/12
to gpapers...@googlegroups.com
3 new revisions:

Revision: 2b6d7d53842f
Author: Marcel Stimberg <marcel...@gmail.com>
Date: Sat Jun 30 06:35:07 2012
Log: fix name of data dir, move old dir to new location if it exists
http://code.google.com/p/gpapers/source/detail?r=2b6d7d53842f

Revision: 3b26395df4cb
Author: Marcel Stimberg <marcel...@gmail.com>
Date: Sat Jun 30 06:47:19 2012
Log: set some more default attributes
http://code.google.com/p/gpapers/source/detail?r=3b26395df4cb

Revision: 55e69b472e83
Author: Marcel Stimberg <marcel...@gmail.com>
Date: Sat Jun 30 16:22:09 2012
Log: fix two issues when saving searches
http://code.google.com/p/gpapers/source/detail?r=55e69b472e83

==============================================================================
Revision: 2b6d7d53842f
Author: Marcel Stimberg <marcel...@gmail.com>
Date: Sat Jun 30 06:35:07 2012
Log: fix name of data dir, move old dir to new location if it exists
http://code.google.com/p/gpapers/source/detail?r=2b6d7d53842f

Modified:
/gpapers/__init__.py
/gpapers/settings.py

=======================================
--- /gpapers/__init__.py Thu Jun 28 15:59:47 2012
+++ /gpapers/__init__.py Sat Jun 30 06:35:07 2012
@@ -32,6 +32,7 @@
import traceback

from gi.repository import Gio
+from gi.repository import GLib
from gi.repository import GObject
from gi.repository import Gdk
from gi.repository import Gtk
@@ -2931,6 +2932,18 @@
Gtk.init(argv)
MEDIA_ROOT = gpapers.settings.MEDIA_ROOT

+ # check for a directory from a previous version and move it to the new
place
+ if not os.path.exists(MEDIA_ROOT):
+ log_info('Directory %s does not exist.' % MEDIA_ROOT)
+ old_paths = [os.path.join(GLib.get_user_data_dir(), '.gPapers'),
+
os.path.join(os.path.expanduser('~'), '.gPapers-test')]
+ for old_path in old_paths:
+ if os.path.exists(old_path):
+ log_info('Found old data dir "%s", moving to "%s"' %
+ (old_path, MEDIA_ROOT))
+ os.rename(old_path, MEDIA_ROOT)
+ break
+
log_info('using database at %s' % MEDIA_ROOT)

if not os.path.isdir(os.path.join(MEDIA_ROOT, 'papers')):
=======================================
--- /gpapers/settings.py Sat Jun 9 15:37:09 2012
+++ /gpapers/settings.py Sat Jun 30 06:35:07 2012
@@ -4,7 +4,7 @@
from gi.repository import GLib

# use user data dir according to XDG specification
-DATA_DIR = os.path.join(GLib.get_user_data_dir(), '.gPapers')
+DATA_DIR = os.path.join(GLib.get_user_data_dir(), 'gPapers')

DEBUG = True
TEMPLATE_DEBUG = DEBUG

==============================================================================
Revision: 3b26395df4cb
Author: Marcel Stimberg <marcel...@gmail.com>
Date: Sat Jun 30 06:47:19 2012
Log: set some more default attributes
http://code.google.com/p/gpapers/source/detail?r=3b26395df4cb

Modified:
/gpapers/gPapers/models.py

=======================================
--- /gpapers/gPapers/models.py Tue Jun 26 09:22:12 2012
+++ /gpapers/gPapers/models.py Sat Jun 30 06:47:19 2012
@@ -282,6 +282,7 @@

def __init__(self):
self.name = None
+ self.issue = None
self.publication_date = VirtualSource.SimpleDate()


@@ -308,6 +309,7 @@
self.provider = provider # The origin of this search result
self.authors = []
self.source = VirtualSource()
+ self.source_pages = None
self.full_text = None
self.abstract = None
self.title = None

==============================================================================
Revision: 55e69b472e83
Author: Marcel Stimberg <marcel...@gmail.com>
Date: Sat Jun 30 16:22:09 2012
Log: fix two issues when saving searches
http://code.google.com/p/gpapers/source/detail?r=55e69b472e83

Modified:
/gpapers/__init__.py

=======================================
--- /gpapers/__init__.py Sat Jun 30 06:35:07 2012
+++ /gpapers/__init__.py Sat Jun 30 16:22:09 2012
@@ -676,7 +676,10 @@

search_text=self.ui.get_object('middle_pane_search').get_text(),
parent=self.search_providers[liststore[row][4]].label
)
- if created: playlist.save()
+ if created:
+ playlist.save()
+ log_debug('Saved smart search "%s" for provider "%s"' %
(playlist.search_text,
+
playlist.parent))
self.refresh_left_pane()

def create_playlist(self, ids=None):
@@ -747,8 +750,9 @@
column.pack_start(renderer, True)
column.add_attribute(renderer, 'markup', 0)
column.add_attribute(renderer, 'editable', 3)
-
- self.ui.get_object('left_pane_selection').connect('changed',
self.select_left_pane_item)
+ left_pane_selection = self.ui.get_object('left_pane_selection')
+ self.left_pane_selection_handler_id =
left_pane_selection.connect('changed',
+
self.select_left_pane_item)
left_pane.connect('button-press-event',
self.handle_left_pane_button_press_event)


left_pane.enable_model_drag_dest([LEFT_PANE_ADD_TO_PLAYLIST_DND_ACTION],
Gdk.DragAction.COPY)
@@ -1029,6 +1033,10 @@

self.select_left_pane_item(self.ui.get_object('left_pane_selection'))

def refresh_left_pane(self):
+ log_debug('Refreshing left pane...')
+ # avoid searches while rebuilding the pane
+
self.ui.get_object('left_pane_selection').handler_block(self.left_pane_selection_handler_id)
+
# FIXME: These should not be loaded again and again
NEVER_READ_ICON =
GdkPixbuf.Pixbuf.new_from_file(os.path.join(BASE_DIR,
'icons',
@@ -1072,19 +1080,22 @@
icon_fname = os.path.join(BASE_DIR, 'icons', provider.icon)
provider_icon =
GdkPixbuf.Pixbuf.new_from_file_at_size(icon_fname,
16, 16)
#FIXME
- self.left_pane_model.append(None, (provider.name,
- provider_icon, -1, False, provider.label))
+ treeiter = self.left_pane_model.append(None, (provider.name,
+ provider_icon,
-1,
+ False,
+ provider.label))
for playlist in Playlist.objects.filter(parent=provider.label):
- print 'paylist item', playlist
icon = left_pane.render_icon(Gtk.STOCK_FIND,
Gtk.IconSize.MENU)
-
self.left_pane_model.append(self.left_pane_model.get_iter((1),),
+ self.left_pane_model.append(treeiter,
(playlist.title, icon,
playlist.id,
True, provider.label))

left_pane.expand_all()
+ log_debug('...Refreshing left pane done.')
+
self.ui.get_object('left_pane_selection').handler_unblock(self.left_pane_selection_handler_id)
self.ui.get_object('left_pane_selection').select_path((0,))

- def select_left_pane_item(self, selection):
+ def select_left_pane_item(self, selection):
liststore, row = selection.get_selected()
left_pane_toolbar = self.ui.get_object('left_pane_toolbar')
for child in left_pane_toolbar.get_children():
Reply all
Reply to author
Forward
0 new messages