Status: | Needs review |
---|---|
Proposed branch: | lp:~tomek3d/calibre/store |
Merge into: | lp:calibre |
Diff against target: |
158 lines (+8/-91) 3 files modified
src/calibre/customize/builtins.py (+0/-12) src/calibre/gui2/store/stores/escapemagazine_plugin.py (+0/-71) src/calibre/gui2/store/web_store_dialog.py (+8/-8) |
To merge this branch: | bzr merge lp:~tomek3d/calibre/store |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kovid Goyal | Pending | ||
Review via email: mp+166951@code.launchpad.net |
Commit message
Description of the change
- 8584. By Tomasz Długosz
-
forgotten line...
Tomasz Długosz (tomek3d) wrote : | # |
Thanks, I just didn't notice you already did the switch.
Did you consider making recipes a subtree?
https:/
I did a quick check. In my fork of the calibre repo I've added a subtree
"recipes" (the recipes directory was removed just before that step) that
follows the repo kalibrator that used to be used for deveoping polish
recipes. This allows people to add their recipes only by cloning a small
part of the original calibre repo, while a clone of full calibre repo still
incorporates the recipes directory (that means this is transparent for
people not tinkering in recipes directory).
Should you use this idea, you probably should make a split in calibre repo
(git subtree split -P ), and not add my repo as an alien subtree :D . I did
my check to see whether I can preserve my repo's history during the
transition to subtree (still trying to find a way to adopt the kalibrator
to calibre being hosted on github :D ).
Regards,
Tomasz
On 2 June 2013 03:53, Kovid Goyal <email address hidden> wrote:
> calibre development has moved to GitHub, see
> http://
>
> I have merged this patch into master on GitHub.
> --
> https:/
> You are the owner of lp:~tomek3d/calibre/store.
>
Kovid Goyal (kovid) wrote : | # |
I'd rather not do that. It adds an extra thing to remember both for me
and for other people, as sometimes there are commits that affect both
the recipes/ directory and files outside it as well. For instance this
commonly happens when I run python setup.py check on the whole tree
before making a release.
Regarding kalibrator, what is the problem exactly? If the issue is that
some recipes are ignored in the global .gitignore I can always move
those ignores into .git/info/exclude.
Kovid.
On Sun, Jun 02, 2013 at 07:01:24PM -0000, Tomasz Długosz wrote:
> Thanks, I just didn't notice you already did the switch.
>
> Did you consider making recipes a subtree?
> https:/
>
> I did a quick check. In my fork of the calibre repo I've added a subtree
> "recipes" (the recipes directory was removed just before that step) that
> follows the repo kalibrator that used to be used for deveoping polish
> recipes. This allows people to add their recipes only by cloning a small
> part of the original calibre repo, while a clone of full calibre repo still
> incorporates the recipes directory (that means this is transparent for
> people not tinkering in recipes directory).
>
> Should you use this idea, you probably should make a split in calibre repo
> (git subtree split -P ), and not add my repo as an alien subtree :D . I did
> my check to see whether I can preserve my repo's history during the
> transition to subtree (still trying to find a way to adopt the kalibrator
> to calibre being hosted on github :D ).
>
> Regards,
> Tomasz
>
>
> On 2 June 2013 03:53, Kovid Goyal <email address hidden> wrote:
>
> > calibre development has moved to GitHub, see
> > http://
> >
> > I have merged this patch into master on GitHub.
> > --
> > https:/
> > You are the owner of lp:~tomek3d/calibre/store.
> >
>
> --
> https:/
> You are requested to review the proposed merge of lp:~tomek3d/calibre/store into lp:calibre.
>
> !DSPAM:
>
>
--
_______
Dr. Kovid Goyal
http://
http://
_______
Tomasz Długosz (tomek3d) wrote : | # |
On Jun 3, 2013 3:52 AM, "Kovid Goyal" <email address hidden> wrote:
>
> I'd rather not do that. It adds an extra thing to remember both for me
> and for other people, as sometimes there are commits that affect both
> the recipes/ directory and files outside it as well. For instance this
> commonly happens when I run python setup.py check on the whole tree
> before making a release.
I see.
>
> Regarding kalibrator, what is the problem exactly? If the issue is that
> some recipes are ignored in the global .gitignore I can always move
> those ignores into .git/info/exclude.
No, it's not a matter of ignored files (I can have them in another branch),
but rather a question of whether it is possible to have both
1. History (and if possible simple layout) of kalibrator preserved
2. Ability to request merges directly to your calibre branch.
The second point seems more important to me.
Probably the ultimate solution will be to make kalibrator repo obsolete,
and just work from a normal calibre fork, but I'm still not sure.
>
> Kovid.
>
> On Sun, Jun 02, 2013 at 07:01:24PM -0000, Tomasz Długosz wrote:
> > Thanks, I just didn't notice you already did the switch.
> >
> > Did you consider making recipes a subtree?
> > https:/
> >
> > I did a quick check. In my fork of the calibre repo I've added a subtree
> > "recipes" (the recipes directory was removed just before that step) that
> > follows the repo kalibrator that used to be used for deveoping polish
> > recipes. This allows people to add their recipes only by cloning a small
> > part of the original calibre repo, while a clone of full calibre repo
still
> > incorporates the recipes directory (that means this is transparent for
> > people not tinkering in recipes directory).
> >
> > Should you use this idea, you probably should make a split in calibre
repo
> > (git subtree split -P ), and not add my repo as an alien subtree :D . I
did
> > my check to see whether I can preserve my repo's history during the
> > transition to subtree (still trying to find a way to adopt the
kalibrator
> > to calibre being hosted on github :D ).
> >
> > Regards,
> > Tomasz
> >
> >
> > On 2 June 2013 03:53, Kovid Goyal <email address hidden> wrote:
> >
> > > calibre development has moved to GitHub, see
> > > http://
> > >
> > > I have merged this patch into master on GitHub.
> > > --
> > > https:/
> > > You are the owner of lp:~tomek3d/calibre/store.
> > >
> >
> > --
> > https:/
> > You are requested to review the proposed merge of
lp:~tomek3d/calibre/store into lp:calibre.
> >
> > !DSPAM:
> >
> >
>
> --
> _______
>
> Dr. Kovid Goyal
> http://
> http://
> _______
>
> https:/
> You are the owner of lp:~tomek3d/calibre/store.
Kovid Goyal (kovid) wrote : | # |
Another alternative is to continue using kalibrator and write a simple
script that updates your calibre fork from kalibrator and submits a pull
request. Something like:
copy-updates::
#!/bin/sh
cp kalibrator/*.recipe calibre/recipes/
cd calibre
git commit -am $1
git push
git pull-request (you need to install hub for this)
So now when you want to send me updates, you just do:
copy-updates
Otherwise, I suggest just go with a calibre fork, that's the most maintainable
solution going forward. Previous history, if it is really needed, can
remain available in the kalibrator repo.
Kovid.
On Mon, Jun 03, 2013 at 06:43:24AM -0000, Tomasz Długosz wrote:
> On Jun 3, 2013 3:52 AM, "Kovid Goyal" <email address hidden> wrote:
> >
> > I'd rather not do that. It adds an extra thing to remember both for me
> > and for other people, as sometimes there are commits that affect both
> > the recipes/ directory and files outside it as well. For instance this
> > commonly happens when I run python setup.py check on the whole tree
> > before making a release.
>
> I see.
>
> >
> > Regarding kalibrator, what is the problem exactly? If the issue is that
> > some recipes are ignored in the global .gitignore I can always move
> > those ignores into .git/info/exclude.
>
> No, it's not a matter of ignored files (I can have them in another branch),
> but rather a question of whether it is possible to have both
> 1. History (and if possible simple layout) of kalibrator preserved
> 2. Ability to request merges directly to your calibre branch.
>
> The second point seems more important to me.
>
> Probably the ultimate solution will be to make kalibrator repo obsolete,
> and just work from a normal calibre fork, but I'm still not sure.
>
> >
> > Kovid.
> >
> > On Sun, Jun 02, 2013 at 07:01:24PM -0000, Tomasz Długosz wrote:
> > > Thanks, I just didn't notice you already did the switch.
> > >
> > > Did you consider making recipes a subtree?
> > > https:/
> > >
> > > I did a quick check. In my fork of the calibre repo I've added a subtree
> > > "recipes" (the recipes directory was removed just before that step) that
> > > follows the repo kalibrator that used to be used for deveoping polish
> > > recipes. This allows people to add their recipes only by cloning a small
> > > part of the original calibre repo, while a clone of full calibre repo
> still
> > > incorporates the recipes directory (that means this is transparent for
> > > people not tinkering in recipes directory).
> > >
> > > Should you use this idea, you probably should make a split in calibre
> repo
> > > (git subtree split -P ), and not add my repo as an alien subtree :D . I
> did
> > > my check to see whether I can preserve my repo's history during the
> > > transition to subtree (still trying to find a way to adopt the
> kalibrator
> > > to calibre being hosted on github :D ).
> > >
> > > Regards,
> > > Tomasz
> > >
> > >
> > > On 2 June 2013 03:53, Kovid Goyal <email address hidden> wrote:
> > >
> > > > calibre development has moved to GitHub, see
> > > > http://
> > > >
> > > > I have merged ...
Unmerged revisions
- 8584. By Tomasz Długosz
-
forgotten line...
- 8583. By Tomasz Długosz
-
remove EscapeMagazine plugin
- 8582. By Tomasz Długosz
-
remove trailing whitespaces
Preview Diff
1 | === modified file 'src/calibre/customize/builtins.py' |
2 | --- src/calibre/customize/builtins.py 2013-05-27 10:12:08 +0000 |
3 | +++ src/calibre/customize/builtins.py 2013-06-01 20:00:36 +0000 |
4 | @@ -1419,17 +1419,6 @@ |
5 | headquarters = 'PL' |
6 | formats = ['EPUB', 'MOBI', 'PDF'] |
7 | |
8 | -class StoreEscapeMagazineStore(StoreBase): |
9 | - name = 'EscapeMagazine' |
10 | - author = u'Tomasz Długosz' |
11 | - description = u'Książki elektroniczne w formie pliku komputerowego PDF. Zabezpieczone hasłem.' |
12 | - actual_plugin = 'calibre.gui2.store.stores.escapemagazine_plugin:EscapeMagazineStore' |
13 | - |
14 | - drm_free_only = True |
15 | - headquarters = 'PL' |
16 | - formats = ['PDF'] |
17 | - affiliate = True |
18 | - |
19 | class StoreFeedbooksStore(StoreBase): |
20 | name = 'Feedbooks' |
21 | description = u'Feedbooks is a cloud publishing and distribution service, connected to a large ecosystem of reading systems and social networks. Provides a variety of genres from independent and classic books.' # noqa |
22 | @@ -1700,7 +1689,6 @@ |
23 | StoreEHarlequinStore, |
24 | StoreEKnigiStore, |
25 | StoreEmpikStore, |
26 | - StoreEscapeMagazineStore, |
27 | StoreFeedbooksStore, |
28 | StoreFoylesUKStore, |
29 | StoreGoogleBooksStore, |
30 | |
31 | === removed file 'src/calibre/gui2/store/stores/escapemagazine_plugin.py' |
32 | --- src/calibre/gui2/store/stores/escapemagazine_plugin.py 2013-01-14 06:20:23 +0000 |
33 | +++ src/calibre/gui2/store/stores/escapemagazine_plugin.py 1970-01-01 00:00:00 +0000 |
34 | @@ -1,71 +0,0 @@ |
35 | -# -*- coding: utf-8 -*- |
36 | - |
37 | -from __future__ import (unicode_literals, division, absolute_import, print_function) |
38 | -store_version = 1 # Needed for dynamic plugin loading |
39 | - |
40 | -__license__ = 'GPL 3' |
41 | -__copyright__ = '2011, Tomasz Długosz <tomek3d@gmail.com>' |
42 | -__docformat__ = 'restructuredtext en' |
43 | - |
44 | -import urllib |
45 | -from contextlib import closing |
46 | - |
47 | -from lxml import html |
48 | - |
49 | -from PyQt4.Qt import QUrl |
50 | - |
51 | -from calibre import browser, url_slash_cleaner |
52 | -from calibre.gui2 import open_url |
53 | -from calibre.gui2.store import StorePlugin |
54 | -from calibre.gui2.store.basic_config import BasicStoreConfig |
55 | -from calibre.gui2.store.search_result import SearchResult |
56 | -from calibre.gui2.store.web_store_dialog import WebStoreDialog |
57 | - |
58 | -class EscapeMagazineStore(BasicStoreConfig, StorePlugin): |
59 | - |
60 | - def open(self, parent=None, detail_item=None, external=False): |
61 | - pid = '44010' |
62 | - |
63 | - url = 'http://www.escapemagazine.pl/s/' + pid |
64 | - |
65 | - if external or self.config.get('open_external', False): |
66 | - open_url(QUrl(url_slash_cleaner(detail_item + '/s/' + pid if detail_item else url))) |
67 | - else: |
68 | - d = WebStoreDialog(self.gui, url, parent, detail_item) |
69 | - d.setWindowTitle(self.name) |
70 | - d.set_tags(self.config.get('tags', '')) |
71 | - d.exec_() |
72 | - |
73 | - def search(self, query, max_results=20, timeout=60): |
74 | - url = 'http://www.escapemagazine.pl/wyszukiwarka?query=' + urllib.quote_plus(query) |
75 | - |
76 | - br = browser() |
77 | - |
78 | - counter = max_results |
79 | - with closing(br.open(url, timeout=timeout)) as f: |
80 | - doc = html.fromstring(f.read()) |
81 | - for data in doc.xpath('//div[@class="item item_short"]'): |
82 | - if counter <= 0: |
83 | - break |
84 | - |
85 | - id = ''.join(data.xpath('.//h2[@class="title"]/a[1]/@href')) |
86 | - if not id: |
87 | - continue |
88 | - |
89 | - title = ''.join(data.xpath('.//h2[@class="title"]/a[1]/text()')) |
90 | - author = ''.join(data.xpath('.//div[@class="author"]/text()')) |
91 | - price = ''.join(data.xpath('.//span[@class="price_now"]/strong/text()')) + ' zł' |
92 | - cover_url = ''.join(data.xpath('.//img[@class="cover"]/@src')) |
93 | - |
94 | - counter -= 1 |
95 | - |
96 | - s = SearchResult() |
97 | - s.cover_url = cover_url |
98 | - s.title = title.strip() |
99 | - s.author = author.strip() |
100 | - s.price = price |
101 | - s.detail_item = 'http://www.escapemagazine.pl' + id.strip() |
102 | - s.drm = SearchResult.DRM_UNLOCKED |
103 | - s.formats = 'PDF' |
104 | - |
105 | - yield s |
106 | |
107 | === modified file 'src/calibre/gui2/store/web_store_dialog.py' |
108 | --- src/calibre/gui2/store/web_store_dialog.py 2011-03-07 12:35:21 +0000 |
109 | +++ src/calibre/gui2/store/web_store_dialog.py 2013-06-01 20:00:36 +0000 |
110 | @@ -16,10 +16,10 @@ |
111 | def __init__(self, gui, base_url, parent=None, detail_url=None): |
112 | QDialog.__init__(self, parent=parent) |
113 | self.setupUi(self) |
114 | - |
115 | + |
116 | self.gui = gui |
117 | self.base_url = base_url |
118 | - |
119 | + |
120 | self.view.set_gui(self.gui) |
121 | self.view.loadStarted.connect(self.load_started) |
122 | self.view.loadProgress.connect(self.load_progress) |
123 | @@ -27,7 +27,7 @@ |
124 | self.home.clicked.connect(self.go_home) |
125 | self.reload.clicked.connect(self.view.reload) |
126 | self.back.clicked.connect(self.view.back) |
127 | - |
128 | + |
129 | self.go_home(detail_url=detail_url) |
130 | |
131 | def set_tags(self, tags): |
132 | @@ -35,21 +35,21 @@ |
133 | |
134 | def load_started(self): |
135 | self.progress.setValue(0) |
136 | - |
137 | + |
138 | def load_progress(self, val): |
139 | self.progress.setValue(val) |
140 | - |
141 | + |
142 | def load_finished(self, ok=True): |
143 | self.progress.setValue(100) |
144 | - |
145 | + |
146 | def go_home(self, checked=False, detail_url=None): |
147 | if detail_url: |
148 | url = detail_url |
149 | else: |
150 | url = self.base_url |
151 | - |
152 | + |
153 | # Reduce redundant /'s because some stores |
154 | # (Feedbooks) and server frameworks (cherrypy) |
155 | - # choke on them. |
156 | + # choke on them. |
157 | url = url_slash_cleaner(url) |
158 | self.view.load(QUrl(url)) |
calibre development has moved to GitHub, see http:// www.mobileread. com/forums/ showthread. php?t=214465
I have merged this patch into master on GitHub.