Commit 15d6994c authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

remove trailing whitespaces.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@43120 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e1fadb90
......@@ -6,15 +6,15 @@
- Removed the configurationmanager.py.
0.5
===
- Removed the possibility of infinite loop in getAvailableOO.
- Corrected the problem when the document in file system isn't
- Removed the possibility of infinite loop in getAvailableOO.
- Corrected the problem when the document in file system isn't
found(IllegalArgumentException).
- Implemented in oohandler to when not exist OOo Instance free. If don't exist,
the requisition is locked.
0.4
===
Created class to manipulate the configuration file(ConfigurationManager).
Created class to manipulate the configuration file(ConfigurationManager).
Now, all paths are taken by this object and in configuration file is possible
set the number of OOo instance that you want. The OOFactory object was implemented
to start the max number of OOo instance and get the instance available to use.
......@@ -22,7 +22,7 @@ to start the max number of OOo instance and get the instance available to use.
0.3
===
Split start.py into openoffice.py and xvfb.py. The classes openoffice and xvfb have
methods to control the process(start,stop and status about the process). Created one class
methods to control the process(start,stop and status about the process). Created one class
and one object for it, for easier reload the configuration.
0.2
......
Install Cloudooo
================
$ python2.6 setup.py install
Warnings:
- you must have installed setuptools>=0.6c11 in this python.
Install Dependencies in Mandriva
================================
$ urpmi xvfb # System Dependencies
Install OpenOffice.org
======================
Was used for testing the package's official openoffice.org. Follow these steps to install:
Download Package from the official site
---------------------------------------
x86_32
----
$ wget http://download.services.openoffice.org/files/stable/3.2.0/OOo_3.2.0_LinuxIntel_install_wJRE_en-US.tar.gz
x86_64
------
$ wget http://download.services.openoffice.org/files/stable/3.2.0/OOo_3.2.0_LinuxX86-64_install_wJRE_en-US.tar.gz
......@@ -32,12 +32,12 @@ Install OpenOffice.org
$ tar zxvf OOo_3.2.0_LinuxX86-64_install_wJRE_en-US.tar.gz
$ cd OOO320_m12_native_packed-1_en-US.9483/RPMS
$ rpm -i *.rpm # install all packages together
The instalation is in /opt
Create Configuration File
=========================
The configuration file is used to start the application using paster.
$ cp ./cloudooo/samples/samples.conf . # Copy to current folder
......@@ -52,9 +52,9 @@ Run Application
$ paster serve ./cloudooo.conf
or run as a daemon:
$ paster serve ./cloudoo.conf --daemon
Stop Application
===============
......@@ -82,7 +82,7 @@ Xvfb and OpenOffice
- configure and start Xvfb;
- Use a single Xvfb;
- the xvfb will be started with the XMLRPC Server;
- When start the Daemon(cloudooo), it configures Xvfb, next opens the openoffice(with pyuno) and start XMLRPC Server;
- When start the Daemon(cloudooo), it configures Xvfb, next opens the openoffice(with pyuno) and start XMLRPC Server;
- control Xvfb;
- start openoffice;
- Pyuno start the openoffice processes and the communication is through sockets;
......
......@@ -42,16 +42,16 @@ usage: unoconverter [options]
Options:
-h, --help this help screen
--test Test if the Openoffice works correctly
--hostname=STRING OpenOffice Instance address
--port=STRING OpenOffice Instance port
--document_url=STRING_URL
--document_url=STRING_URL
URL of document to load in OpenOffice
--office_binary_path=STRING_URL
Folder path were is the binary openoffice
--uno_path=STRING_URL
......@@ -78,7 +78,7 @@ class UnoConverter(object):
self.document_dir_path = dirname(document_url)
self.source_format = kw.get('source_format')
self.refresh = kw.get('refresh')
self._setUpUnoEnvironment(kw.get("uno_path"),
self._setUpUnoEnvironment(kw.get("uno_path"),
kw.get("office_binary_path"))
self._load()
......@@ -109,7 +109,7 @@ class UnoConverter(object):
property = PropertyValue()
property.Name = name
property.Value = value
return property
return property
def _createSpecificProperty(self, filter_name):
"""Creates a property according to the filter"""
......@@ -234,7 +234,7 @@ class UnoConverter(object):
def setMetadata(self, metadata):
"""Returns a document with new metadata.
Keyword arguments:
metadata -- expected an dictionary with metadata.
"""
......@@ -270,16 +270,16 @@ def main():
try:
opt_list, arg_list = getopt(sys.argv[1:], "h", ["help", "test",
"convert", "getmetadata", "setmetadata",
"uno_path=", "office_binary_path=",
"uno_path=", "office_binary_path=",
"hostname=", "port=", "source_format=",
"document_url=", "destination_format=",
"document_url=", "destination_format=",
"mimemapper=", "metadata=", "refresh=",
"unomimemapper_bin="])
except GetoptError, msg:
msg = msg.msg + help_msg
print >> sys.stderr, msg
sys.exit(2)
param_list = [tuple[0] for tuple in iter(opt_list)]
try:
......@@ -313,19 +313,19 @@ def main():
metadata = json.loads(arg)
elif opt == '--mimemapper':
mimemapper = json.loads(arg)
kw = {}
if "uno_path" in locals():
kw['uno_path'] = uno_path
if "office_binary_path" in locals():
kw['office_binary_path'] = office_binary_path
if 'source_format' in locals():
kw['source_format'] = source_format
if refresh:
kw['refresh'] = refresh
unoconverter = UnoConverter(hostname, port, document_url, **kw)
if "--convert" in param_list and not '--getmetadata' in param_list \
and 'destination_format' not in locals():
......@@ -344,6 +344,6 @@ def main():
output = document_url
print output
if "__main__" == __name__:
main()
......@@ -44,9 +44,9 @@ usage: unomimemapper [options]
Options:
-h, --help this help screen
--hostname=STRING OpenOffice Instance address
--port=STRING OpenOffice Instance port
--office_binary_path=STRING_URL
Folder path were is the binary openoffice
--uno_path=STRING_URL
......@@ -59,7 +59,7 @@ class UnoMimemapper(object):
def __init__(self, hostname, port, **kw):
""" Receives hostname and port from openoffice and create a service manager"""
self._setUpUnoEnvironment(kw.get("uno_path"),
self._setUpUnoEnvironment(kw.get("uno_path"),
kw.get("office_binary_path"))
self.service_manager = helper_utils.getServiceManager(hostname, port)
......@@ -128,7 +128,7 @@ def main():
msg = msg.msg + "\nUse --help or -h"
print >> sys.stderr, msg
sys.exit(2)
if not opt_list:
help()
......@@ -143,7 +143,7 @@ def main():
hostname = arg
elif opt == "--port":
port = arg
mimemapper = UnoMimemapper(hostname, port, **dict(environ))
filter_dict = mimemapper.getFilterDict()
type_dict = mimemapper.getTypeDict()
......
......@@ -108,7 +108,7 @@ class MimeMapper(object):
"--office_binary_path=%s" % office_binary_path,
"--hostname=%s" % hostname,
"--port=%s" % port]
stdout, stderr = Popen(command,
stdout=PIPE,
close_fds=True).communicate()
......
......@@ -36,7 +36,7 @@ from time import ctime, time
from base64 import encodestring
__doc__ = """
usage: python HighTestLoad.py [options]
usage: python HighTestLoad.py [options]
Options:
-h, --help this help screen
......@@ -72,14 +72,14 @@ class Log(object):
class Client(Process):
"""Represents a client that sends requests to the server. The log file by
default is created in current path, but can be created in another path.
In log are stored:
- Date and time that the client initiated the test;
- Duration of each request;
- Total time of all requets;
- Data and time that the client finished the test;
"""
def __init__(self, address, number_request, folder, **kw):
"""Client constructor
......@@ -126,7 +126,7 @@ class Client(Process):
def main():
help_msg = "\nUse --help or -h"
try:
opt_list, arg_list = getopt(sys.argv[1:], "hc:n:f:s:l:", ["help"])
......@@ -153,7 +153,7 @@ def main():
client_list = []
for num in range(number_client):
kw['log_filename'] = "client%s.log" % num
kw['log_filename'] = "client%s.log" % num
client = Client(server_address, number_request, document_folder, **kw)
client_list.append(client)
client.start()
......
......@@ -88,17 +88,17 @@ def startFakeEnvironment(start_openoffice=True, conf_path=None):
virtual_display_id,
virtual_screen='1')
xvfb.start()
waitStartDaemon(xvfb, 10)
waitStartDaemon(xvfb, 10)
if start_openoffice:
default_language = config.get('app:main',
'openoffice_user_interface_language', False,
{'openoffice_user_interface_language': 'en'})
openoffice.loadSettings(hostname,
openoffice_port,
openoffice_port,
working_path,
virtual_display_id,
office_binary_path,
office_binary_path,
uno_path,
default_language)
openoffice.start()
......@@ -110,7 +110,7 @@ def startFakeEnvironment(start_openoffice=True, conf_path=None):
mimemapper.loadFilterList(hostname, port, **kw)
openoffice.release()
return openoffice, xvfb
return xvfb
......@@ -124,7 +124,7 @@ def stopFakeEnvironment(stop_openoffice=True):
class CloudoooTestCase(unittest.TestCase):
"""Test Case to load cloudooo conf."""
def setUp(self):
"""Creates a environment to run the tests. Is called always before the
tests."""
......
This diff is collapsed.
......@@ -24,7 +24,7 @@ def wait_use_port(pid, timeout_limit=30):
def exit(msg):
sys.stderr.write(msg)
sys.exit(0)
sys.exit(0)
def run():
......@@ -50,7 +50,7 @@ def run():
python_extension = '.py'
if test_name[-3:] == python_extension:
test_name = test_name[:-3]
if not path.exists(path.join(ENVIRONMENT_PATH,
if not path.exists(path.join(ENVIRONMENT_PATH,
'%s%s' % (test_name, python_extension))):
exit("%s not exists\n" % test_name)
......
......@@ -32,7 +32,7 @@ from cloudoooTestCase import make_suite
class TestApplication(unittest.TestCase):
def setUp(self):
"""Instantiate one application object and load settings on object"""
self.application = Application()
......@@ -44,7 +44,7 @@ class TestApplication(unittest.TestCase):
self.assertEquals(self.application.port, 9999)
self.assertEquals(self.application.path_run_dir, '/tmp/')
self.assertEquals(self.application.display_id, '99')
def testStartTimeout(self):
"""Test if the attribute timeout is defined correctly"""
self.assertEquals(self.application.timeout, 20)
......
......@@ -99,7 +99,7 @@ class TestFileSystemDocument(unittest.TestCase):
self.assertEquals(self.fsdocument.getContent(), self.data)
self.fsdocument.trash()
self.assertEquals(path.exists(url), False)
def testZipDocumentList(self):
"""Tests if the zip file is returned correctly"""
open(path.join(self.fsdocument.directory_name, 'document2'), 'w').write('test')
......
......@@ -55,15 +55,15 @@ class TestMonitorInit(CloudoooTestCase):
def testMonitorLoadOnlyMonitorRequest(self):
"""Check if the monitors are started"""
monitor.load(self.load_config)
self.assertEquals(isinstance(monitor.monitor_request,
self.assertEquals(isinstance(monitor.monitor_request,
MonitorRequest),
True)
def testMonitorLoadMonitorMemory(self):
"""Check if the MemoryMemory is started"""
self.load_config['enable_memory_monitor'] = True
monitor.load(self.load_config)
self.assertEquals(isinstance(monitor.monitor_request,
self.assertEquals(isinstance(monitor.monitor_request,
MonitorRequest),
True)
self.assertEquals(isinstance(monitor.monitor_memory,
......
......@@ -39,7 +39,7 @@ OPENOFFICE = True
class TestMonitorMemory(unittest.TestCase):
"""Test case to see if the MonitorMemory is properly managing the
openoffice."""
interval = 3
def setUp(self):
......
......@@ -36,7 +36,7 @@ OPENOFFICE = True
class TestMonitorTimeout(unittest.TestCase):
"""Test all features of a monitor following the interface"""
def _createMonitor(self, interval):
"""Returns an MonitorTimeout instance"""
return MonitorTimeout(openoffice, interval)
......
......@@ -84,7 +84,7 @@ class TestOOHandler(CloudoooTestCase):
doc_exported = handler.convert("odt")
self._assert_document_output(doc_exported,
"application/vnd.oasis.opendocument.text")
def testGetMetadata(self):
"""Test getMetadata"""
data = encodestring(open("data/test.odt").read())
......@@ -96,7 +96,7 @@ class TestOOHandler(CloudoooTestCase):
self.assertTrue(metadata.has_key('Data'))
self.assertEquals(metadata.get('MIMEType'),
'application/vnd.oasis.opendocument.text')
handler.document.restoreOriginal()
handler.document.restoreOriginal()
metadata = handler.getMetadata(True)
self.assertNotEquals(metadata.get('Data'), '')
......@@ -132,7 +132,7 @@ class TestOOHandler(CloudoooTestCase):
doc_exported = handler.convert("odt")
self._assert_document_output(doc_exported,
"application/vnd.oasis.opendocument.text")
def testGetMetadataWithOpenOfficeStopped(self):
"""Test getMetadata with openoffice stopped"""
openoffice.stop()
......@@ -144,7 +144,7 @@ class TestOOHandler(CloudoooTestCase):
self.assertEquals(metadata.get('Title'), 'title')
self.assertEquals(metadata.get('MIMEType'),
'application/vnd.oasis.opendocument.text')
def testSetMetadataWithOpenOfficeStopped(self):
"""Test setMetadata with openoffice stopped"""
openoffice.stop()
......
......@@ -35,7 +35,7 @@ OPENOFFICE = True
class TestOpenOffice(CloudoooTestCase):
"""Test OpenOffice object and manipulation of OOo Instance"""
def afterSetUp(self):
"""Instantiate one OpenOffice"""
self.openoffice = OpenOffice()
......
This diff is collapsed.
......@@ -56,14 +56,14 @@ class TestUnoConverter(CloudoooTestCase):
def testUnoConverterOdtToDoc(self):
"""Test script unoconverter"""
mimemapper = dict(filter_list=[('doc',
mimemapper = dict(filter_list=[('doc',
'com.sun.star.text.TextDocument',
'MS Word 97')],
doc_type_list_by_extension=dict(doc=['com.sun.star.text.TextDocument']))
mimemapper_pickled = json.dumps(mimemapper)
python = join(self.office_binary_path, "python")
command = [exists(python) and python or "python",
pkg_resources.resource_filename("cloudooo",
pkg_resources.resource_filename("cloudooo",
"handler/ooo/helper/unoconverter.py"),
"--convert",
"--uno_path=%s" % self.uno_path,
......@@ -74,7 +74,7 @@ class TestUnoConverter(CloudoooTestCase):
"--destination_format=%s" % "doc",
"--source_format=%s" % "odt",
"--mimemapper=%s" % mimemapper_pickled]
stdout, stderr = Popen(command,
stdout, stderr = Popen(command,
stdout=PIPE,
stderr=PIPE).communicate()
self.assertEquals(stderr, '')
......
......@@ -61,7 +61,7 @@ class TestUnoMimeMapper(CloudoooTestCase):
"--office_binary_path=%s" % self.office_binary_path,
"--hostname=%s" % self.hostname,
"--port=%s" % self.openoffice_port]
stdout, stderr = Popen(command,
stdout, stderr = Popen(command,
stdout=PIPE,
stderr=PIPE).communicate()
self.assertEquals(stderr, '')
......@@ -78,7 +78,7 @@ class TestUnoMimeMapper(CloudoooTestCase):
""" Test call unomimemapper without uno_path and office_binary_path"""
hostname, host = openoffice.getAddress()
command = [path.join(self.office_binary_path, "python"),
pkg_resources.resource_filename("cloudooo",
pkg_resources.resource_filename("cloudooo",
"handler/ooo/helper/unomimemapper.py"),
"--hostname=%s" % self.hostname,
"--port=%s" % self.openoffice_port]
......@@ -102,7 +102,7 @@ class TestUnoMimeMapper(CloudoooTestCase):
openoffice.stop()
python = path.join(self.office_binary_path, "python")
command = [path.exists(python) and python or "python",
pkg_resources.resource_filename("cloudooo",
pkg_resources.resource_filename("cloudooo",
"handler/ooo/helper/unomimemapper.py"),
"--uno_path=%s" % self.uno_path,
"--office_binary_path=%s" % self.office_binary_path,
......
......@@ -4,8 +4,8 @@ use = egg:cloudooo
## System config
#
debug_mode = True
# Folder where pid files, lock files and virtual frame buffer mappings
# are stored. In this folder is necessary create a folder tmp, because this
# Folder where pid files, lock files and virtual frame buffer mappings
# are stored. In this folder is necessary create a folder tmp, because this
# folder is used to create all temporary documents.
working_path = /hd/cloudooo/run
# Folder where OpenOffice Uno interpreter is installed
......@@ -15,7 +15,7 @@ office_binary_path = /opt/openoffice.org3/program
#
## Monitor Settings
#
# Limit to use the Openoffice Instance. if pass of the limit, the instance is
# Limit to use the Openoffice Instance. if pass of the limit, the instance is
# stopped and another is started.
limit_number_request = 100
# Interval to check the factory
......
......@@ -4,8 +4,8 @@ use = egg:cloudooo
## System config
#
debug_mode = True
# Folder where pid files, lock files and virtual frame buffer mappings
# are stored. In this folder is necessary create a folder tmp, because this
# Folder where pid files, lock files and virtual frame buffer mappings
# are stored. In this folder is necessary create a folder tmp, because this
# folder is used to create all temporary documents.
working_path = /hd/cloudooo/run
# Folder where OpenOffice Uno interpreter is installed
......@@ -15,7 +15,7 @@ office_binary_path = /opt/openoffice.org3/program
#
## Monitor Settings
#
# Limit to use the Openoffice Instance. if pass of the limit, the instance is
# Limit to use the Openoffice Instance. if pass of the limit, the instance is
# stopped and another is started.
limit_number_request = 100
# Interval to check the factory
......
......@@ -6,8 +6,8 @@ version = '1.2.1'
folder_path = path.abspath(path.dirname(__file__)) + "/cloudooo"
long_description = "%s\n%s" % (open(path.join(folder_path, "README.txt")).read(),
open(path.join(folder_path, "CHANGES.txt")).read())
long_description = "%s\n%s" % (open(path.join(folder_path, "README.txt")).read(),
open(path.join(folder_path, "CHANGES.txt")).read())
install_require_list = [
# -*- Extra requirements: -*-
'zope.interface',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment