alexandria-book-collection-manager 0.7.2 → 0.7.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +9 -0
  3. data/.github/workflows/ruby.yml +77 -0
  4. data/.gitignore +5 -1
  5. data/.hound.yml +2 -0
  6. data/.rubocop.yml +87 -37
  7. data/.rubocop_todo.yml +62 -191
  8. data/.simplecov +5 -2
  9. data/CHANGELOG.md +63 -0
  10. data/Gemfile +4 -3
  11. data/INSTALL.md +26 -14
  12. data/README.md +52 -42
  13. data/Rakefile +93 -109
  14. data/TODO.md +9 -1
  15. data/alexandria-book-collection-manager.gemspec +50 -43
  16. data/bin/alexandria +30 -53
  17. data/doc/FAQ +2 -6
  18. data/doc/dependency_decisions.yml +27 -8
  19. data/lib/alexandria.rb +27 -37
  20. data/lib/alexandria/about.rb +50 -50
  21. data/lib/alexandria/book_providers.rb +90 -97
  22. data/lib/alexandria/book_providers/adlibris.rb +41 -76
  23. data/lib/alexandria/book_providers/amazon_aws.rb +96 -100
  24. data/lib/alexandria/book_providers/amazon_ecs_util.rb +295 -322
  25. data/lib/alexandria/book_providers/barnes_and_noble.rb +48 -45
  26. data/lib/alexandria/book_providers/douban.rb +26 -42
  27. data/lib/alexandria/book_providers/proxis.rb +44 -55
  28. data/lib/alexandria/book_providers/pseudomarc.rb +77 -85
  29. data/lib/alexandria/book_providers/siciliano.rb +64 -65
  30. data/lib/alexandria/book_providers/thalia.rb +42 -41
  31. data/lib/alexandria/book_providers/web.rb +15 -33
  32. data/lib/alexandria/book_providers/worldcat.rb +70 -97
  33. data/lib/alexandria/book_providers/z3950.rb +160 -173
  34. data/lib/alexandria/config.rb +1 -1
  35. data/lib/alexandria/console.rb +8 -21
  36. data/lib/alexandria/default_preferences.rb +37 -0
  37. data/lib/alexandria/execution_queue.rb +15 -13
  38. data/lib/alexandria/export_format.rb +47 -0
  39. data/lib/alexandria/export_library.rb +193 -300
  40. data/lib/alexandria/import_library.rb +108 -141
  41. data/lib/alexandria/import_library_csv.rb +43 -46
  42. data/lib/alexandria/library_collection.rb +79 -0
  43. data/lib/alexandria/library_sort_order.rb +45 -0
  44. data/lib/alexandria/library_store.rb +233 -0
  45. data/lib/alexandria/logging.rb +11 -13
  46. data/lib/alexandria/models/book.rb +13 -20
  47. data/lib/alexandria/models/library.rb +81 -353
  48. data/lib/alexandria/net.rb +5 -6
  49. data/lib/alexandria/preferences.rb +73 -87
  50. data/lib/alexandria/scanners.rb +2 -2
  51. data/lib/alexandria/scanners/{cuecat.rb → cue_cat.rb} +20 -18
  52. data/lib/alexandria/scanners/keyboard.rb +8 -8
  53. data/lib/alexandria/smart_library.rb +133 -170
  54. data/lib/alexandria/ui.rb +15 -15
  55. data/lib/alexandria/ui/about_dialog.rb +49 -0
  56. data/lib/alexandria/ui/{dialogs/acquire_dialog.rb → acquire_dialog.rb} +119 -136
  57. data/lib/alexandria/ui/alert_dialog.rb +64 -0
  58. data/lib/alexandria/ui/bad_isbns_dialog.rb +41 -0
  59. data/lib/alexandria/ui/{dialogs/barcode_animation.rb → barcode_animation.rb} +16 -15
  60. data/lib/alexandria/ui/{dialogs/book_properties_dialog.rb → book_properties_dialog.rb} +39 -52
  61. data/lib/alexandria/ui/book_properties_dialog_base.rb +318 -0
  62. data/lib/alexandria/ui/builder_base.rb +7 -27
  63. data/lib/alexandria/ui/calendar_popup.rb +58 -0
  64. data/lib/alexandria/ui/callbacks.rb +189 -183
  65. data/lib/alexandria/ui/completion_models.rb +10 -23
  66. data/lib/alexandria/ui/confirm_erase_dialog.rb +33 -0
  67. data/lib/alexandria/ui/conflict_while_copying_dialog.rb +34 -0
  68. data/lib/alexandria/ui/dndable.rb +7 -7
  69. data/lib/alexandria/ui/error_dialog.rb +25 -0
  70. data/lib/alexandria/ui/export_dialog.rb +142 -0
  71. data/lib/alexandria/ui/icons.rb +47 -63
  72. data/lib/alexandria/ui/iconview.rb +12 -10
  73. data/lib/alexandria/ui/iconview_tooltips.rb +41 -54
  74. data/lib/alexandria/ui/import_dialog.rb +157 -0
  75. data/lib/alexandria/ui/init.rb +21 -33
  76. data/lib/alexandria/ui/keep_bad_isbn_dialog.rb +36 -0
  77. data/lib/alexandria/ui/libraries_combo.rb +16 -14
  78. data/lib/alexandria/ui/listview.rb +73 -87
  79. data/lib/alexandria/ui/main_app.rb +24 -26
  80. data/lib/alexandria/ui/misc_dialogs.rb +10 -0
  81. data/lib/alexandria/ui/multi_drag_treeview.rb +28 -41
  82. data/lib/alexandria/ui/{dialogs/new_book_dialog.rb → new_book_dialog.rb} +156 -194
  83. data/lib/alexandria/ui/new_book_dialog_manual.rb +139 -0
  84. data/lib/alexandria/ui/new_provider_dialog.rb +100 -0
  85. data/lib/alexandria/ui/new_smart_library_dialog.rb +74 -0
  86. data/lib/alexandria/ui/preferences_dialog.rb +313 -0
  87. data/lib/alexandria/ui/provider_preferences_base_dialog.rb +95 -0
  88. data/lib/alexandria/ui/provider_preferences_dialog.rb +35 -0
  89. data/lib/alexandria/ui/really_delete_dialog.rb +53 -0
  90. data/lib/alexandria/ui/{sidepane.rb → sidepane_manager.rb} +56 -68
  91. data/lib/alexandria/ui/skip_entry_dialog.rb +33 -0
  92. data/lib/alexandria/ui/smart_library_properties_dialog.rb +60 -0
  93. data/lib/alexandria/ui/smart_library_properties_dialog_base.rb +242 -0
  94. data/lib/alexandria/ui/smart_library_rule_box.rb +119 -0
  95. data/lib/alexandria/ui/sound.rb +11 -13
  96. data/lib/alexandria/ui/ui_manager.rb +236 -251
  97. data/lib/alexandria/undo_manager.rb +1 -0
  98. data/lib/alexandria/version.rb +4 -19
  99. data/lib/alexandria/web_themes.rb +22 -21
  100. data/po/Makefile +2 -2
  101. data/po/cs.po +993 -880
  102. data/po/cy.po +957 -874
  103. data/po/de.po +990 -869
  104. data/po/el.po +989 -869
  105. data/po/es.po +985 -865
  106. data/po/fr.po +986 -870
  107. data/po/ga.po +907 -823
  108. data/po/gl.po +981 -865
  109. data/po/it.po +986 -868
  110. data/po/ja.po +969 -853
  111. data/po/mk.po +983 -863
  112. data/po/nb.po +979 -863
  113. data/po/nl.po +983 -864
  114. data/po/pl.po +1017 -974
  115. data/po/pt.po +988 -861
  116. data/po/pt_BR.po +984 -868
  117. data/po/ru.po +992 -873
  118. data/po/sk.po +987 -869
  119. data/po/sv.po +977 -861
  120. data/po/uk.po +975 -865
  121. data/po/zh_TW.po +976 -860
  122. data/schemas/alexandria.schemas +25 -3
  123. data/share/alexandria/glade/acquire_dialog__builder.glade +15 -12
  124. data/share/alexandria/glade/book_properties_dialog__builder.glade +171 -299
  125. data/share/alexandria/glade/main_app__builder.glade +24 -33
  126. data/share/alexandria/glade/new_book_dialog__builder.glade +27 -59
  127. data/share/alexandria/glade/preferences_dialog__builder.glade +250 -290
  128. data/share/gnome/help/alexandria/C/introduction.xml +0 -8
  129. data/share/gnome/help/alexandria/C/searching.xml +1 -1
  130. data/share/gnome/help/alexandria/C/smart-libraries.xml +2 -2
  131. data/share/gnome/help/alexandria/C/working-with-libraries.xml +1 -1
  132. data/share/gnome/help/alexandria/fr/alexandria.xml +1 -1
  133. data/share/gnome/help/alexandria/ja/introduction.xml +0 -8
  134. data/share/gnome/help/alexandria/ja/smart-libraries.xml +1 -1
  135. data/spec/alexandria/book_providers/world_cat_provider_spec.rb +160 -0
  136. data/spec/alexandria/book_providers_spec.rb +75 -171
  137. data/spec/alexandria/book_spec.rb +12 -10
  138. data/spec/alexandria/console_spec.rb +27 -0
  139. data/spec/alexandria/export_library_spec.rb +130 -0
  140. data/spec/alexandria/library_spec.rb +128 -172
  141. data/spec/alexandria/library_store_spec.rb +37 -0
  142. data/spec/alexandria/preferences_spec.rb +44 -17
  143. data/spec/alexandria/scanners/cue_cat_spec.rb +52 -0
  144. data/spec/alexandria/smart_library_spec.rb +30 -25
  145. data/spec/alexandria/ui/about_dialog_spec.rb +14 -0
  146. data/spec/alexandria/ui/acquire_dialog_spec.rb +14 -0
  147. data/spec/alexandria/ui/alert_dialog_spec.rb +16 -0
  148. data/spec/alexandria/ui/bad_isbns_dialog_spec.rb +14 -0
  149. data/spec/alexandria/ui/book_properties_dialog_spec.rb +17 -0
  150. data/spec/alexandria/ui/confirm_erase_dialog_spec.rb +14 -0
  151. data/spec/alexandria/ui/conflict_while_copying_dialog_spec.rb +16 -0
  152. data/spec/alexandria/ui/error_dialog_spec.rb +14 -0
  153. data/spec/alexandria/ui/export_dialog_spec.rb +36 -0
  154. data/spec/alexandria/ui/icons_spec.rb +26 -0
  155. data/spec/alexandria/ui/iconview_spec.rb +7 -21
  156. data/spec/alexandria/ui/import_dialog_spec.rb +46 -0
  157. data/spec/alexandria/ui/keep_bad_isbn_dialog_spec.rb +17 -0
  158. data/spec/alexandria/ui/main_app_spec.rb +7 -34
  159. data/spec/alexandria/ui/new_book_dialog_manual_spec.rb +15 -0
  160. data/spec/alexandria/ui/new_book_dialog_spec.rb +22 -0
  161. data/spec/alexandria/ui/new_provider_dialog_spec.rb +30 -0
  162. data/spec/alexandria/ui/new_smart_library_dialog_spec.rb +39 -0
  163. data/spec/alexandria/ui/preferences_dialog_spec.rb +14 -0
  164. data/spec/alexandria/ui/provider_preferences_dialog_spec.rb +34 -0
  165. data/spec/alexandria/ui/really_delete_dialog_spec.rb +16 -0
  166. data/spec/alexandria/ui/sidepane_manager_spec.rb +15 -0
  167. data/spec/alexandria/ui/skip_entry_dialog_spec.rb +14 -0
  168. data/spec/alexandria/ui/smart_library_properties_dialog_spec.rb +49 -0
  169. data/spec/alexandria/ui/sound_spec.rb +2 -2
  170. data/spec/alexandria/ui/ui_manager_spec.rb +43 -20
  171. data/spec/end_to_end/basic_run_spec.rb +52 -0
  172. data/spec/spec_helper.rb +65 -33
  173. data/tasks/setup.rb +2 -2
  174. data/tasks/spec.rake +16 -3
  175. data/util/rake/fileinstall.rb +39 -35
  176. data/util/rake/gettextgenerate.rb +7 -7
  177. data/util/rake/omfgenerate.rb +7 -7
  178. metadata +178 -45
  179. data/dogtail/basic_run_test.py +0 -9
  180. data/lib/alexandria/book_providers/deastore.rb +0 -265
  181. data/lib/alexandria/book_providers/mcu.rb +0 -182
  182. data/lib/alexandria/book_providers/renaud.rb +0 -149
  183. data/lib/alexandria/ui/dialogs/about_dialog.rb +0 -61
  184. data/lib/alexandria/ui/dialogs/alert_dialog.rb +0 -72
  185. data/lib/alexandria/ui/dialogs/bad_isbns_dialog.rb +0 -51
  186. data/lib/alexandria/ui/dialogs/book_properties_dialog_base.rb +0 -426
  187. data/lib/alexandria/ui/dialogs/export_dialog.rb +0 -171
  188. data/lib/alexandria/ui/dialogs/import_dialog.rb +0 -196
  189. data/lib/alexandria/ui/dialogs/misc_dialogs.rb +0 -87
  190. data/lib/alexandria/ui/dialogs/new_book_dialog_manual.rb +0 -154
  191. data/lib/alexandria/ui/dialogs/new_smart_library_dialog.rb +0 -74
  192. data/lib/alexandria/ui/dialogs/preferences_dialog.rb +0 -568
  193. data/lib/alexandria/ui/dialogs/smart_library_properties_dialog.rb +0 -59
  194. data/lib/alexandria/ui/dialogs/smart_library_properties_dialog_base.rb +0 -420
  195. data/spec/alexandria/scanners/cuecat_spec.rb +0 -67
  196. data/spec/alexandria/ui/dialogs_spec.rb +0 -96
  197. data/spec/alexandria/ui/sidepane_spec.rb +0 -29
  198. data/spec/alexandria/ui/ui_utilities_spec.rb +0 -62
  199. data/spec/alexandria/utilities_spec.rb +0 -52
  200. data/tasks/dogtail.rake +0 -6
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alexandria-book-collection-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander McCormmach
@@ -28,7 +28,7 @@ authors:
28
28
  autorequire:
29
29
  bindir: bin
30
30
  cert_chain: []
31
- date: 2018-03-18 00:00:00.000000000 Z
31
+ date: 2020-11-15 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: gettext
@@ -48,30 +48,30 @@ dependencies:
48
48
  name: gstreamer
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - '='
51
+ - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 3.2.1
53
+ version: 3.4.3
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - '='
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 3.2.1
60
+ version: 3.4.3
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: gtk3
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - '='
65
+ - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: 3.2.1
67
+ version: 3.4.3
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - '='
72
+ - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: 3.2.1
74
+ version: 3.4.3
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: hpricot
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -106,14 +106,14 @@ dependencies:
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: 1.5.0
109
+ version: '2.0'
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: 1.5.0
116
+ version: '2.0'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: marc
119
119
  requirement: !ruby/object:Gem::Requirement
@@ -128,6 +128,20 @@ dependencies:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
130
  version: 1.0.0
131
+ - !ruby/object:Gem::Dependency
132
+ name: psych
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: 3.2.0
138
+ type: :runtime
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: 3.2.0
131
145
  - !ruby/object:Gem::Dependency
132
146
  name: zoom
133
147
  requirement: !ruby/object:Gem::Requirement
@@ -142,6 +156,20 @@ dependencies:
142
156
  - - "~>"
143
157
  - !ruby/object:Gem::Version
144
158
  version: 0.5.0
159
+ - !ruby/object:Gem::Dependency
160
+ name: gnome_app_driver
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - "~>"
164
+ - !ruby/object:Gem::Version
165
+ version: 0.2.1
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - "~>"
171
+ - !ruby/object:Gem::Version
172
+ version: 0.2.1
145
173
  - !ruby/object:Gem::Dependency
146
174
  name: minitest
147
175
  requirement: !ruby/object:Gem::Requirement
@@ -162,14 +190,14 @@ dependencies:
162
190
  requirements:
163
191
  - - "~>"
164
192
  - !ruby/object:Gem::Version
165
- version: '12.0'
193
+ version: '13.0'
166
194
  type: :development
167
195
  prerelease: false
168
196
  version_requirements: !ruby/object:Gem::Requirement
169
197
  requirements:
170
198
  - - "~>"
171
199
  - !ruby/object:Gem::Version
172
- version: '12.0'
200
+ version: '13.0'
173
201
  - !ruby/object:Gem::Dependency
174
202
  name: rspec
175
203
  requirement: !ruby/object:Gem::Requirement
@@ -184,6 +212,76 @@ dependencies:
184
212
  - - "~>"
185
213
  - !ruby/object:Gem::Version
186
214
  version: '3.0'
215
+ - !ruby/object:Gem::Dependency
216
+ name: rubocop
217
+ requirement: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - "~>"
220
+ - !ruby/object:Gem::Version
221
+ version: 0.93.1
222
+ type: :development
223
+ prerelease: false
224
+ version_requirements: !ruby/object:Gem::Requirement
225
+ requirements:
226
+ - - "~>"
227
+ - !ruby/object:Gem::Version
228
+ version: 0.93.1
229
+ - !ruby/object:Gem::Dependency
230
+ name: rubocop-i18n
231
+ requirement: !ruby/object:Gem::Requirement
232
+ requirements:
233
+ - - "~>"
234
+ - !ruby/object:Gem::Version
235
+ version: 2.0.2
236
+ type: :development
237
+ prerelease: false
238
+ version_requirements: !ruby/object:Gem::Requirement
239
+ requirements:
240
+ - - "~>"
241
+ - !ruby/object:Gem::Version
242
+ version: 2.0.2
243
+ - !ruby/object:Gem::Dependency
244
+ name: rubocop-performance
245
+ requirement: !ruby/object:Gem::Requirement
246
+ requirements:
247
+ - - "~>"
248
+ - !ruby/object:Gem::Version
249
+ version: 1.8.0
250
+ type: :development
251
+ prerelease: false
252
+ version_requirements: !ruby/object:Gem::Requirement
253
+ requirements:
254
+ - - "~>"
255
+ - !ruby/object:Gem::Version
256
+ version: 1.8.0
257
+ - !ruby/object:Gem::Dependency
258
+ name: rubocop-rspec
259
+ requirement: !ruby/object:Gem::Requirement
260
+ requirements:
261
+ - - "~>"
262
+ - !ruby/object:Gem::Version
263
+ version: 1.44.1
264
+ type: :development
265
+ prerelease: false
266
+ version_requirements: !ruby/object:Gem::Requirement
267
+ requirements:
268
+ - - "~>"
269
+ - !ruby/object:Gem::Version
270
+ version: 1.44.1
271
+ - !ruby/object:Gem::Dependency
272
+ name: webmock
273
+ requirement: !ruby/object:Gem::Requirement
274
+ requirements:
275
+ - - "~>"
276
+ - !ruby/object:Gem::Version
277
+ version: '3.9'
278
+ type: :development
279
+ prerelease: false
280
+ version_requirements: !ruby/object:Gem::Requirement
281
+ requirements:
282
+ - - "~>"
283
+ - !ruby/object:Gem::Version
284
+ version: '3.9'
187
285
  description:
188
286
  email:
189
287
  - matijs@matijs.net
@@ -192,7 +290,10 @@ executables:
192
290
  extensions: []
193
291
  extra_rdoc_files: []
194
292
  files:
293
+ - ".github/dependabot.yml"
294
+ - ".github/workflows/ruby.yml"
195
295
  - ".gitignore"
296
+ - ".hound.yml"
196
297
  - ".reek"
197
298
  - ".rubocop.yml"
198
299
  - ".rubocop_todo.yml"
@@ -219,7 +320,6 @@ files:
219
320
  - doc/alexandria.1
220
321
  - doc/cuecat_support.rdoc
221
322
  - doc/dependency_decisions.yml
222
- - dogtail/basic_run_test.py
223
323
  - lib/alexandria.rb
224
324
  - lib/alexandria/about.rb
225
325
  - lib/alexandria/book_providers.rb
@@ -227,12 +327,9 @@ files:
227
327
  - lib/alexandria/book_providers/amazon_aws.rb
228
328
  - lib/alexandria/book_providers/amazon_ecs_util.rb
229
329
  - lib/alexandria/book_providers/barnes_and_noble.rb
230
- - lib/alexandria/book_providers/deastore.rb
231
330
  - lib/alexandria/book_providers/douban.rb
232
- - lib/alexandria/book_providers/mcu.rb
233
331
  - lib/alexandria/book_providers/proxis.rb
234
332
  - lib/alexandria/book_providers/pseudomarc.rb
235
- - lib/alexandria/book_providers/renaud.rb
236
333
  - lib/alexandria/book_providers/siciliano.rb
237
334
  - lib/alexandria/book_providers/thalia.rb
238
335
  - lib/alexandria/book_providers/web.rb
@@ -242,49 +339,64 @@ files:
242
339
  - lib/alexandria/console.rb
243
340
  - lib/alexandria/default_preferences.rb
244
341
  - lib/alexandria/execution_queue.rb
342
+ - lib/alexandria/export_format.rb
245
343
  - lib/alexandria/export_library.rb
246
344
  - lib/alexandria/import_library.rb
247
345
  - lib/alexandria/import_library_csv.rb
346
+ - lib/alexandria/library_collection.rb
347
+ - lib/alexandria/library_sort_order.rb
348
+ - lib/alexandria/library_store.rb
248
349
  - lib/alexandria/logging.rb
249
350
  - lib/alexandria/models/book.rb
250
351
  - lib/alexandria/models/library.rb
251
352
  - lib/alexandria/net.rb
252
353
  - lib/alexandria/preferences.rb
253
354
  - lib/alexandria/scanners.rb
254
- - lib/alexandria/scanners/cuecat.rb
355
+ - lib/alexandria/scanners/cue_cat.rb
255
356
  - lib/alexandria/scanners/keyboard.rb
256
357
  - lib/alexandria/smart_library.rb
257
358
  - lib/alexandria/ui.rb
359
+ - lib/alexandria/ui/about_dialog.rb
360
+ - lib/alexandria/ui/acquire_dialog.rb
361
+ - lib/alexandria/ui/alert_dialog.rb
362
+ - lib/alexandria/ui/bad_isbns_dialog.rb
363
+ - lib/alexandria/ui/barcode_animation.rb
364
+ - lib/alexandria/ui/book_properties_dialog.rb
365
+ - lib/alexandria/ui/book_properties_dialog_base.rb
258
366
  - lib/alexandria/ui/builder_base.rb
367
+ - lib/alexandria/ui/calendar_popup.rb
259
368
  - lib/alexandria/ui/callbacks.rb
260
369
  - lib/alexandria/ui/columns.rb
261
370
  - lib/alexandria/ui/completion_models.rb
262
- - lib/alexandria/ui/dialogs/about_dialog.rb
263
- - lib/alexandria/ui/dialogs/acquire_dialog.rb
264
- - lib/alexandria/ui/dialogs/alert_dialog.rb
265
- - lib/alexandria/ui/dialogs/bad_isbns_dialog.rb
266
- - lib/alexandria/ui/dialogs/barcode_animation.rb
267
- - lib/alexandria/ui/dialogs/book_properties_dialog.rb
268
- - lib/alexandria/ui/dialogs/book_properties_dialog_base.rb
269
- - lib/alexandria/ui/dialogs/export_dialog.rb
270
- - lib/alexandria/ui/dialogs/import_dialog.rb
271
- - lib/alexandria/ui/dialogs/misc_dialogs.rb
272
- - lib/alexandria/ui/dialogs/new_book_dialog.rb
273
- - lib/alexandria/ui/dialogs/new_book_dialog_manual.rb
274
- - lib/alexandria/ui/dialogs/new_smart_library_dialog.rb
275
- - lib/alexandria/ui/dialogs/preferences_dialog.rb
276
- - lib/alexandria/ui/dialogs/smart_library_properties_dialog.rb
277
- - lib/alexandria/ui/dialogs/smart_library_properties_dialog_base.rb
371
+ - lib/alexandria/ui/confirm_erase_dialog.rb
372
+ - lib/alexandria/ui/conflict_while_copying_dialog.rb
278
373
  - lib/alexandria/ui/dndable.rb
374
+ - lib/alexandria/ui/error_dialog.rb
375
+ - lib/alexandria/ui/export_dialog.rb
279
376
  - lib/alexandria/ui/icons.rb
280
377
  - lib/alexandria/ui/iconview.rb
281
378
  - lib/alexandria/ui/iconview_tooltips.rb
379
+ - lib/alexandria/ui/import_dialog.rb
282
380
  - lib/alexandria/ui/init.rb
381
+ - lib/alexandria/ui/keep_bad_isbn_dialog.rb
283
382
  - lib/alexandria/ui/libraries_combo.rb
284
383
  - lib/alexandria/ui/listview.rb
285
384
  - lib/alexandria/ui/main_app.rb
385
+ - lib/alexandria/ui/misc_dialogs.rb
286
386
  - lib/alexandria/ui/multi_drag_treeview.rb
287
- - lib/alexandria/ui/sidepane.rb
387
+ - lib/alexandria/ui/new_book_dialog.rb
388
+ - lib/alexandria/ui/new_book_dialog_manual.rb
389
+ - lib/alexandria/ui/new_provider_dialog.rb
390
+ - lib/alexandria/ui/new_smart_library_dialog.rb
391
+ - lib/alexandria/ui/preferences_dialog.rb
392
+ - lib/alexandria/ui/provider_preferences_base_dialog.rb
393
+ - lib/alexandria/ui/provider_preferences_dialog.rb
394
+ - lib/alexandria/ui/really_delete_dialog.rb
395
+ - lib/alexandria/ui/sidepane_manager.rb
396
+ - lib/alexandria/ui/skip_entry_dialog.rb
397
+ - lib/alexandria/ui/smart_library_properties_dialog.rb
398
+ - lib/alexandria/ui/smart_library_properties_dialog_base.rb
399
+ - lib/alexandria/ui/smart_library_rule_box.rb
288
400
  - lib/alexandria/ui/sound.rb
289
401
  - lib/alexandria/ui/ui_manager.rb
290
402
  - lib/alexandria/undo_manager.rb
@@ -443,20 +555,42 @@ files:
443
555
  - share/sounds/alexandria/good_scan.wav
444
556
  - share/sounds/alexandria/scanning.ogg
445
557
  - share/sounds/alexandria/scanning.wav
558
+ - spec/alexandria/book_providers/world_cat_provider_spec.rb
446
559
  - spec/alexandria/book_providers_spec.rb
447
560
  - spec/alexandria/book_spec.rb
561
+ - spec/alexandria/console_spec.rb
562
+ - spec/alexandria/export_library_spec.rb
448
563
  - spec/alexandria/library_spec.rb
564
+ - spec/alexandria/library_store_spec.rb
449
565
  - spec/alexandria/preferences_spec.rb
450
- - spec/alexandria/scanners/cuecat_spec.rb
566
+ - spec/alexandria/scanners/cue_cat_spec.rb
451
567
  - spec/alexandria/smart_library_spec.rb
452
- - spec/alexandria/ui/dialogs_spec.rb
568
+ - spec/alexandria/ui/about_dialog_spec.rb
569
+ - spec/alexandria/ui/acquire_dialog_spec.rb
570
+ - spec/alexandria/ui/alert_dialog_spec.rb
571
+ - spec/alexandria/ui/bad_isbns_dialog_spec.rb
572
+ - spec/alexandria/ui/book_properties_dialog_spec.rb
573
+ - spec/alexandria/ui/confirm_erase_dialog_spec.rb
574
+ - spec/alexandria/ui/conflict_while_copying_dialog_spec.rb
575
+ - spec/alexandria/ui/error_dialog_spec.rb
576
+ - spec/alexandria/ui/export_dialog_spec.rb
577
+ - spec/alexandria/ui/icons_spec.rb
453
578
  - spec/alexandria/ui/iconview_spec.rb
579
+ - spec/alexandria/ui/import_dialog_spec.rb
580
+ - spec/alexandria/ui/keep_bad_isbn_dialog_spec.rb
454
581
  - spec/alexandria/ui/main_app_spec.rb
455
- - spec/alexandria/ui/sidepane_spec.rb
582
+ - spec/alexandria/ui/new_book_dialog_manual_spec.rb
583
+ - spec/alexandria/ui/new_book_dialog_spec.rb
584
+ - spec/alexandria/ui/new_provider_dialog_spec.rb
585
+ - spec/alexandria/ui/new_smart_library_dialog_spec.rb
586
+ - spec/alexandria/ui/preferences_dialog_spec.rb
587
+ - spec/alexandria/ui/provider_preferences_dialog_spec.rb
588
+ - spec/alexandria/ui/really_delete_dialog_spec.rb
589
+ - spec/alexandria/ui/sidepane_manager_spec.rb
590
+ - spec/alexandria/ui/skip_entry_dialog_spec.rb
591
+ - spec/alexandria/ui/smart_library_properties_dialog_spec.rb
456
592
  - spec/alexandria/ui/sound_spec.rb
457
593
  - spec/alexandria/ui/ui_manager_spec.rb
458
- - spec/alexandria/ui/ui_utilities_spec.rb
459
- - spec/alexandria/utilities_spec.rb
460
594
  - spec/data/isbns.txt
461
595
  - spec/data/libraries/0.6.1-noisbn/My Library/0201398257.yaml
462
596
  - spec/data/libraries/0.6.1-noisbn/My Library/1565920007.yaml
@@ -474,8 +608,8 @@ files:
474
608
  - spec/data/libraries/0.6.2/My Library/9780575079038.yaml
475
609
  - spec/data/libraries/0.6.2/My Library/9780755322800.cover
476
610
  - spec/data/libraries/0.6.2/My Library/9780755322800.yaml
611
+ - spec/end_to_end/basic_run_spec.rb
477
612
  - spec/spec_helper.rb
478
- - tasks/dogtail.rake
479
613
  - tasks/setup.rb
480
614
  - tasks/spec.rake
481
615
  - util/rake/fileinstall.rb
@@ -495,15 +629,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
495
629
  requirements:
496
630
  - - ">="
497
631
  - !ruby/object:Gem::Version
498
- version: 2.3.0
632
+ version: 2.5.0
499
633
  required_rubygems_version: !ruby/object:Gem::Requirement
500
634
  requirements:
501
635
  - - ">="
502
636
  - !ruby/object:Gem::Version
503
637
  version: '0'
504
638
  requirements: []
505
- rubyforge_project:
506
- rubygems_version: 2.7.6
639
+ rubygems_version: 3.1.2
507
640
  signing_key:
508
641
  specification_version: 4
509
642
  summary: GNOME application for managing collections of books
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env python
2
-
3
- from dogtail.tree import *
4
- from dogtail.utils import run
5
-
6
- run('bin/alexandria', appName = 'alexandria')
7
- app = root.application('alexandria')
8
- quit_item = app.menuItem('Quit')
9
- quit_item.doActionNamed('click')
@@ -1,265 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # -*- ruby -*-
4
- #
5
- # Copyright (C) 2009 Cathal Mc Ginley
6
- # Copyright (C) 2011, 2014, 2016 Matijs van Zuijlen
7
- #
8
- # Alexandria is free software; you can redistribute it and/or
9
- # modify it under the terms of the GNU General Public License as
10
- # published by the Free Software Foundation; either version 2 of the
11
- # License, or (at your option) any later version.
12
- #
13
- # Alexandria is distributed in the hope that it will be useful,
14
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
- # General Public License for more details.
17
- #
18
- # You should have received a copy of the GNU General Public
19
- # License along with Alexandria; see the file COPYING. If not,
20
- # write to the Free Software Foundation, Inc., 51 Franklin Street,
21
- # Fifth Floor, Boston, MA 02110-1301 USA.
22
-
23
- # New DeaStore provider, taken from the Palatina MetaDataSource and
24
- # modified to fit the structure of Alexandria book providers.
25
- # (24 Feb 2009)
26
-
27
- require 'cgi'
28
- require 'alexandria/net'
29
- require 'alexandria/book_providers/web'
30
-
31
- module Alexandria
32
- class BookProviders
33
- class DeaStoreProvider < WebsiteBasedProvider
34
- include Alexandria::Logging
35
-
36
- SITE = 'http://www.deastore.com'
37
- BASE_SEARCH_URL = "#{SITE}/search/italian_books/0/%s/%s" # type/term
38
-
39
- def initialize
40
- super('DeaStore', 'DeaStore (Italy)')
41
- prefs.read
42
- @agent = nil
43
- end
44
-
45
- def agent
46
- unless @agent
47
- @agent = Alexandria::WWWAgent.new
48
- @agent.language = :it
49
- end
50
- @agent
51
- end
52
-
53
- def get_book_from_search_result(result)
54
- log.debug { "Fetching book from #{result[:url]}" }
55
- html_data = agent.get(result[:url])
56
- # File.open("rsltflarn#{Time.now().usec()}.html", 'wb') do |f|
57
- # f.write(html_data.body)
58
- # end
59
- parse_result_data(html_data.body)
60
- end
61
-
62
- def search(criterion, type)
63
- begin
64
- criterion = criterion.encode('ISO-8859-1') # still needed??
65
- rescue Encoding::UndefinedConversionError
66
- log.info { "Cannot search for non-ISO-8859-1 terms at DeaStore : #{criterion}" }
67
- raise NoResultsError
68
- end
69
- html_data = agent.get(create_search_uri(type, criterion))
70
- # File.open("flarn#{Time.now().usec()}.html", 'wb') do |f|
71
- # f.write(html_data.body)
72
- # end
73
- results = parse_search_result_data(html_data.body)
74
- raise NoResultsError if results.empty?
75
-
76
- if type == SEARCH_BY_ISBN
77
- get_book_from_search_result(results.first)
78
- else
79
- results.map { |result| get_book_from_search_result(result) }
80
- end
81
- end
82
-
83
- # it isn't possible to create a URL for a book given only the ISBN...
84
- def url(_book)
85
- nil
86
- end
87
-
88
- private
89
-
90
- def create_search_uri(search_type, search_term)
91
- # bah! very, very similar to the siciliano code! refactor out this duplication
92
- (search_type_code = { SEARCH_BY_ISBN => 'isbn',
93
- SEARCH_BY_TITLE => 'title',
94
- SEARCH_BY_AUTHORS => 'author',
95
- SEARCH_BY_KEYWORD => 'keywords' }[search_type]) || 'keywords'
96
-
97
- search_term_encoded = if search_type == SEARCH_BY_ISBN
98
- Library.canonicalise_isbn(search_term) # isbn-10
99
- else
100
- CGI.escape(search_term)
101
- end
102
-
103
- uri = format(BASE_SEARCH_URL, search_type_code, search_term_encoded)
104
- log.debug { uri }
105
- uri
106
- end
107
-
108
- def parse_search_result_data(html)
109
- doc = html_to_doc(html)
110
- book_search_results = []
111
-
112
- result_divs = doc.search('div.scheda_prodotto')
113
- result_divs.each do |div|
114
- begin
115
- # The layout...
116
- # a > img
117
- # div.scheda_content
118
- # a[link->productpage] title ## a.titolo_link
119
- # p (genre I think) ## !ignore
120
- # a[link->author] author ## a.info
121
- # p.editore (publisher? editor?)
122
- # p Data di pubblicazione: \n 2009
123
- # p.prezzo (price)
124
-
125
- # cover_url = ''
126
- # cover_images = div/'a/img'
127
- # unless cover_images.empty?
128
- # img = cover_images.first
129
- # image_url = img['src']
130
- # if image_url =~ /^http/
131
- # cover_url = '' # image_url
132
- # elsif image_url[0..0] != '/'
133
- # cover_url = "#{SITE}/#{image_url}"
134
- # else
135
- # cover_url = "#{SITE}#{image_url}"
136
- # end
137
- # log.debug { "Search Cover Image URL #{cover_url}" }
138
-
139
- # end
140
-
141
- content = div / 'div.scheda_content'
142
- title_link = (content / :a).first
143
- title = normalize(title_link.inner_text)
144
- link_to_description = title_link['href']
145
- lookup_url = "#{SITE}#{link_to_description}"
146
-
147
- authors = []
148
- (content / 'a.info').each do |link|
149
- authors << normalize(link.inner_text)
150
- end
151
-
152
- result = {}
153
- result[:author] = authors.first # HACK, what about multiple authors
154
- result[:title] = title
155
- result[:url] = lookup_url
156
-
157
- publishers = (content / 'p.editore')
158
- result[:publisher] = normalize(publishers.first.inner_text) unless publishers.empty?
159
-
160
- book_search_results << result
161
- rescue => ex
162
- trace = ex.backtrace.join("\n> ")
163
- log.error { "Failed parsing DeaStore search page #{ex.message}\n#{trace}" }
164
- end
165
- end
166
- book_search_results
167
- end
168
-
169
- def parse_result_data(html)
170
- doc = html_to_doc(html)
171
- data = doc % 'div#dati_scheda'
172
- # sotto_data_hdr = doc % 'div.sotto_schede/h1.titolo_sotto[text()*="Informazioni generali"]/..'
173
- # title
174
- title_span = data % 'h1.titolo_scheda'
175
- title = normalize(title_span.inner_text)
176
- # cover
177
- cover_link = nil
178
- cover_img = data / 'a/img'
179
- cover_link = cover_img.first['src'] unless cover_img.empty?
180
- # author(s)
181
- authors = []
182
- author_span = data % 'span.int_scheda[text()*=Autore]'
183
- author_span ||= data % 'span.int_scheda[text()*=cura]'
184
- if author_span
185
- author_links = author_span / 'a.info'
186
- authors = []
187
- author_links.each do |link|
188
- authors << normalize(link.inner_html)
189
- end
190
- end
191
- # if author_span
192
- # author_links = author_span/'a.info'
193
- # author_links.each do |link|
194
- # authors << normalize(link.inner_text)
195
- # end
196
- # end
197
- # publisher
198
- publisher_par = data % 'span.int_scheda[text()*=Editore]/..'
199
- publisher_link = publisher_par % 'a.info'
200
- publisher = normalize(publisher_link.inner_text)
201
- # skip 'Collana', (ummm, possibly genre information, Babelfish
202
- # says "Necklace")
203
- # format
204
- format_par = data % 'span.int_scheda[text()*=Formato]/..'
205
- format_par.inner_text =~ /:[\s]*(.+)[\s]*$/
206
- binding = normalize(Regexp.last_match[1])
207
- # year
208
- date_par = data % 'span.int_scheda[text()*=Data di pubblicazione]/..'
209
- date_par.inner_text =~ /:[\s]*([12][0-9]{3})[\s]*$/
210
- publish_year = nil
211
- publish_year = Regexp.last_match[1].to_i if Regexp.last_match[1]
212
- isbn_spans = data / 'div.sotto/span.isbn'
213
- isbns = []
214
- isbn_spans.each do |span|
215
- span.inner_text =~ /:[\s]*(.+)[\s]*$/
216
- isbns << Regexp.last_match[1]
217
- end
218
- isbn = nil
219
- isbn = Library.canonicalise_isbn(isbns.first) unless isbns.empty?
220
- # Editore & Imprint : as publisher info above...
221
- # pages
222
- # page_par = data % 'span.int_scheda[text()*=Pagine]/..'
223
- # if page_par
224
- # page_par.inner_text =~ /:[\s]*([0-9]+)[\s]*$/
225
- # pages = $1.to_i
226
- # end
227
- # synopsis_div = doc % 'div.sotto_schede' # exclude the first span though
228
- # book = Book.new(title, isbns.first, authors)
229
- # if publisher
230
- # book.publisher = Publisher.new(publisher)
231
- # end
232
- # if format
233
- # book.binding = CoverBinding.new(format, binding_type(format))
234
- # end
235
- # cover
236
- image_url = nil
237
- if cover_link
238
- image_url = if cover_link =~ /^http/
239
- # e.g. http://images.btol.com/ContentCafe/Jacket.aspx?\
240
- # Return=1&amp;Type=M&amp;Value=9788873641803&amp;password=\
241
- # CC70580&amp;userID=DEA40305
242
- # seems not to work, or to be blank anyway, so set to nil
243
- nil
244
- elsif cover_link[0..0] != '/'
245
- "#{SITE}/#{cover_link}"
246
- else
247
- "#{SITE}#{cover_link}"
248
- end
249
- log.debug { "Cover Image URL:: #{image_url}" }
250
- end
251
- book = Book.new(title, authors, isbn, publisher, publish_year, binding)
252
- [book, image_url]
253
- rescue => ex
254
- trace = ex.backtrace.join("\n> ")
255
- log.error { "Failed parsing DeaStore product page #{ex.message}\n#{trace}" }
256
- nil
257
- end
258
-
259
- def normalize(str)
260
- str = str.squeeze(' ').strip unless str.nil?
261
- str
262
- end
263
- end
264
- end
265
- end