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