Skip to content

Commit

Permalink
Move to python3-style unicode everywhere str()
Browse files Browse the repository at this point in the history
  • Loading branch information
Russell Jones authored and benjaoming committed May 17, 2014
1 parent 4f9bf51 commit e9c244f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import print_function, unicode_literals
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
#
# django-wiki documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 23 16:13:51 2012.
Expand Down
6 changes: 4 additions & 2 deletions wiki/editors/markitup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8
from __future__ import unicode_literals
from django import forms
from django.forms.util import flatatt
try:
Expand All @@ -24,7 +26,7 @@ def __init__(self, attrs=None):
def render(self, name, value, attrs=None):
if value is None: value = ''
final_attrs = self.build_attrs(attrs, name=name)
return mark_safe(u'<textarea%s>%s</textarea>' % (flatatt(final_attrs),
return mark_safe('<textarea%s>%s</textarea>' % (flatatt(final_attrs),
conditional_escape(force_unicode(value))))


Expand All @@ -40,7 +42,7 @@ def __init__(self, attrs=None):
def render(self, name, value, attrs=None):
if value is None: value = ''
final_attrs = self.build_attrs(attrs, name=name)
return mark_safe(u'<div><textarea%s>%s</textarea></div>' % (flatatt(final_attrs),
return mark_safe('<div><textarea%s>%s</textarea></div>' % (flatatt(final_attrs),
conditional_escape(force_unicode(value))))


Expand Down
18 changes: 10 additions & 8 deletions wiki/plugins/attachments/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import os.path

from django.db import models
Expand All @@ -23,12 +25,12 @@ class Attachment(ReusablePlugin):

current_revision = models.OneToOneField(
'AttachmentRevision',
verbose_name=_(u'current revision'),
verbose_name=_('current revision'),
blank=True, null=True, related_name='current_set',
help_text=_(u'The revision of this attachment currently in use (on all articles using the attachment)'),
help_text=_('The revision of this attachment currently in use (on all articles using the attachment)'),
)

original_filename = models.CharField(max_length=256, verbose_name=_(u'original filename'), blank=True, null=True)
original_filename = models.CharField(max_length=256, verbose_name=_('original filename'), blank=True, null=True)

def can_write(self, user):
if not settings.ANONYMOUS and (not user or user.is_anonymous()):
Expand All @@ -39,8 +41,8 @@ def can_delete(self, user):
return self.can_write(user)

class Meta:
verbose_name = _(u'attachment')
verbose_name_plural = _(u'attachments')
verbose_name = _('attachment')
verbose_name_plural = _('attachments')
app_label = settings.APP_LABEL

def __unicode__(self):
Expand Down Expand Up @@ -90,14 +92,14 @@ class AttachmentRevision(BaseRevisionMixin, models.Model):

file = models.FileField(upload_to=upload_path, #@ReservedAssignment
max_length=255,
verbose_name=_(u'file'),
verbose_name=_('file'),
storage=settings.STORAGE_BACKEND)

description = models.TextField(blank=True)

class Meta:
verbose_name = _(u'attachment revision')
verbose_name_plural = _(u'attachment revisions')
verbose_name = _('attachment revision')
verbose_name_plural = _('attachment revisions')
ordering = ('created',)
get_latest_by = 'revision_number'
app_label = settings.APP_LABEL
Expand Down
2 changes: 1 addition & 1 deletion wiki/plugins/links/mdx/djangowikilinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
>>> text = "Some text with a [Link Name](wiki:ArticleName)."
>>> html = markdown.markdown(text, ['wikipath(base_url="/wiki/view/")'])
>>> html
u'<p>Some text with a <a class="wikipath" href="/wiki/view/ArticleName/">Link Name</a>.</p>'
'<p>Some text with a <a class="wikipath" href="/wiki/view/ArticleName/">Link Name</a>.</p>'
Dependencies:
* [Python 2.3+](http://python.org)
Expand Down

0 comments on commit e9c244f

Please sign in to comment.