Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 11 commits
  • 12 files changed
  • 0 commit comments
  • 1 contributor
View
2  docs/source/ref/apps/library.txt
@@ -41,7 +41,7 @@ the Z39.50 protocol. It supports the following options:
* control_number_key (optional, defaults to 12): The 'use attribute' to query
on when doing a control number lookup,
* results_encoding (optional, defaults to marc8): The encoding results come
- back in. Valid values are 'marc8' and 'unicode'.
+ back in. Valid values are 'marc8' and 'unicode'. Aleph needs 'unicode'.
Writing Your Own Providers
--------------------------
View
4 molly/apps/library/models.py
@@ -200,7 +200,7 @@ def __init__(self, location):
self.location = tuple(location)
def __unicode__(self):
- return " - ".join(self.location)
+ return "/".join(self.location)
__repr__ = __unicode__
def __hash__(self):
@@ -223,7 +223,7 @@ def get_entity(self):
if hasattr(app_by_local_name('library'), 'library_identifier'):
library_identifier = app_by_local_name('library').library_identifier
try:
- return get_entity(library_identifier, self.location[-1])
+ return get_entity(library_identifier, '/'.join(self.location))
except (Http404, Entity.MultipleObjectsReturned):
return None
else:
View
12 molly/apps/library/providers/z3950.py
@@ -63,12 +63,7 @@ def __init__(self, result, results_encoding):
heading, data = item.split(' ', 1)
heading = int(heading)
if heading == self.USM_CONTROL_NUMBER:
- # We strip the 'UkOxUb' from the front.
-
- if data.startswith('UkOxUb'):
- self.control_number = data[6:]
- else:
- self.control_number = data
+ self.control_number = data
# We'll use a slice as data may not contain that many characters.
# LCN 12110145 is an example where this would otherwise fail.
@@ -94,7 +89,7 @@ def __init__(self, result, results_encoding):
self.libraries = {}
for datum in self.metadata[self.USM_LOCATION]:
- library = Library(datum['b'])
+ library = Library(datum['b'] + datum.get('c', []))
if not 'p' in datum:
availability = LibrarySearchResult.AVAIL_UNKNOWN
datum['y'] = ['Check web OPAC']
@@ -450,4 +445,5 @@ def f(y):
return translator.translate(y).replace(u'\x1b', u'\xa0')
else:
return y.decode('ascii').replace(u'\x1b', u'\xa0')
- return f(x)
+ return f(x)
+
View
6 molly/apps/library/templates/library/item_detail.html
@@ -83,12 +83,12 @@
<tr class="sub-section-divider">
<th colspan="2">
{% if library.marker_number %}{{ library.marker_number }}. {% endif %}
- {% with library.location|slice:"-1:" as location_code %}
- <a href="{% url library:item-holdings-detail control_number,location_code.0 %}">
+ {% with library.location as location_code %}
+ <a href="{% url library:item-holdings-detail control_number,location_code|join:"/" %}">
{% if library.get_entity %}
{{ library.get_entity.title }}
{% else %}
- {{ library.location|join:" - " }}
+ {{ library.location|join:"/" }}
{% endif %}
</a>
{% endwith %}
View
2  molly/apps/library/templates/library/item_list.html
@@ -36,7 +36,7 @@
{% endwith %}
{% endif %}
<a href="{% url library:item-detail item.control_number %}">
- {{ item }}{% if item.author %}
+ {{ item.title }}{% if item.author %}
<br/><small><strong>{% trans "Author" %}:</strong> {{ item.author }}</small>{% endif %}
<br/><small><strong>{% trans "Publisher" %}:</strong> {{ item.publisher }}</small>{% if item.edition %}
<br/><small><strong>{% trans "Edition" %}:</strong> {{ item.edition }}</small>{% endif %}
View
2  molly/apps/library/views.py
@@ -204,7 +204,7 @@ def initial_context(self, request, control_number, sublocation):
# Find which particular library we're interested in
library = None
for item_library in item.libraries:
- if item_library.location[-1] == sublocation:
+ if item_library.location == tuple(sublocation.split('/')):
library = item_library
if library is None:
View
6 molly/favourites/views.py
@@ -1,7 +1,7 @@
import logging
from django.http import Http404
-from django.core.urlresolvers import resolve
+from django.core.urlresolvers import resolve, reverse
from django.utils.translation import ugettext as _
from molly.utils.views import BaseView
@@ -100,7 +100,7 @@ def handle_POST(self, request, context):
# If the source was the favourites page, redirect back there
if 'return_to_favourites' in request.POST:
- return self.redirect(lazy_reverse('favourites:index'), request)
+ return self.redirect(reverse('favourites:index'), request)
# else the source
else:
@@ -108,4 +108,4 @@ def handle_POST(self, request, context):
else:
# Missing POST data, probably a bad request
- return self.redirect(lazy_reverse('favourites:index'), request)
+ return self.redirect(reverse('favourites:index'), request)
View
2  molly/installer/__init__.py
@@ -1,6 +1,6 @@
# Packages which Molly needs, but Pip can't handle
PIP_PACKAGES = [
- ('PyZ3950', 'git+http://github.com/oucs/PyZ3950.git'), # Custom PyZ3950, contains some bug fixes
+ ('PyZ3950', 'git+git://github.com/oucs/PyZ3950.git'), # Custom PyZ3950, contains some bug fixes
('django-compress', 'git+git://github.com/mollyproject/django-compress.git#egg=django-compress'), # Fork of django-compress contains some extra features we need
('PIL', 'PIL'), # Because it doesn't install properly when called using setuptools...
]
View
8 molly/installer/commands.py
@@ -1,3 +1,4 @@
+import sys
import os
import string
from random import choice
@@ -14,7 +15,6 @@
try:
from molly.installer.sysprep import PYTHON26
except (NotImplementedError, ImportError):
- import sys
PYTHON26 = sys.executable
class DeployCommand(Command):
@@ -194,9 +194,9 @@ class DBCreateCommand(Command):
user_options = [
('admin-username=', 'u', 'The username of the database superuser to connect as [default=None]'),
('admin-password=', 'p', 'The password of the database superuser to connect as [default=None]'),
- ('molly-username', 'c', 'The username of the database user to create [default=molly]'),
- ('molly-password', 'w', 'The password of the database user to create [default=random]'),
- ('molly-database', 'd', 'Force installing, even if virtualenv already exists [default=molly]'),
+ ('molly-username=', 'c', 'The username of the database user to create [default=molly]'),
+ ('molly-password=', 'w', 'The password of the database user to create [default=random]'),
+ ('molly-database=', 'd', 'The name of the database to create [default=molly]'),
]
def initialize_options(self):
View
2  molly/installer/dbcreate.py
@@ -3,6 +3,8 @@
information as super user, or by running as root.
"""
+import os
+
from molly.installer.utils import quiet_exec, CommandFailed
def create(dba_user, dba_pass, username, password, database):
View
2  molly/installer/deploy.py
@@ -21,7 +21,7 @@ def deploy(venv, site_path, development=False, listen_externally=False,
"""
logger.info('Doing a %s install into %s using site %s',
- 'development' if development else 'production',
+ {True: 'development', False: 'production'}.get(development),
venv.path, site_path)
if not development:
View
2  molly/installer/sysprep/__init__.py
@@ -14,7 +14,7 @@
if distribution == 'Fedora':
from molly.installer.sysprep.fedora import *
elif distribution == 'redhat':
- from molly.installer.sysprep.rhel import *
+ from molly.installer.sysprep.redhat import *
elif distribution == 'Ubuntu':
if distribution_version == '10.04':
from molly.installer.sysprep.ubuntu_lucid import *

No commit comments for this range

Something went wrong with that request. Please try again.