Commit 89d754f2 authored by Gabriel Monnerat's avatar Gabriel Monnerat

rename attributes requested by luke:

  - office_bin_path -> office_binary_path
  - path_dir_run_cloudooo -> working_path


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@37986 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 80bc4448
...@@ -80,17 +80,17 @@ class OpenOffice(Application): ...@@ -80,17 +80,17 @@ class OpenOffice(Application):
self.request = 0 self.request = 0
def loadSettings(self, hostname, port, path_run_dir, display_id, def loadSettings(self, hostname, port, path_run_dir, display_id,
office_bin_path, uno_path, **kw): office_binary_path, uno_path, **kw):
"""Method to load the configuratio to control one OpenOffice Instance """Method to load the configuratio to control one OpenOffice Instance
Keyword arguments: Keyword arguments:
office_path -- Full Path of the OOo executable. office_path -- Full Path of the OOo executable.
e.g office_bin_path='/opt/openoffice.org3/program' e.g office_binary_path='/opt/openoffice.org3/program'
uno_path -- Full path of the Uno Library uno_path -- Full path of the Uno Library
""" """
Application.loadSettings(self, hostname, port, path_run_dir, display_id) Application.loadSettings(self, hostname, port, path_run_dir, display_id)
setUpUnoEnvironment(uno_path, office_bin_path) setUpUnoEnvironment(uno_path, office_binary_path)
self.office_bin_path = office_bin_path self.office_binary_path = office_binary_path
self.uno_path = uno_path self.uno_path = uno_path
self.process_name = "soffice.bin" self.process_name = "soffice.bin"
self.document_url = kw.get('document_url', '') self.document_url = kw.get('document_url', '')
...@@ -114,7 +114,7 @@ class OpenOffice(Application): ...@@ -114,7 +114,7 @@ class OpenOffice(Application):
if exists(self.path_user_installation): if exists(self.path_user_installation):
removeDirectory(self.path_user_installation) removeDirectory(self.path_user_installation)
# Create command with all parameters to start the instance # Create command with all parameters to start the instance
self.command = [join(self.office_bin_path, self._bin_soffice) self.command = [join(self.office_binary_path, self._bin_soffice)
, '-invisible' , '-invisible'
, '-nologo' , '-nologo'
, '-nodefault' , '-nodefault'
......
...@@ -53,7 +53,7 @@ Options: ...@@ -53,7 +53,7 @@ Options:
--document_url=STRING_URL --document_url=STRING_URL
URL of document to load in OpenOffice URL of document to load in OpenOffice
--office_bin_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
Folter path were is the uno library Folter path were is the uno library
...@@ -196,7 +196,7 @@ def main(): ...@@ -196,7 +196,7 @@ 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_bin_path=", "uno_path=", "office_binary_path=",
"hostname=", "port=", "source_format=", "hostname=", "port=", "source_format=",
"document_url=", "destination_format=", "document_url=", "destination_format=",
"mimemapper=", "metadata=", "mimemapper=", "metadata=",
...@@ -217,9 +217,9 @@ def main(): ...@@ -217,9 +217,9 @@ def main():
port = arg port = arg
elif opt == '--document_url': elif opt == '--document_url':
document_url = arg document_url = arg
elif opt == '--office_bin_path': elif opt == '--office_binary_path':
environ['office_bin_path'] = arg environ['office_binary_path'] = arg
office_bin_path = arg office_binary_path = arg
elif opt == '--uno_path': elif opt == '--uno_path':
environ['uno_path'] = arg environ['uno_path'] = arg
uno_path = arg uno_path = arg
...@@ -241,8 +241,8 @@ def main(): ...@@ -241,8 +241,8 @@ def main():
if "uno_path" in locals(): if "uno_path" in locals():
kw['uno_path'] = uno_path kw['uno_path'] = uno_path
if "office_bin_path" in locals(): if "office_binary_path" in locals():
kw['office_bin_path'] = office_bin_path kw['office_binary_path'] = office_binary_path
if "unomimemapper_bin" in locals(): if "unomimemapper_bin" in locals():
kw['unomimemapper_bin'] = unomimemapper_bin kw['unomimemapper_bin'] = unomimemapper_bin
......
...@@ -44,7 +44,7 @@ Options: ...@@ -44,7 +44,7 @@ Options:
--port=STRING OpenOffice Instance port --port=STRING OpenOffice Instance port
--office_bin_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
Folter path were is the uno library Folter path were is the uno library
...@@ -94,7 +94,7 @@ def help(): ...@@ -94,7 +94,7 @@ def help():
def main(): def main():
try: try:
opt_list, arg_list = getopt(sys.argv[1:], "h", ["help", opt_list, arg_list = getopt(sys.argv[1:], "h", ["help",
"uno_path=", "office_bin_path=", "uno_path=", "office_binary_path=",
"hostname=", "port="]) "hostname=", "port="])
except GetoptError, msg: except GetoptError, msg:
msg = msg.msg + "\nUse --help or -h" msg = msg.msg + "\nUse --help or -h"
...@@ -109,8 +109,8 @@ def main(): ...@@ -109,8 +109,8 @@ def main():
help() help()
if opt == "--uno_path": if opt == "--uno_path":
environ['uno_path'] = arg environ['uno_path'] = arg
elif opt == "--office_bin_path": elif opt == "--office_binary_path":
environ['office_bin_path'] = arg environ['office_binary_path'] = arg
elif opt == '--hostname': elif opt == '--hostname':
hostname = arg hostname = arg
elif opt == "--port": elif opt == "--port":
......
...@@ -47,16 +47,16 @@ def application(global_config, **local_config): ...@@ -47,16 +47,16 @@ def application(global_config, **local_config):
Keyword arguments: Keyword arguments:
debug_mode -- Mode as the application prints the messages. debug_mode -- Mode as the application prints the messages.
e.g debug_mode=logging.DEBUG e.g debug_mode=logging.DEBUG
path_dir_run_cloudooo -- Full path to create the environment of the processes. working_path -- Full path to create the environment of the processes.
e.g path_dir_run_cloudooo='/var/run/cloudooo' e.g working_path='/var/run/cloudooo'
virtual_display_port -- Port to start the Xvfb. virtual_display_port -- Port to start the Xvfb.
virtual_display_id -- Sets the display. virtual_display_id -- Sets the display.
e.g virtual_display_id='99' e.g virtual_display_id='99'
application_hostname -- Sets the host to Xvfb and Openoffice. application_hostname -- Sets the host to Xvfb and Openoffice.
virtual_screen -- Use to define the screen to Xvfb virtual_screen -- Use to define the screen to Xvfb
e.g virtual_screen='0' e.g virtual_screen='0'
office_bin_path -- Full Path of the OOo executable. office_binary_path -- Full Path of the OOo executable.
e.g office_bin_path='/opt/openoffice.org3/program' e.g office_binary_path='/opt/openoffice.org3/program'
uno_path -- Full path to pyuno library. uno_path -- Full path to pyuno library.
e.g uno_path='/opt/openoffice.org/program' e.g uno_path='/opt/openoffice.org/program'
""" """
...@@ -64,11 +64,11 @@ def application(global_config, **local_config): ...@@ -64,11 +64,11 @@ def application(global_config, **local_config):
debug_mode = convertStringToBool(local_config.get('debug_mode')) debug_mode = convertStringToBool(local_config.get('debug_mode'))
configureLogger(debug_mode=debug_mode) configureLogger(debug_mode=debug_mode)
# path of directory to run cloudooo # path of directory to run cloudooo
path_dir_run_cloudooo = local_config.get('path_dir_run_cloudooo') working_path = local_config.get('working_path')
if not path.exists(path_dir_run_cloudooo): if not path.exists(working_path):
mkdir(path_dir_run_cloudooo) mkdir(working_path)
# directory to create temporary files # directory to create temporary files
cloudooo_path_tmp_dir = path.join(path_dir_run_cloudooo, 'tmp') cloudooo_path_tmp_dir = path.join(working_path, 'tmp')
if not path.exists(cloudooo_path_tmp_dir): if not path.exists(cloudooo_path_tmp_dir):
mkdir(cloudooo_path_tmp_dir) mkdir(cloudooo_path_tmp_dir)
# The Xvfb will run in the same local of the OpenOffice # The Xvfb will run in the same local of the OpenOffice
...@@ -77,7 +77,7 @@ def application(global_config, **local_config): ...@@ -77,7 +77,7 @@ def application(global_config, **local_config):
# Before start Xvfb, first loads the configuration # Before start Xvfb, first loads the configuration
xvfb.loadSettings(application_hostname, xvfb.loadSettings(application_hostname,
int(local_config.get('virtual_display_port')), int(local_config.get('virtual_display_port')),
path_dir_run_cloudooo, working_path,
local_config.get('virtual_display_id'), local_config.get('virtual_display_id'),
virtual_screen=local_config.get('virtual_screen'), virtual_screen=local_config.get('virtual_screen'),
start_timeout=local_config.get('start_timeout')) start_timeout=local_config.get('start_timeout'))
...@@ -86,9 +86,9 @@ def application(global_config, **local_config): ...@@ -86,9 +86,9 @@ def application(global_config, **local_config):
# Loading Configuration to start OOo Instance and control it # Loading Configuration to start OOo Instance and control it
openoffice.loadSettings(application_hostname, openoffice.loadSettings(application_hostname,
openoffice_port, openoffice_port,
path_dir_run_cloudooo, working_path,
local_config.get('virtual_display_id'), local_config.get('virtual_display_id'),
local_config.get('office_bin_path'), local_config.get('office_binary_path'),
local_config.get('uno_path')) local_config.get('uno_path'))
openoffice.start() openoffice.start()
......
...@@ -56,14 +56,14 @@ class OOHandler: ...@@ -56,14 +56,14 @@ class OOHandler:
source_format) source_format)
self.zip = kw.get('zip', False) self.zip = kw.get('zip', False)
self.uno_path = kw.get("uno_path", None) self.uno_path = kw.get("uno_path", None)
self.office_bin_path = kw.get("office_bin_path", None) self.office_binary_path = kw.get("office_binary_path", None)
self.timeout = kw.get("timeout", 600) self.timeout = kw.get("timeout", 600)
self.unoconverter_bin = kw.get('unoconverter_bin', "unoconverter") self.unoconverter_bin = kw.get('unoconverter_bin', "unoconverter")
self.source_format = source_format self.source_format = source_format
if not self.uno_path: if not self.uno_path:
self.uno_path = environ.get("uno_path") self.uno_path = environ.get("uno_path")
if not self.office_bin_path: if not self.office_binary_path:
self.office_bin_path = environ.get("office_bin_path") self.office_binary_path = environ.get("office_binary_path")
def _getCommand(self, *args, **kw): def _getCommand(self, *args, **kw):
"""Transforms all parameters passed in a command""" """Transforms all parameters passed in a command"""
...@@ -74,7 +74,7 @@ class OOHandler: ...@@ -74,7 +74,7 @@ class OOHandler:
, "-c" , "-c"
, "'from cloudooo.bin.unoconverter import main;main()'" , "'from cloudooo.bin.unoconverter import main;main()'"
, "--uno_path='%s'" % self.uno_path , "--uno_path='%s'" % self.uno_path
, "--office_bin_path='%s'" % self.office_bin_path , "--office_binary_path='%s'" % self.office_binary_path
, "--document_url='%s'" % self.document.getUrl()] , "--document_url='%s'" % self.document.getUrl()]
for arg in args: for arg in args:
command_list.insert(3, "'--%s'" % arg) command_list.insert(3, "'--%s'" % arg)
......
...@@ -43,8 +43,8 @@ class IApplication(Interface): ...@@ -43,8 +43,8 @@ class IApplication(Interface):
def loadSettings(hostname, def loadSettings(hostname,
port, port,
virtual_display_id, virtual_display_id,
path_dir_run_cloudooo, working_path,
office_bin_path): office_binary_path):
"""Load configuration to control OOo Instances""" """Load configuration to control OOo Instances"""
def status(): def status():
......
...@@ -96,19 +96,19 @@ class MimeMapper(object): ...@@ -96,19 +96,19 @@ class MimeMapper(object):
port -- port to connects by socket port -- port to connects by socket
**kw: **kw:
uno_path -- full path to uno library uno_path -- full path to uno library
office_bin_path -- full path to openoffice binary office_binary_path -- full path to openoffice binary
""" """
# Filters that has flag in bad_flag_list is ignored. # Filters that has flag in bad_flag_list is ignored.
# XXX - Is not good way to remove unnecessary filters # XXX - Is not good way to remove unnecessary filters
# XXX - try find a good way to remove filters that are not used for export # XXX - try find a good way to remove filters that are not used for export
bad_flag_list = [65, 94217, 536641, 1572929, 268959937, 524373, 85, 524353] bad_flag_list = [65, 94217, 536641, 1572929, 268959937, 524373, 85, 524353]
uno_path = kw.get("uno_path", environ.get('uno_path')) uno_path = kw.get("uno_path", environ.get('uno_path'))
office_bin_path = kw.get("office_bin_path", environ.get('office_bin_path')) office_binary_path = kw.get("office_binary_path", environ.get('office_binary_path'))
command = [python_path command = [python_path
, "'-c'" , "'-c'"
, "'from cloudooo.bin.unomimemapper import main;main()'" , "'from cloudooo.bin.unomimemapper import main;main()'"
, "'--uno_path=%s'" % uno_path , "'--uno_path=%s'" % uno_path
, "'--office_bin_path=%s'" % office_bin_path , "'--office_binary_path=%s'" % office_binary_path
, "'--hostname=%s'" % hostname, "--port=%s" % port] , "'--hostname=%s'" % hostname, "--port=%s" % port]
stdout, stderr = Popen(' '.join(command), stdout, stderr = Popen(' '.join(command),
stdout=PIPE, stdout=PIPE,
......
...@@ -30,7 +30,7 @@ from os import environ, putenv ...@@ -30,7 +30,7 @@ from os import environ, putenv
from sys import path from sys import path
from os.path import exists from os.path import exists
def setUpUnoEnvironment(uno_path=None, office_bin_path=None): def setUpUnoEnvironment(uno_path=None, office_binary_path=None):
"""Set up the environment to use the uno library and connect with the """Set up the environment to use the uno library and connect with the
openoffice by socket""" openoffice by socket"""
if uno_path is not None: if uno_path is not None:
...@@ -38,15 +38,15 @@ def setUpUnoEnvironment(uno_path=None, office_bin_path=None): ...@@ -38,15 +38,15 @@ def setUpUnoEnvironment(uno_path=None, office_bin_path=None):
else: else:
uno_path = environ.get('uno_path') uno_path = environ.get('uno_path')
if office_bin_path is not None: if office_binary_path is not None:
environ['office_bin_path'] = office_bin_path environ['office_binary_path'] = office_binary_path
else: else:
office_bin_path = environ.get('office_bin_path') office_binary_path = environ.get('office_binary_path')
# Add in sys.path the path of pyuno # Add in sys.path the path of pyuno
if uno_path not in path: if uno_path not in path:
path.append(uno_path) path.append(uno_path)
fundamentalrc_file = '%s/fundamentalrc' % office_bin_path fundamentalrc_file = '%s/fundamentalrc' % office_binary_path
if exists(fundamentalrc_file) and \ if exists(fundamentalrc_file) and \
not environ.has_key('URE_BOOTSTRAP'): not environ.has_key('URE_BOOTSTRAP'):
putenv('URE_BOOTSTRAP','vnd.sun.star.pathname:%s' % fundamentalrc_file) putenv('URE_BOOTSTRAP','vnd.sun.star.pathname:%s' % fundamentalrc_file)
......
...@@ -25,8 +25,6 @@ enable_memory_monitor = True ...@@ -25,8 +25,6 @@ enable_memory_monitor = True
# Set the limit in MB # Set the limit in MB
# e.g 1000 = 1 GB, 100 = 100 MB # e.g 1000 = 1 GB, 100 = 100 MB
limit_memory_used = 1000 limit_memory_used = 1000
# Filename that will be used to test the connection with openoffice.
document_name = test.odt
# #
## OOFactory Settings ## OOFactory Settings
# #
......
...@@ -40,9 +40,9 @@ config = ConfigParser() ...@@ -40,9 +40,9 @@ config = ConfigParser()
testcase_path = path.dirname(__file__) testcase_path = path.dirname(__file__)
def check_folder(path_dir_run_cloudooo, tmp_dir_path): def check_folder(working_path, tmp_dir_path):
if not path.exists(path_dir_run_cloudooo): if not path.exists(working_path):
mkdir(path_dir_run_cloudooo) mkdir(working_path)
if not path.exists(tmp_dir_path): if not path.exists(tmp_dir_path):
mkdir(tmp_dir_path) mkdir(tmp_dir_path)
...@@ -61,32 +61,32 @@ def startFakeEnvironment(start_openoffice=True, conf_path=None): ...@@ -61,32 +61,32 @@ def startFakeEnvironment(start_openoffice=True, conf_path=None):
conf_path = sys.argv[1] conf_path = sys.argv[1]
loadConfig(conf_path) loadConfig(conf_path)
uno_path = config.get("app:main", "uno_path") uno_path = config.get("app:main", "uno_path")
path_dir_run_cloudooo = config.get("app:main", "path_dir_run_cloudooo") working_path = config.get("app:main", "working_path")
virtual_display_id = int(config.get("app:main", "virtual_display_id")) virtual_display_id = int(config.get("app:main", "virtual_display_id"))
virtual_display_port_int = int(config.get("app:main", "virtual_display_port")) virtual_display_port_int = int(config.get("app:main", "virtual_display_port"))
hostname = config.get("server:main", "host") hostname = config.get("server:main", "host")
openoffice_port = int(config.get("app:main", "openoffice_port")) openoffice_port = int(config.get("app:main", "openoffice_port"))
office_bin_path = config.get("app:main", "office_bin_path") office_binary_path = config.get("app:main", "office_binary_path")
tmp_dir = path.join(path_dir_run_cloudooo, 'tmp') tmp_dir = path.join(working_path, 'tmp')
check_folder(path_dir_run_cloudooo, tmp_dir) check_folder(working_path, tmp_dir)
if not environ.get('uno_path'): if not environ.get('uno_path'):
environ['uno_path'] = uno_path environ['uno_path'] = uno_path
office_bin_path = config.get("app:main", "office_bin_path") office_binary_path = config.get("app:main", "office_binary_path")
if not environ.get('office_bin_path'): if not environ.get('office_binary_path'):
environ['office_bin_path'] = office_bin_path environ['office_binary_path'] = office_binary_path
if uno_path not in sys.path: if uno_path not in sys.path:
sys.path.append(uno_path) sys.path.append(uno_path)
fundamentalrc_file = '%s/fundamentalrc' % office_bin_path fundamentalrc_file = '%s/fundamentalrc' % office_binary_path
if path.exists(fundamentalrc_file) and \ if path.exists(fundamentalrc_file) and \
not environ.has_key('URE_BOOTSTRAP'): not environ.has_key('URE_BOOTSTRAP'):
putenv('URE_BOOTSTRAP','vnd.sun.star.pathname:%s' % fundamentalrc_file) putenv('URE_BOOTSTRAP','vnd.sun.star.pathname:%s' % fundamentalrc_file)
xvfb.loadSettings(hostname, xvfb.loadSettings(hostname,
virtual_display_port_int, virtual_display_port_int,
path_dir_run_cloudooo, working_path,
virtual_display_id, virtual_display_id,
virtual_screen='1') virtual_screen='1')
xvfb.start() xvfb.start()
...@@ -95,15 +95,15 @@ def startFakeEnvironment(start_openoffice=True, conf_path=None): ...@@ -95,15 +95,15 @@ def startFakeEnvironment(start_openoffice=True, conf_path=None):
if start_openoffice: if start_openoffice:
openoffice.loadSettings(hostname, openoffice.loadSettings(hostname,
openoffice_port, openoffice_port,
path_dir_run_cloudooo, working_path,
virtual_display_id, virtual_display_id,
office_bin_path, office_binary_path,
uno_path) uno_path)
openoffice.start() openoffice.start()
openoffice.acquire() openoffice.acquire()
hostname, port = openoffice.getAddress() hostname, port = openoffice.getAddress()
kw = dict(uno_path=config.get("app:main", "uno_path"), kw = dict(uno_path=config.get("app:main", "uno_path"),
office_bin_path=config.get("app:main", "office_bin_path")) office_binary_path=config.get("app:main", "office_binary_path"))
if not mimemapper.isLoaded(): if not mimemapper.isLoaded():
mimemapper.loadFilterList(hostname, port, **kw) mimemapper.loadFilterList(hostname, port, **kw)
openoffice.release() openoffice.release()
...@@ -127,11 +127,11 @@ class cloudoooTestCase(unittest.TestCase): ...@@ -127,11 +127,11 @@ class cloudoooTestCase(unittest.TestCase):
self.hostname = config.get("server:main", "host") self.hostname = config.get("server:main", "host")
self.cloudooo_port = config.get("server:main", "port") self.cloudooo_port = config.get("server:main", "port")
self.openoffice_port = config.get("app:main", "openoffice_port") self.openoffice_port = config.get("app:main", "openoffice_port")
self.office_bin_path = config.get("app:main", "office_bin_path") self.office_binary_path = config.get("app:main", "office_binary_path")
self.python_path = sys.executable self.python_path = sys.executable
self.path_dir_run_cloudooo = config.get("app:main", "path_dir_run_cloudooo") self.working_path = config.get("app:main", "working_path")
self.tmp_url = path.join(self.path_dir_run_cloudooo, "tmp") self.tmp_url = path.join(self.working_path, "tmp")
check_folder(self.path_dir_run_cloudooo, self.tmp_url) check_folder(self.working_path, self.tmp_url)
self.uno_path = config.get("app:main", "uno_path") self.uno_path = config.get("app:main", "uno_path")
self.virtual_display_id = config.get("app:main", "virtual_display_id") self.virtual_display_id = config.get("app:main", "virtual_display_id")
self.virtual_display_port_int = config.get("app:main", "virtual_display_port") self.virtual_display_port_int = config.get("app:main", "virtual_display_port")
......
...@@ -39,9 +39,9 @@ class TestOpenOffice(cloudoooTestCase): ...@@ -39,9 +39,9 @@ class TestOpenOffice(cloudoooTestCase):
"""Instantiate one OpenOffice""" """Instantiate one OpenOffice"""
self.openoffice = OpenOffice() self.openoffice = OpenOffice()
self.openoffice.loadSettings("localhost", 4090, self.openoffice.loadSettings("localhost", 4090,
self.path_dir_run_cloudooo, self.working_path,
self.virtual_display_id, self.virtual_display_id,
self.office_bin_path, self.office_binary_path,
self.uno_path, self.uno_path,
openoffice_tester_bin=self.openoffice_tester_bin) openoffice_tester_bin=self.openoffice_tester_bin)
self.openoffice.start() self.openoffice.start()
......
...@@ -60,7 +60,7 @@ class TestUnoConverter(cloudoooTestCase): ...@@ -60,7 +60,7 @@ class TestUnoConverter(cloudoooTestCase):
"'from cloudooo.bin.unoconverter import main;main()'", "'from cloudooo.bin.unoconverter import main;main()'",
"'--convert'", "'--convert'",
"'--uno_path=%s'" % self.uno_path, "'--uno_path=%s'" % self.uno_path,
"'--office_bin_path=%s'" % self.office_bin_path, "'--office_binary_path=%s'" % self.office_binary_path,
"'--hostname=%s'" % self.hostname, "'--hostname=%s'" % self.hostname,
"'--port=%s'" % self.port, "'--port=%s'" % self.port,
"'--document_url=%s'" % self.document.getUrl(), "'--document_url=%s'" % self.document.getUrl(),
...@@ -89,7 +89,7 @@ class TestUnoConverter(cloudoooTestCase): ...@@ -89,7 +89,7 @@ class TestUnoConverter(cloudoooTestCase):
"'from cloudooo.bin.unoconverter import main;main()'", "'from cloudooo.bin.unoconverter import main;main()'",
"'--convert'", "'--convert'",
"'--uno_path=%s'" % self.uno_path, "'--uno_path=%s'" % self.uno_path,
"'--office_bin_path=%s'" % self.office_bin_path, "'--office_binary_path=%s'" % self.office_binary_path,
"'--hostname=%s'" % self.hostname, "'--hostname=%s'" % self.hostname,
"'--port=%s'" % self.port, "'--port=%s'" % self.port,
"'--document_url=%s'" % self.document.getUrl(), "'--document_url=%s'" % self.document.getUrl(),
......
...@@ -38,13 +38,13 @@ class TestUnoMimeMapper(cloudoooTestCase): ...@@ -38,13 +38,13 @@ class TestUnoMimeMapper(cloudoooTestCase):
def afterSetUp(self): def afterSetUp(self):
""" """ """ """
environ['uno_path'] = '' environ['uno_path'] = ''
environ['office_bin_path'] = '' environ['office_binary_path'] = ''
openoffice.acquire() openoffice.acquire()
def tearDown(self): def tearDown(self):
""" """ """ """
environ['uno_path'] = self.uno_path environ['uno_path'] = self.uno_path
environ['office_bin_path'] = self.office_bin_path environ['office_binary_path'] = self.office_binary_path
openoffice.release() openoffice.release()
def testCreateLocalAttributes(self): def testCreateLocalAttributes(self):
...@@ -54,7 +54,7 @@ class TestUnoMimeMapper(cloudoooTestCase): ...@@ -54,7 +54,7 @@ class TestUnoMimeMapper(cloudoooTestCase):
"-c", "-c",
"'from cloudooo.bin.unomimemapper import main; main()'", "'from cloudooo.bin.unomimemapper import main; main()'",
"'--uno_path=%s'" % self.uno_path, "'--uno_path=%s'" % self.uno_path,
"'--office_bin_path=%s'" % self.uno_path, "'--office_binary_path=%s'" % self.uno_path,
"'--hostname=%s'" % self.hostname, "'--hostname=%s'" % self.hostname,
"'--port=%s'" % self.openoffice_port] "'--port=%s'" % self.openoffice_port]
stdout, stderr = Popen(' '.join(command), shell=True, stdout, stderr = Popen(' '.join(command), shell=True,
...@@ -69,7 +69,7 @@ class TestUnoMimeMapper(cloudoooTestCase): ...@@ -69,7 +69,7 @@ class TestUnoMimeMapper(cloudoooTestCase):
self.assertEquals(stderr, '') self.assertEquals(stderr, '')
def testCallUnoMimemapperWithoutSomeParameters(self): def testCallUnoMimemapperWithoutSomeParameters(self):
""" Test call unomimemapper without uno_path and office_bin_path""" """ Test call unomimemapper without uno_path and office_binary_path"""
hostname, host = openoffice.getAddress() hostname, host = openoffice.getAddress()
command = [self.python_path, command = [self.python_path,
"-c", "-c",
...@@ -90,7 +90,7 @@ class TestUnoMimeMapper(cloudoooTestCase): ...@@ -90,7 +90,7 @@ class TestUnoMimeMapper(cloudoooTestCase):
"-c", "-c",
"'from cloudooo.bin.unomimemapper import main; main()'", "'from cloudooo.bin.unomimemapper import main; main()'",
"'--uno_path=%s'" % self.uno_path, "'--uno_path=%s'" % self.uno_path,
"'--office_bin_path=%s'" % self.uno_path, "'--office_binary_path=%s'" % self.uno_path,
"'--hostname=%s'" % self.hostname, "'--hostname=%s'" % self.hostname,
"'--port=%s'" % self.openoffice_port] "'--port=%s'" % self.openoffice_port]
stdout, stderr = Popen(' '.join(command), shell=True, stdout, stderr = Popen(' '.join(command), shell=True,
......
...@@ -38,7 +38,7 @@ class TestXvfb(cloudoooTestCase): ...@@ -38,7 +38,7 @@ class TestXvfb(cloudoooTestCase):
self.xvfb = Xvfb() self.xvfb = Xvfb()
self.xvfb.loadSettings(self.hostname, self.xvfb.loadSettings(self.hostname,
int(self.virtual_display_port_int), int(self.virtual_display_port_int),
self.path_dir_run_cloudooo, self.working_path,
self.virtual_display_id, self.virtual_display_id,
virtual_screen='1') virtual_screen='1')
......
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