Various string-related fixes:

- Removed a bunch of double spaces.
- Renamed the translation files.
- Updated the translation files.
- Fixed up a few widgets.
Also fixed up the layout on the Edit Song form.

bzr-revno: 1030
This commit is contained in:
Raoul Snyman 2010-09-13 08:17:07 +02:00
commit a1f7c9c5a0
21 changed files with 5850 additions and 6023 deletions

View File

@ -450,7 +450,7 @@ class Ui_AboutDialog(object):
'\n' '\n'
'Each version is given a distinguishing version number. If the ' 'Each version is given a distinguishing version number. If the '
'Program specifies a version number of this License which applies ' 'Program specifies a version number of this License which applies '
'to it and \"any later version\', you have the option of ' 'to it and "any later version", you have the option of '
'following the terms and conditions either of that version or of ' 'following the terms and conditions either of that version or of '
'any later version published by the Free Software Foundation. If ' 'any later version published by the Free Software Foundation. If '
'the Program does not specify a version number of this License, ' 'the Program does not specify a version number of this License, '
@ -565,3 +565,4 @@ class Ui_AboutDialog(object):
self.contributeButton.setText(translate('OpenLP.AboutForm', self.contributeButton.setText(translate('OpenLP.AboutForm',
'Contribute')) 'Contribute'))
self.closeButton.setText(translate('OpenLP.AboutForm', 'Close')) self.closeButton.setText(translate('OpenLP.AboutForm', 'Close'))

View File

@ -93,6 +93,7 @@ class Ui_PluginViewDialog(object):
self.pluginListButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok) self.pluginListButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
self.pluginListButtonBox.setObjectName(u'pluginListButtonBox') self.pluginListButtonBox.setObjectName(u'pluginListButtonBox')
self.pluginLayout.addWidget(self.pluginListButtonBox) self.pluginLayout.addWidget(self.pluginListButtonBox)
self.versionNumberLabel.setText(u'')
self.retranslateUi(pluginViewDialog) self.retranslateUi(pluginViewDialog)
QtCore.QObject.connect(self.pluginListButtonBox, QtCore.QObject.connect(self.pluginListButtonBox,
QtCore.SIGNAL(u'accepted()'), pluginViewDialog.close) QtCore.SIGNAL(u'accepted()'), pluginViewDialog.close)
@ -105,8 +106,6 @@ class Ui_PluginViewDialog(object):
translate('OpenLP.PluginForm', 'Plugin Details')) translate('OpenLP.PluginForm', 'Plugin Details'))
self.versionLabel.setText( self.versionLabel.setText(
translate('OpenLP.PluginForm', 'Version:')) translate('OpenLP.PluginForm', 'Version:'))
self.versionNumberLabel.setText(
translate('OpenLP.PluginForm', 'TextLabel'))
self.aboutLabel.setText( self.aboutLabel.setText(
translate('OpenLP.PluginForm', 'About:')) translate('OpenLP.PluginForm', 'About:'))
self.statusLabel.setText( self.statusLabel.setText(
@ -115,3 +114,4 @@ class Ui_PluginViewDialog(object):
translate('OpenLP.PluginForm', 'Active')) translate('OpenLP.PluginForm', 'Active'))
self.statusComboBox.setItemText(1, self.statusComboBox.setItemText(1,
translate('OpenLP.PluginForm', 'Inactive')) translate('OpenLP.PluginForm', 'Inactive'))

View File

@ -209,7 +209,7 @@ class SlideController(QtGui.QWidget):
self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarSeparator(u'Close Separator')
self.Toolbar.addToolbarButton( self.Toolbar.addToolbarButton(
u'Edit Song', u':/general/general_edit.png', u'Edit Song', u':/general/general_edit.png',
translate('OpenLP.SlideController', 'Edit and re-preview Song'), translate('OpenLP.SlideController', 'Edit and re-preview song'),
self.onEditSong) self.onEditSong)
if isLive: if isLive:
self.Toolbar.addToolbarSeparator(u'Loop Separator') self.Toolbar.addToolbarSeparator(u'Loop Separator')
@ -269,11 +269,11 @@ class SlideController(QtGui.QWidget):
if isLive: if isLive:
self.SongMenu = QtGui.QToolButton(self.Toolbar) self.SongMenu = QtGui.QToolButton(self.Toolbar)
self.SongMenu.setText(translate('OpenLP.SlideController', self.SongMenu.setText(translate('OpenLP.SlideController',
'Go to')) 'Go To'))
self.SongMenu.setPopupMode(QtGui.QToolButton.InstantPopup) self.SongMenu.setPopupMode(QtGui.QToolButton.InstantPopup)
self.Toolbar.addToolbarWidget(u'Song Menu', self.SongMenu) self.Toolbar.addToolbarWidget(u'Song Menu', self.SongMenu)
self.SongMenu.setMenu(QtGui.QMenu( self.SongMenu.setMenu(QtGui.QMenu(
translate('OpenLP.SlideController', 'Go to'), translate('OpenLP.SlideController', 'Go To'),
self.Toolbar)) self.Toolbar))
self.Toolbar.makeWidgetsInvisible([u'Song Menu']) self.Toolbar.makeWidgetsInvisible([u'Song Menu'])
# Screen preview area # Screen preview area

View File

@ -212,7 +212,7 @@ class PresentationMediaItem(MediaManagerItem):
self, translate('PresentationPlugin.MediaItem', self, translate('PresentationPlugin.MediaItem',
'Unsupported File'), 'Unsupported File'),
translate('PresentationPlugin.MediaItem', translate('PresentationPlugin.MediaItem',
'This type of presentation is not supported')) 'This type of presentation is not supported.'))
continue continue
item_name = QtGui.QListWidgetItem(filename) item_name = QtGui.QListWidgetItem(filename)
item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file)) item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file))

View File

@ -258,10 +258,11 @@ class Ui_EditSongDialog(object):
self.TopicBookLayout.addWidget(self.TopicGroupBox) self.TopicBookLayout.addWidget(self.TopicGroupBox)
self.SongBookGroup = QtGui.QGroupBox(self.TopicBookWidget) self.SongBookGroup = QtGui.QGroupBox(self.TopicBookWidget)
self.SongBookGroup.setObjectName(u'SongBookGroup') self.SongBookGroup.setObjectName(u'SongBookGroup')
self.SongbookLayout = QtGui.QGridLayout(self.SongBookGroup) self.SongbookLayout = QtGui.QFormLayout(self.SongBookGroup)
self.SongbookLayout.setMargin(8) self.SongbookLayout.setMargin(8)
self.SongbookLayout.setSpacing(8) self.SongbookLayout.setSpacing(8)
self.SongbookLayout.setObjectName(u'SongbookLayout') self.SongbookLayout.setObjectName(u'SongbookLayout')
self.SongbookNameLabel = QtGui.QLabel(self.SongBookGroup)
self.SongbookCombo = QtGui.QComboBox(self.SongBookGroup) self.SongbookCombo = QtGui.QComboBox(self.SongBookGroup)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding,
QtGui.QSizePolicy.Fixed) QtGui.QSizePolicy.Fixed)
@ -272,13 +273,11 @@ class Ui_EditSongDialog(object):
self.SongbookCombo.setEditable(True) self.SongbookCombo.setEditable(True)
self.SongbookCombo.setSizePolicy(sizePolicy) self.SongbookCombo.setSizePolicy(sizePolicy)
self.SongbookCombo.setObjectName(u'SongbookCombo') self.SongbookCombo.setObjectName(u'SongbookCombo')
self.SongbookLayout.addWidget(self.SongbookCombo, 0, 0, 1, 1) self.SongbookLayout.addRow(self.SongbookNameLabel, self.SongbookCombo)
self.songBookNumberLabel = QtGui.QLabel(self.SongBookGroup) self.songBookNumberLabel = QtGui.QLabel(self.SongBookGroup)
self.SongbookLayout.addWidget(self.songBookNumberLabel, 0, 1, 1, 1)
self.songBookNumberEdit = QtGui.QLineEdit(self.SongBookGroup) self.songBookNumberEdit = QtGui.QLineEdit(self.SongBookGroup)
self.songBookNumberLabel.setBuddy(self.songBookNumberEdit) self.SongbookLayout.addRow(self.songBookNumberLabel,
self.songBookNumberEdit.setMaximumWidth(35) self.songBookNumberEdit)
self.SongbookLayout.addWidget(self.songBookNumberEdit, 0, 2, 1, 1)
self.TopicBookLayout.addWidget(self.SongBookGroup) self.TopicBookLayout.addWidget(self.SongBookGroup)
self.AuthorsTabLayout.addWidget(self.TopicBookWidget) self.AuthorsTabLayout.addWidget(self.TopicBookWidget)
self.SongTabWidget.addTab(self.AuthorsTab, u'') self.SongTabWidget.addTab(self.AuthorsTab, u'')
@ -446,8 +445,10 @@ class Ui_EditSongDialog(object):
translate('SongsPlugin.EditSongForm', 'R&emove')) translate('SongsPlugin.EditSongForm', 'R&emove'))
self.SongBookGroup.setTitle( self.SongBookGroup.setTitle(
translate('SongsPlugin.EditSongForm', 'Song Book')) translate('SongsPlugin.EditSongForm', 'Song Book'))
self.SongbookNameLabel.setText(translate('SongsPlugin.EditSongForm',
'Book:'))
self.songBookNumberLabel.setText(translate('SongsPlugin.EditSongForm', self.songBookNumberLabel.setText(translate('SongsPlugin.EditSongForm',
'Song No.:')) 'Number:'))
self.SongTabWidget.setTabText( self.SongTabWidget.setTabText(
self.SongTabWidget.indexOf(self.AuthorsTab), self.SongTabWidget.indexOf(self.AuthorsTab),
translate('SongsPlugin.EditSongForm', translate('SongsPlugin.EditSongForm',

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -24,13 +24,31 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 # # with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
# Short description
# Steps for creating languages:
# 1. make sure that the openlp_en.ts file exist
# 2. go to scripts folder and start:
# python translation_utils.py -a
###############################################################################
"""
This script is used to maintain the translation files in OpenLP. It downloads
the latest translation files from the Pootle translation server, updates the
local translation files from both the source code and the files from Pootle,
and can also generate the compiled translation files.
Create New Language
-------------------
To create a new language, simply run this script with the ``-a`` command line
option::
@:~$ ./translation_utils.py -a
Update Translation Files
------------------------
The best way to update the translations is to download the files from Pootle,
and then update the local files using both the downloaded files and the source.
This is done easily via the ``-d``, ``-p`` and ``-u`` options::
@:~$ ./translation_utils.py -dpu
"""
import os import os
import urllib import urllib
import re import re
@ -39,201 +57,277 @@ from optparse import OptionParser
from PyQt4 import QtCore from PyQt4 import QtCore
from BeautifulSoup import BeautifulSoup from BeautifulSoup import BeautifulSoup
class TranslationUtils(object): SERVER_URL = u'http://pootle.projecthq.biz/export/openlp/'
IGNORED_PATHS = [u'scripts']
IGNORED_FILES = [u'setup.py']
verbose_mode = False
class Command(object):
"""
Provide an enumeration of commands.
"""
Download = 1
Create = 2
Prepare = 3
Update = 4
Generate = 5
class CommandStack(object):
"""
This class provides an iterable stack.
"""
def __init__(self): def __init__(self):
self.ignore_paths = [u'./scripts'] self.current_index = 0
self.ignore_files = [u'setup.py'] self.data = []
self.server_url = u'http://pootle.projecthq.biz/export/openlp/'
self.cmd_stack = []
self.stack_count = 0
self.verbose = False
def __len__(self):
return len(self.data)
def process_stack(self): def __getitem__(self, index):
if len(self.cmd_stack) > 0: if self.data[index].get(u'arguments'):
if len(self.cmd_stack) == self.stack_count: return self.data[index][u'command'], self.data[index][u'arguments']
print u'Process %d commands' % self.stack_count
print u'%d. ' % (self.stack_count-len(self.cmd_stack)+1),
command = self.cmd_stack.pop(0)
if len(command) > 1:
command[0](command[1])
else: else:
command[0]() return self.data[index][u'command']
def __iter__(self):
return self
def next(self):
if self.current_index == len(self.data):
raise StopIteration
else: else:
print "Finished all commands" current_item = self.data[self.current_index][u'command']
self.current_index += 1
return current_item
def append(self, command, **kwargs):
data = {u'command': command}
if u'arguments' in kwargs:
data[u'arguments'] = kwargs[u'arguments']
self.data.append(data)
def reset(self):
self.current_index = 0
def downloadTranslations(self): def print_verbose(text):
print 'Download Translation files from HQ-Server' """
page = urllib.urlopen(u'%s' % (self.server_url)) This method checks to see if we are in verbose mode, and if so prints
soup = BeautifulSoup(page) ``text`` out.
languages = soup.findAll(text=re.compile(".*\.ts"))
for language in languages:
filename = os.path.join(u'..', u'resources', u'i18n',
u'openlp_%s' % language)
self.printVerbose(u'Get Translation File: %s' % filename)
self.get_and_write_file(language, filename)
print u' done'
self.process_stack()
def get_and_write_file(self, language, filename): ``text``
page = urllib.urlopen(u'%s%s' % (self.server_url, language)) The text to print.
"""
global verbose_mode
if verbose_mode:
print u' %s' % text
def run(command):
"""
This method runs an external application.
``command``
The command to run.
"""
print_verbose(command)
process = QtCore.QProcess()
process.start(command)
while (process.waitForReadyRead()):
print_verbose(u'ReadyRead: %s' % QtCore.QString(process.readAll()))
print_verbose(u'Error(s):\n%s' % process.readAllStandardError())
print_verbose(u'Output:\n%s' % process.readAllStandardOutput())
print u' Done.'
def download_file(source_filename, dest_filename):
"""
Download a file and save it to disk.
``source_filename``
The file to download.
``dest_filename``
The new local file name.
"""
print_verbose(u'Downloading from: %s' % (SERVER_URL + source_filename))
page = urllib.urlopen(SERVER_URL + source_filename)
content = page.read().decode('utf8') content = page.read().decode('utf8')
page.close() page.close()
file = open(filename, u'w') file = open(dest_filename, u'w')
file.write(content.encode('utf8')) file.write(content.encode('utf8'))
file.close() file.close()
def creation(self, language): def download_translations():
print "Create new Translation File"
""" """
Use this option to create a new translation file This method downloads the translation files from the Pootle server.
this function:
* create the new *.ts file
""" """
filename = os.path.join(u'..', u'resources', u'i18n', print 'Download translation files from Pootle'
u'openlp_%s.ts' % language) page = urllib.urlopen(SERVER_URL)
self.get_and_write_file(u'en.ts', filename) soup = BeautifulSoup(page)
self.printVerbose(""" languages = soup.findAll(text=re.compile(r'.*\.ts'))
Please remind: For permanent providing this language: for language in languages:
this language name have to append to the global list filename = os.path.join(os.path.abspath(u'..'), u'resources', u'i18n',
variable "translations" in this file language)
and this file have to be uploaded to the Pootle Server print_verbose(u'Get Translation File: %s' % filename)
Please contact the developers! download_file(language, filename)
""") print u' Done.'
print u' done'
self.process_stack()
def prepare_project():
def preparation(self): """
This method creates the project file needed to update the translation files
and compile them into .qm files.
"""
print u'Generating the openlp.pro file' print u'Generating the openlp.pro file'
stringlist = [] lines = []
start_dir = os.path.join(u'..') start_dir = os.path.abspath(u'..')
start_dir = start_dir + os.sep
print_verbose(u'Starting directory: %s' % start_dir)
for root, dirs, files in os.walk(start_dir): for root, dirs, files in os.walk(start_dir):
for file in files: for file in files:
path = u'%s' % root path = root.replace(start_dir, u'').replace(u'\\', u'/') #.replace(u'..', u'.')
path = path.replace('\\','/')
path = path.replace('..','.')
if file.startswith(u'hook-') or file.startswith(u'test_'): if file.startswith(u'hook-') or file.startswith(u'test_'):
continue continue
ignore = False
cond = False for ignored_path in IGNORED_PATHS:
for search in self.ignore_paths: if path.startswith(ignored_path):
if path.startswith(search): ignore = True
cond = True break
if cond: if ignore:
continue continue
cond = False ignore = False
for search in self.ignore_files: for ignored_file in IGNORED_FILES:
if search == file: if file == ignored_file:
cond = True ignore = True
if cond: break
if ignore:
continue continue
if file.endswith(u'.py') or file.endswith(u'.pyw'):
if file.endswith(u'.py'): if path:
line = u'%s/%s' % (path, file) line = u'%s/%s' % (path, file)
self.printVerbose(u'Parsing "%s"' % line) else:
stringlist.append(u'SOURCES += %s' % line) line = file
elif file.endswith(u'.pyw'): print_verbose(u'Parsing "%s"' % line)
line = u'%s/%s' % (path, file) lines.append(u'SOURCES += %s' % line)
self.printVerbose(u'Parsing "%s"' % line)
stringlist.append(u'SOURCES += %s' % line)
elif file.endswith(u'.ts'): elif file.endswith(u'.ts'):
line = u'%s/%s' % (path, file) line = u'%s/%s' % (path, file)
self.printVerbose(u'Parsing "%s"' % line) print_verbose(u'Parsing "%s"' % line)
stringlist.append(u'TRANSLATIONS += %s' % line) lines.append(u'TRANSLATIONS += %s' % line)
lines.sort()
stringlist.sort() file = open(os.path.join(start_dir, u'openlp.pro'), u'w')
self.write_file(os.path.join(start_dir, u'openlp.pro'), stringlist) file.write(u'\n'.join(lines).encode('utf8'))
print u' done'
self.process_stack()
def update(self):
print u'Update the translation files'
cmd = u'pylupdate4 -verbose -noobsolete ../openlp.pro'
self.start_cmd(cmd)
def generate(self):
print u'Generate the related *.qm files'
cmd = u'lrelease ../openlp.pro'
self.start_cmd(cmd)
def write_file(self, filename, stringlist):
content = u''
for line in stringlist:
content = u'%s%s\n' % (content, line)
file = open(filename, u'w')
file.write(content.encode('utf8'))
file.close() file.close()
print u' Done.'
def printVerbose(self, data): def update_translations():
if self.verbose: print u'Update the translation files'
print u' %s' % data if not os.path.exists(os.path.join(os.path.abspath(u'..'), u'openlp.pro')):
print u'You have no generated a project file yet, please run this ' + \
u'script with the -p option.'
return
else:
os.chdir(os.path.abspath(u'..'))
run(u'pylupdate4 -verbose -noobsolete openlp.pro')
def start_cmd(self, command): def generate_binaries():
self.printVerbose(command) print u'Generate the related *.qm files'
self.process = QtCore.QProcess() if not os.path.exists(os.path.join(os.path.abspath(u'..'), u'openlp.pro')):
self.process.start(command) print u'You have no generated a project file yet, please run this ' + \
while (self.process.waitForReadyRead()): u'script with the -p option. It is also recommended that you ' + \
self.printVerbose(u'ReadyRead: %s' % QtCore.QString(self.process.readAll())) u'this script with the -u option to update the translation ' + \
self.printVerbose(self.process.readAllStandardError()) u'files as well.'
self.printVerbose(self.process.readAllStandardOutput()) return
print u' done' else:
self.process_stack() os.chdir(os.path.abspath(u'..'))
run(u'lrelease openlp.pro')
def create_translation(language):
"""
This method creates a new translation file.
``language``
The language file to create.
"""
print "Create new Translation File"
filename = os.path.join(os.path.abspath(u'..'), u'resources', u'i18n', language)
download_file(u'en.ts', filename)
print u'\n** Please Note **\n'
print u'In order to get this file into OpenLP and onto the Pootle ' + \
u'translation server you will need to subscribe to the OpenLP' + \
u'Translators mailing list, and request that your language file ' + \
u'be added to the project.\n'
print u' Done'
def process_stack(command_stack):
"""
This method looks at the commands in the command stack, and processes them
in the order they are in the stack.
``command_stack``
The command stack to process.
"""
if command_stack:
print u'Processing %d commands...' % len(command_stack)
for command in command_stack:
print u'%d.' % (command_stack.current_index),
if command == Command.Download:
download_translations()
elif command == Command.Prepare:
prepare_project()
elif command == Command.Update:
update_translations()
elif command == Command.Generate:
generate_binaries()
elif command == Command.Create:
command, arguments = command_stack[command_stack.current_index]
create_translation(*arguments)
print u'Finished processing commands.'
else:
print u'No commands to process.'
def main(): def main():
# start Main Class global verbose_mode
Util = TranslationUtils()
# Set up command line options. # Set up command line options.
usage = u''' usage = u'%prog [options]\nOptions are parsed in the order they are ' + \
This script handle the translation files for OpenLP. u'listed below. If no options are given, "-dpug" will be used.\n\n' + \
Usage: %prog [options] u'This script is used to manage OpenLP\'s translation files.'
If no option will be used, options "-d -p -u -g" will be set automatically
'''
parser = OptionParser(usage=usage) parser = OptionParser(usage=usage)
parser.add_option('-d', '--download-ts', action='store_true', parser.add_option('-d', '--download-ts', dest='download',
dest='download', help='Load languages from Pootle Server') action='store_true', help='download language files from Pootle')
parser.add_option('-c', '--create', metavar='lang', parser.add_option('-c', '--create', dest=u'create', metavar='LANG',
help='creation of new translation file, Parameter: language (e.g. "en_GB"') help='create a new translation file for language LANG, e.g. "en_GB"')
parser.add_option('-p', '--prepare', action='store_true', dest='prepare', parser.add_option('-p', '--prepare', dest='prepare', action='store_true',
help='preparation (generate pro file)') help='generate a project file, used to update the translations')
parser.add_option('-u', '--update', action='store_true', dest='update', parser.add_option('-u', '--update', action='store_true', dest='update',
help='update translation files') help='update translation files (needs a project file)')
parser.add_option('-g', '--generate', action='store_true', dest='generate', parser.add_option('-g', '--generate', dest='generate', action='store_true',
help='generate qm files') help='compile .ts files into .qm files')
parser.add_option('-v', '--verbose', action='store_true', dest='verbose', parser.add_option('-v', '--verbose', dest='verbose', action='store_true',
help='Give more informations while processing') help='show extra information while processing translations')
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
# Create and populate the command stack
command_stack = CommandStack()
if options.download: if options.download:
Util.cmd_stack.append([Util.downloadTranslations]) command_stack.append(Command.Download)
if options.create: if options.create:
Util.cmd_stack.append([Util.creation, u'%s' % options.create]) command_stack.append(Command.Create, arguments=[options.create])
if options.prepare: if options.prepare:
Util.cmd_stack.append([Util.preparation]) command_stack.append(Command.Prepare)
if options.update: if options.update:
Util.cmd_stack.append([Util.update]) command_stack.append(Command.Update)
if options.generate: if options.generate:
Util.cmd_stack.append([Util.generate]) command_stack.append(Command.Generate)
if options.verbose: verbose_mode = options.verbose
Util.verbose = True if not command_stack:
command_stack.append(Command.Download)
if len(Util.cmd_stack) == 0: command_stack.append(Command.Prepare)
Util.cmd_stack.append([Util.downloadTranslations]) command_stack.append(Command.Update)
Util.cmd_stack.append([Util.preparation]) command_stack.append(Command.Generate)
Util.cmd_stack.append([Util.update]) # Process the commands
Util.cmd_stack.append([Util.generate]) process_stack(command_stack)
Util.stack_count = len(Util.cmd_stack)
Util.process_stack()
if __name__ == u'__main__': if __name__ == u'__main__':
if os.path.split(os.path.abspath(u'.'))[1] != u'scripts': if os.path.split(os.path.abspath(u'.'))[1] != u'scripts':
print u'You need to run this script from the scripts directory.' print u'You need to run this script from the scripts directory.'
else: else:
main() main()