removed u'

This commit is contained in:
Andreas Preikschat 2014-05-02 08:42:17 +02:00
parent 4231692ae1
commit deff310f53
26 changed files with 39 additions and 41 deletions

View File

@ -110,7 +110,7 @@ class AppLocation(object):
:param extension:
Defaults to *None*. The extension to search for. For example::
u'.png'
'.png'
"""
path = AppLocation.get_data_path()
if section:

View File

@ -68,8 +68,7 @@ class Settings(QtCore.QSettings):
``__obsolete_settings__``
Each entry is structured in the following way::
(u'general/enable slide loop', u'advanced/slide limits',
[(SlideLimits.Wrap, True), (SlideLimits.End, False)])
('general/enable slide loop', 'advanced/slide limits', [(SlideLimits.Wrap, True), (SlideLimits.End, False)])
The first entry is the *old key*; it will be removed.

View File

@ -129,7 +129,7 @@ class Plugin(QtCore.QObject, RegistryProperties):
class MyPlugin(Plugin):
def __init__(self):
super(MyPlugin, self).__init__('MyPlugin', version=u'0.1')
super(MyPlugin, self).__init__('MyPlugin', version='0.1')
:param name: Defaults to *None*. The name of the plugin.
:param default_settings: A dict containing the plugin's settings. The value to each key is the default value

View File

@ -135,7 +135,7 @@ class ScreenList(object):
Returns a list with the screens. This should only be used to display
available screens to the user::
[u'Screen 1 (primary)', u'Screen 2']
['Screen 1 (primary)', 'Screen 2']
"""
screen_list = []
for screen in self.screen_list:

View File

@ -242,7 +242,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog, RegistryProperties)
Creates a html element. If ``text`` is given, the element's text will set and if a ``parent`` is given,
the element is appended.
:param tag: The html tag, e. g. ``u'span'``. Defaults to ``None``.
:param tag: The html tag, e. g. ``'span'``. Defaults to ``None``.
:param text: The text for the tag. Defaults to ``None``.
:param parent: The parent element. Defaults to ``None``.
:param classId: Value for the class attribute

View File

@ -190,7 +190,7 @@ class ThemesTab(SettingsTab):
:param theme_list: The list of available themes::
[u'Bible Theme', u'Song Theme']
['Bible Theme', 'Song Theme']
"""
# Reload as may have been triggered by the ThemeManager.
self.global_theme = Settings().value(self.settings_section + '/global theme')

View File

@ -279,7 +279,7 @@ class OpenLPWizard(QtGui.QWizard, RegistryProperties):
:param filters: The file extension filters. It should contain the file description
as well as the file extension. For example::
u'OpenLP 2.0 Databases (*.sqlite)'
'OpenLP 2.0 Databases (*.sqlite)'
"""
if filters:
filters += ';;'

View File

@ -113,7 +113,7 @@ def get_application_version():
"""
Returns the application version of the running instance of OpenLP::
{u'full': u'1.9.4-bzr1249', u'version': u'1.9.4', u'build': u'bzr1249'}
{'full': '1.9.4-bzr1249', 'version': '1.9.4', 'build': 'bzr1249'}
"""
global APPLICATION_VERSION
if APPLICATION_VERSION:

View File

@ -32,7 +32,7 @@ other class holds all the functional code, like slots and loading and saving.
The first class, commonly known as the **Dialog** class, is typically named ``Ui_<name>Dialog``. It is a slightly
modified version of the class that the ``pyuic4`` command produces from Qt4's .ui file. Typical modifications will be
converting most strings from "" to u'' and using OpenLP's ``translate()`` function for translating strings.
converting most strings from "" to '' and using OpenLP's ``translate()`` function for translating strings.
The second class, commonly known as the **Form** class, is typically named ``<name>Form``. This class is the one which
is instantiated and used. It uses dual inheritance to inherit from (usually) QtGui.QDialog and the Ui class mentioned

View File

@ -33,7 +33,7 @@ other class holds all the functional code, like slots and loading and saving.
The first class, commonly known as the **Dialog** class, is typically named ``Ui_<name>Dialog``. It is a slightly
modified version of the class that the ``pyuic4`` command produces from Qt4's .ui file. Typical modifications will be
converting most strings from "" to u'' and using OpenLP's ``translate()`` function for translating strings.
converting most strings from "" to '' and using OpenLP's ``translate()`` function for translating strings.
The second class, commonly known as the **Form** class, is typically named ``<name>Form``. This class is the one which
is instantiated and used. It uses dual inheritance to inherit from (usually) QtGui.QDialog and the Ui class mentioned

View File

@ -262,7 +262,7 @@ def parse_reference(reference, bible, language_selection, book_ref_id=False):
For example::
[(u'John', 3, 16, 18), (u'John', 4, 1, 1)]
[('John', 3, 16, 18), ('John', 4, 1, 1)]
**Reference string details:**
@ -311,7 +311,7 @@ def parse_reference(reference, bible, language_selection, book_ref_id=False):
``(?P<to_verse>[0-9]+)``
The ``to_verse`` reference is equivalent to group 2.
The full reference is matched against get_reference_match(u'full'). This regular expression looks like this:
The full reference is matched against get_reference_match('full'). This regular expression looks like this:
``^\s*(?!\s)(?P<book>[\d]*[^\d]+)(?<!\s)\s*``
The ``book`` group starts with the first non-whitespace character. There are optional leading digits followed by

View File

@ -405,7 +405,7 @@ class BiblesTab(SettingsTab):
:param theme_list:
The list of available themes::
[u'Bible Theme', u'Song Theme']
['Bible Theme', 'Song Theme']
"""
self.bible_theme_combo_box.clear()
self.bible_theme_combo_box.addItem('')

View File

@ -370,17 +370,16 @@ class BibleDB(QtCore.QObject, Manager, RegistryProperties):
This is probably the most used function. It retrieves the list of
verses based on the user's query.
:param reference_list: This is the list of references the media manager item wants. It is
a list of tuples, with the following format::
:param reference_list: This is the list of references the media manager item wants. It is a list of tuples, with
the following format::
(book_reference_id, chapter, start_verse, end_verse)
Therefore, when you are looking for multiple items, simply break
them up into references like this, bundle them into a list. This
function then runs through the list, and returns an amalgamated
list of ``Verse`` objects. For example::
Therefore, when you are looking for multiple items, simply break them up into references like this, bundle
them into a list. This function then runs through the list, and returns an amalgamated list of ``Verse``
objects. For example::
[(u'35', 1, 1, 1), (u'35', 2, 2, 3)]
[('35', 1, 1, 1), ('35', 2, 2, 3)]
:param show_error:
"""
log.debug('BibleDB.get_verses("%s")' % reference_list)

View File

@ -534,7 +534,7 @@ class HTTPBible(BibleDB, RegistryProperties):
them into a list. This function then runs through the list, and returns an amalgamated list of ``Verse``
objects. For example::
[(u'35', 1, 1, 1), (u'35', 2, 2, 3)]
[('35', 1, 1, 1), ('35', 2, 2, 3)]
"""
log.debug('HTTPBible.get_verses("%s")', reference_list)
for reference in reference_list:

View File

@ -930,7 +930,7 @@ class BibleMediaItem(MediaManagerItem):
curly brackets or no brackets at all. For example::
u'{su}1:1{/su}'
'{su}1:1{/su}'
:param old_chapter: The previous verse's chapter number (int).
:param chapter: The chapter number (int).

View File

@ -32,7 +32,7 @@ other class holds all the functional code, like slots and loading and saving.
The first class, commonly known as the **Dialog** class, is typically named ``Ui_<name>Dialog``. It is a slightly
modified version of the class that the ``pyuic4`` command produces from Qt4's .ui file. Typical modifications will be
converting most strings from "" to u'' and using OpenLP's ``translate()`` function for translating strings.
converting most strings from "" to '' and using OpenLP's ``translate()`` function for translating strings.
The second class, commonly known as the **Form** class, is typically named ``<name>Form``. This class is the one which
is instantiated and used. It uses dual inheritance to inherit from (usually) QtGui.QDialog and the Ui class mentioned

View File

@ -354,7 +354,7 @@ class PresentationController(object):
class MyPresentationController(PresentationController):
def __init__(self, plugin):
PresentationController.__init(
self, plugin, u'My Presenter App')
self, plugin, 'My Presenter App')
:param plugin: Defaults to *None*. The presentationplugin object
:param name: Name of the application, to appear in the application

View File

@ -34,7 +34,7 @@ code, like slots and loading and saving.
The first class, commonly known as the **Dialog** class, is typically named
``Ui_<name>Dialog``. It is a slightly modified version of the class that the
``pyuic4`` command produces from Qt4's .ui file. Typical modifications will be
converting most strings from "" to u'' and using OpenLP's ``translate()``
converting most strings from "" to '' and using OpenLP's ``translate()``
function for translating strings.
The second class, commonly known as the **Form** class, is typically named

View File

@ -231,11 +231,11 @@ class SongImportForm(OpenLPWizard, RegistryProperties):
"""
Opens a QFileDialog and writes the filenames to the given listbox.
:param title: The title of the dialog (unicode).
:param title: The title of the dialog (str).
:param listbox: A listbox (QListWidget).
:param filters: The file extension filters. It should contain the file descriptions
as well as the file extensions. For example::
u'SongBeamer Files (*.sng)'
:param filters: The file extension filters. It should contain the file descriptions as well as the file
extensions. For example::
'SongBeamer Files (*.sng)'
"""
if filters:
filters += ';;'

View File

@ -434,7 +434,7 @@ def strip_rtf(text, default_encoding=None):
# Current font is the font tag we last met.
font = ''
# Character encoding is defined inside fonttable.
# font_table could contain eg u'0': u'cp1252'
# font_table could contain eg '0': u'cp1252'
font_table = {'': ''}
# Stack of things to keep track of when entering/leaving groups.
stack = []

View File

@ -292,7 +292,7 @@ class EasySlidesImport(SongImport):
return True
def _extract_region(self, line):
# this was true already: line[0:7] == u'[region':
# this was true already: line[0:7] == '[region':
"""
Extract the region from text

View File

@ -171,7 +171,7 @@ class SongBeamerImport(SongImport):
:param line: The line in the file. It should consist of a tag and a value for this tag (unicode)::
u'#Title=Nearer my God to Thee'
'#Title=Nearer my God to Thee'
"""
tag_val = line.split('=', 1)
if len(tag_val) == 1:

View File

@ -146,14 +146,14 @@ class SongSelectImport(object):
try:
song_page = BeautifulSoup(self.opener.open(song['link']).read(), 'lxml')
except (TypeError, HTTPError) as e:
log.exception(u'Could not get song from SongSelect, %s', e)
log.exception('Could not get song from SongSelect, %s', e)
return None
if callback:
callback()
try:
lyrics_page = BeautifulSoup(self.opener.open(song['link'] + '/lyrics').read(), 'lxml')
except (TypeError, HTTPError):
log.exception(u'Could not get lyrics from SongSelect')
log.exception('Could not get lyrics from SongSelect')
return None
if callback:
callback()

View File

@ -344,7 +344,7 @@ class OpenLyrics(object):
"""
Tests the given text for not closed formatting tags and returns a tuple consisting of two unicode strings::
(u'{st}{r}', u'{/r}{/st}')
('{st}{r}', '{/r}{/st}')
The first unicode string are the start tags (for the next slide). The second unicode string are the end tags.

View File

@ -305,7 +305,7 @@ class TestLib(TestCase):
# WHEN: We convert an image to a byte array
result = image_to_byte(mocked_image)
# THEN: We should receive a value of u'base64mock'
# THEN: We should receive a value of 'base64mock'
MockedQtCore.QByteArray.assert_called_with()
MockedQtCore.QBuffer.assert_called_with(mocked_byte_array)
mocked_buffer.open.assert_called_with('writeonly')

View File

@ -250,7 +250,7 @@ class TestUtils(TestCase):
# THEN: The user agent is a Linux (or ChromeOS) user agent
result = 'Linux' in user_agent or 'CrOS' in user_agent
self.assertTrue(result, u'The user agent should be a valid Linux user agent')
self.assertTrue(result, 'The user agent should be a valid Linux user agent')
def get_user_agent_windows_test(self):
"""
@ -265,7 +265,7 @@ class TestUtils(TestCase):
user_agent = _get_user_agent()
# THEN: The user agent is a Linux (or ChromeOS) user agent
self.assertIn('Windows', user_agent, u'The user agent should be a valid Windows user agent')
self.assertIn('Windows', user_agent, 'The user agent should be a valid Windows user agent')
def get_user_agent_macos_test(self):
"""
@ -280,7 +280,7 @@ class TestUtils(TestCase):
user_agent = _get_user_agent()
# THEN: The user agent is a Linux (or ChromeOS) user agent
self.assertIn('Mac OS X', user_agent, u'The user agent should be a valid OS X user agent')
self.assertIn('Mac OS X', user_agent, 'The user agent should be a valid OS X user agent')
def get_user_agent_default_test(self):
"""
@ -295,7 +295,7 @@ class TestUtils(TestCase):
user_agent = _get_user_agent()
# THEN: The user agent is a Linux (or ChromeOS) user agent
self.assertIn('NetBSD', user_agent, u'The user agent should be the default user agent')
self.assertIn('NetBSD', user_agent, 'The user agent should be the default user agent')
def get_web_page_no_url_test(self):
"""