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."""
......
...@@ -40,7 +40,7 @@ references to <a href="#server">server-side techniques needed</a>, ...@@ -40,7 +40,7 @@ references to <a href="#server">server-side techniques needed</a>,
<a href="#moz">Mozilla</a>, <a href="#moz">Mozilla</a>,
<a href="#opera">Opera</a>, <a href="#opera">Opera</a>,
<a href="#safari">Safari</a>; <a href="#safari">Safari</a>;
<a href="#warn">users&#8217; problems with file input</a>; <a href="#warn">users&#8217; problems with file input</a>;
<a href="#present">appearance of the Browse button and the filename box</a> <a href="#present">appearance of the Browse button and the filename box</a>
</li><li><a href="#acc">accessibility problems: file input is a challenge to many users</a> </li><li><a href="#acc">accessibility problems: file input is a challenge to many users</a>
</li><li> <a href="#alt">suggestions for allowing </li><li> <a href="#alt">suggestions for allowing
...@@ -99,7 +99,7 @@ don&#8217;t even dream about using ...@@ -99,7 +99,7 @@ don&#8217;t even dream about using
in this context or otherwise! in this context or otherwise!
</li><li> it has the attribute </li><li> it has the attribute
<a href="http://www.cs.tut.fi/%7Ejkorpela/forms/methods.html" title="Methods GET and POST in HTML forms&#8212;what&#8217;s the difference?"> <a href="http://www.cs.tut.fi/%7Ejkorpela/forms/methods.html" title="Methods GET and POST in HTML forms&#8212;what&#8217;s the difference?">
<code>method="post"</code></a> <code>method="post"</code></a>
</li><li> it has the attribute </li><li> it has the attribute
<code><a href="#enctype">enctype</a>="multipart/form-data"</code> <code><a href="#enctype">enctype</a>="multipart/form-data"</code>
</li><li> it contains a field </li><li> it contains a field
...@@ -126,7 +126,7 @@ box in current browsers is rather narrow for typical filenames. ...@@ -126,7 +126,7 @@ box in current browsers is rather narrow for typical filenames.
<p><small>Minimally, the form needs to contain a <p><small>Minimally, the form needs to contain a
<a title="Description of INPUT TYPE=SUBMIT in WDG&#8217;s HTML 4.0 reference" href="http://www.htmlhelp.com/reference/html40/forms/input.html#submit"> <a title="Description of INPUT TYPE=SUBMIT in WDG&#8217;s HTML 4.0 reference" href="http://www.htmlhelp.com/reference/html40/forms/input.html#submit">
a submit element</a> too. It may also contain any other fields you like, a submit element</a> too. It may also contain any other fields you like,
and explanatory texts, images, etc.</small></p> and explanatory texts, images, etc.</small></p>
<p class="warning"><a name="goofs">A common problem with file input <p class="warning"><a name="goofs">A common problem with file input
in forms</a> is that form data gets sent but only the <em>name</em> in forms</a> is that form data gets sent but only the <em>name</em>
...@@ -134,7 +134,7 @@ of the file is included. The reason is typically that the <code>form</code> ...@@ -134,7 +134,7 @@ of the file is included. The reason is typically that the <code>form</code>
element does not contain the attributes mentioned above.</p> element does not contain the attributes mentioned above.</p>
<p>Since <a href="#support">browser support</a> to file input <p>Since <a href="#support">browser support</a> to file input
is still problematic, consider is still problematic, consider
<a href="#alt"><strong>providing alternative methods</strong></a> <a href="#alt"><strong>providing alternative methods</strong></a>
of submitting data, too.</p> of submitting data, too.</p>
...@@ -368,7 +368,7 @@ file, Opera discards the current selection and replaces it with a <em>range</em> ...@@ -368,7 +368,7 @@ file, Opera discards the current selection and replaces it with a <em>range</em>
</li></ul> </li></ul>
<p>It isn&#8217;t perfect though. The Browse window is rather small, and it is <p>It isn&#8217;t perfect though. The Browse window is rather small, and it is
impossible to pick up several ranges, i.e. you must click on the files individually impossible to pick up several ranges, i.e. you must click on the files individually
unless you want to select just one contiguous range. unless you want to select just one contiguous range.
And the box for file names is quite small too, and its size is not And the box for file names is quite small too, and its size is not
affected by the <code>size</code> attribute. affected by the <code>size</code> attribute.
See also <a href="#value">notes on setting the default filename</a>. See also <a href="#value">notes on setting the default filename</a>.
...@@ -432,7 +432,7 @@ the instructions apply to.</small></p> ...@@ -432,7 +432,7 @@ the instructions apply to.</small></p>
<p>The technical problems discussed here are one reason why <p>The technical problems discussed here are one reason why
authors should consider providing <em>alternatives</em> to file input. authors should consider providing <em>alternatives</em> to file input.
There&#8217;s a section on <a href="#acc" title="File input is a challenge to many users">accessibility problems</a> below, There&#8217;s a section on <a href="#acc" title="File input is a challenge to many users">accessibility problems</a> below,
discussing some additional reasons.</p> discussing some additional reasons.</p>
<h3><a name="present">The appearance of the Browse button and the filename box</a></h3> <h3><a name="present">The appearance of the Browse button and the filename box</a></h3>
...@@ -511,7 +511,7 @@ increase the font size and set the font to Courier. Specifically, ...@@ -511,7 +511,7 @@ increase the font size and set the font to Courier. Specifically,
this happened on Netscape&nbsp;4 but not on most other browsers. this happened on Netscape&nbsp;4 but not on most other browsers.
(As a side effect, on Netscape&nbsp;4, such (As a side effect, on Netscape&nbsp;4, such
a font size change affected the dimensions of the Browse a font size change affected the dimensions of the Browse
button but not the font size of the the text &#8220;Browse&#8221;. button but not the font size of the the text &#8220;Browse&#8221;.
Note that Note that
if you included a <code>color</code> attribute there, if you included a <code>color</code> attribute there,
Netscape&nbsp; ignored it.)</small></p> Netscape&nbsp; ignored it.)</small></p>
...@@ -528,7 +528,7 @@ textual content of the HTML document) ...@@ -528,7 +528,7 @@ textual content of the HTML document)
should be formatted according to the font properties of the should be formatted according to the font properties of the
<code>input</code> element. (For example, IE&nbsp;4 and Mozilla seem to <code>input</code> element. (For example, IE&nbsp;4 and Mozilla seem to
apply the font-size property but not the font-family property when apply the font-size property but not the font-family property when
rendering the button text. IE&nbsp;6 applies font-family too.</p> rendering the button text. IE&nbsp;6 applies font-family too.</p>
<p>The following example demonstrates how your browser treats a file <p>The following example demonstrates how your browser treats a file
input element where we suggest presentational properties both in HTML input element where we suggest presentational properties both in HTML
and in CSS:</p> and in CSS:</p>
...@@ -565,7 +565,7 @@ problems in file input. For an overview of what accessibility is and ...@@ -565,7 +565,7 @@ problems in file input. For an overview of what accessibility is and
why it is important, please refer to the why it is important, please refer to the
<cite><a href="http://web.archive.org/web/20030605114512/http://www.diffuse.org/accessibility.html">Guide to Web Accessibility and Design for All</a></cite>.</p> <cite><a href="http://web.archive.org/web/20030605114512/http://www.diffuse.org/accessibility.html">Guide to Web Accessibility and Design for All</a></cite>.</p>
<p>It has been reported that some <p>It has been reported that some
special-purpose browsing software, special-purpose browsing software,
such as some versions of the such as some versions of the
<a href="http://www.freedomscientific.com/fs_products/software_jaws.asp">JAWS</a> screen reader, have serious difficulties in file input. <a href="http://www.freedomscientific.com/fs_products/software_jaws.asp">JAWS</a> screen reader, have serious difficulties in file input.
...@@ -575,7 +575,7 @@ is oriented towards visual interaction.</p> ...@@ -575,7 +575,7 @@ is oriented towards visual interaction.</p>
<p>Even the &#8220;normal&#8221; browsers have serious difficulties in file <p>Even the &#8220;normal&#8221; browsers have serious difficulties in file
input without using a mouse. (There are different reasons, including input without using a mouse. (There are different reasons, including
physiological and neurological problems, why the user may need to work physiological and neurological problems, why the user may need to work
without a mouse or other pointing devide.) without a mouse or other pointing devide.)
In Internet Explorer&nbsp;6, you can select the In Internet Explorer&nbsp;6, you can select the
Browse button by tabbing, but if you try to use Browse button by tabbing, but if you try to use
the keyboard to activate it, hitting the Enter key, the browser the keyboard to activate it, hitting the Enter key, the browser
...@@ -587,16 +587,16 @@ the file selection dialogue. ...@@ -587,16 +587,16 @@ the file selection dialogue.
Netscape&nbsp;7 skips over the browse button Netscape&nbsp;7 skips over the browse button
entirely when tabbing&#8212;it cannot be selected without a mouse.</p> entirely when tabbing&#8212;it cannot be selected without a mouse.</p>
<p><small>Not surprisingly, on Opera things work reasonably. <p><small>Not surprisingly, on Opera things work reasonably.
The user can The user can
select the Browse button using the tab key and activate it select the Browse button using the tab key and activate it
by pressing the enter key, then select a file for upload from the by pressing the enter key, then select a file for upload from the
file system; you would use the arrow keys move around in the file file system; you would use the arrow keys move around in the file
selection.</small></p> selection.</small></p>
<p>On the <a href="http://lynx.browser.org/">Lynx</a> <p>On the <a href="http://lynx.browser.org/">Lynx</a>
text browser, at least on Lynx&nbsp;2.8.4 on Unix, text browser, at least on Lynx&nbsp;2.8.4 on Unix,
there is no Browse button, and there is no dialogue there is no Browse button, and there is no dialogue
for accessing the computer&#8217;s for accessing the computer&#8217;s
file system. Thus, the user needs to know the exact path name and syntax to file system. Thus, the user needs to know the exact path name and syntax to
type in the file name for upload, as is apparently also the case for type in the file name for upload, as is apparently also the case for
IE and Netscape.</p> IE and Netscape.</p>
...@@ -625,14 +625,14 @@ should be submitted.</p> ...@@ -625,14 +625,14 @@ should be submitted.</p>
<p>For example, the explanation could say: &#8220;Please specify, if possible, <p>For example, the explanation could say: &#8220;Please specify, if possible,
an image an image
file containing your photo in JPEG format.&#8221; file containing your photo in JPEG format.&#8221;
Such a note may not help much when a user Such a note may not help much when a user
encounters such a field for the first time in his life, encounters such a field for the first time in his life,
but it helps him to associate the eventual problems with a concept but it helps him to associate the eventual problems with a concept
of file input and to explain his problems when seeking for help. of file input and to explain his problems when seeking for help.
And if he has tried to use file input before, And if he has tried to use file input before,
it tells him to stay tuned to something special, and it tells him to stay tuned to something special, and
perhaps at this point, before entering the file input field, to access the perhaps at this point, before entering the file input field, to access the
file system outside the browser and find the exact path name of the file file system outside the browser and find the exact path name of the file
he wants to submit.</p> he wants to submit.</p>
<h2><a name="alt">How to provide alternatives</a></h2> <h2><a name="alt">How to provide alternatives</a></h2>
...@@ -790,7 +790,7 @@ This type was originally defined in ...@@ -790,7 +790,7 @@ This type was originally defined in
<p><small>Browsers <p><small>Browsers
may support other values too, but are not required to, and it is may support other values too, but are not required to, and it is
generally unsafe to use them. generally unsafe to use them.
Sometimes people use <code>enctype="text/plain"</code>, Sometimes people use <code>enctype="text/plain"</code>,
and <code>text/plain</code> is <i>per se</i> a well-defined media type; and <code>text/plain</code> is <i>per se</i> a well-defined media type;
but there is no specification of the exact method of encoding but there is no specification of the exact method of encoding
...@@ -865,7 +865,7 @@ must then be somehow prepared to handle zipped files. ...@@ -865,7 +865,7 @@ must then be somehow prepared to handle zipped files.
<p>The HTML 4.01 specification <p>The HTML 4.01 specification
<a href="http://www.w3.org/TR/html4/interact/forms.html#h-17.4.1">describes <a href="http://www.w3.org/TR/html4/interact/forms.html#h-17.4.1">describes
the <code>value</code> attribute</a> the <code>value</code> attribute</a>
for a file input field by saying that browsers (user agents) for a file input field by saying that browsers (user agents)
&#8220;may use the value of the <code>value</code> &#8220;may use the value of the <code>value</code>
attribute as the initial file name.&#8221; This however is attribute as the initial file name.&#8221; This however is
...@@ -951,7 +951,7 @@ in the <code>value</code> attribute. ...@@ -951,7 +951,7 @@ in the <code>value</code> attribute.
</p><p>The following form contains a file input field with </p><p>The following form contains a file input field with
<code>value="C:\.emacs"</code>. Your browser probably just ignores <code>value="C:\.emacs"</code>. Your browser probably just ignores
that attribute, but some browsers may use it to set the initial that attribute, but some browsers may use it to set the initial
file name:</p> file name:</p>
<form action="http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi" enctype="multipart/form-data" method="post"> <form action="http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi" enctype="multipart/form-data" method="post">
<div><input name="datafile" value="C:\.emacs" type="file"></div> <div><input name="datafile" value="C:\.emacs" type="file"></div>
<div><input value="Send" type="submit"></div> <div><input value="Send" type="submit"></div>
...@@ -1062,7 +1062,7 @@ clicking on it, the browser puts the filename into the filename box, ...@@ -1062,7 +1062,7 @@ clicking on it, the browser puts the filename into the filename box,
and the name is a full pathname which can be quite long. and the name is a full pathname which can be quite long.
It may confuse users if they see the name badly truncated.</p> It may confuse users if they see the name badly truncated.</p>
<p><a href="http://www.w3.org/TR/REC-html32#input">Definition of <p><a href="http://www.w3.org/TR/REC-html32#input">Definition of
<code>input type="file"</code> in the HTML 3.2 specification</a> <code>input type="file"</code> in the HTML 3.2 specification</a>
said:</p> said:</p>
<blockquote> <blockquote>
...@@ -1117,7 +1117,7 @@ by ignorance, or by misclicking, or by malevolence. ...@@ -1117,7 +1117,7 @@ by ignorance, or by misclicking, or by malevolence.
See section See section
<cite><a href="http://cpan.uwinnipeg.ca/htdocs/CGI.pm/CGI.html#avoiding_denial_of_service_attacks">Avoiding Denial of Service Attacks</a></cite> in the <cite><a href="http://cpan.uwinnipeg.ca/htdocs/CGI.pm/CGI.html#avoiding_denial_of_service_attacks">Avoiding Denial of Service Attacks</a></cite> in the
<a href="http://theoryx5.uwinnipeg.ca/CPAN/data/CGI.pm/CGI.html">documentation of CGI.pm</a>; even if it isn&#8217;t directly applicable <a href="http://theoryx5.uwinnipeg.ca/CPAN/data/CGI.pm/CGI.html">documentation of CGI.pm</a>; even if it isn&#8217;t directly applicable
to you since you use other techniques than CGI and Perl, it to you since you use other techniques than CGI and Perl, it
gives some food for thought in general.</p> gives some food for thought in general.</p>
<p>The server-side form handler can be coded to do whatever the <p>The server-side form handler can be coded to do whatever the
programmer wants, and imposing <em>some</em> upper limit is clearly a must. programmer wants, and imposing <em>some</em> upper limit is clearly a must.
...@@ -1143,11 +1143,11 @@ specifications. On the contrary, the ...@@ -1143,11 +1143,11 @@ specifications. On the contrary, the
<a href="http://www.w3.org/TR/REC-html32#input">HTML 3.2 specification says</a> something quite different: <a href="http://www.w3.org/TR/REC-html32#input">HTML 3.2 specification says</a> something quite different:
</p><blockquote> </p><blockquote>
You can set an upper limit to the length of file names using the You can set an upper limit to the length of file names using the
<code>maxlength</code> attribute. <code>maxlength</code> attribute.
</blockquote> </blockquote>
<p>Thus, it is better not to use the <code>maxlength</code> attribute, <p>Thus, it is better not to use the <code>maxlength</code> attribute,
because it currently does nothing and, worse still, because it currently does nothing and, worse still,
in the future it might be interpreted in two incompatible ways. in the future it might be interpreted in two incompatible ways.
The HTML&nbsp;4 specification takes no position on this: it describes The HTML&nbsp;4 specification takes no position on this: it describes
<code>maxlength</code> as defined for <code>input type="text"</code> <code>maxlength</code> as defined for <code>input type="text"</code>
...@@ -1287,7 +1287,7 @@ officially, i.e. to make it explicit that work on HTML specifications ...@@ -1287,7 +1287,7 @@ officially, i.e. to make it explicit that work on HTML specifications
has been moved from IETF to W3C. It explicitly obsoletes RFC 1867, has been moved from IETF to W3C. It explicitly obsoletes RFC 1867,
together with some other HTML related RFCs. But note that there is together with some other HTML related RFCs. But note that there is
very little in HTML specifications by the W3C that defines very little in HTML specifications by the W3C that defines
what file input really is; they refer to RFC 1867 instead.</p> what file input really is; they refer to RFC 1867 instead.</p>
<p>RFC 1867 contains much more <strong>detailed</strong> information about <p>RFC 1867 contains much more <strong>detailed</strong> information about
&#8220;file upload&#8221; than HTML specifications. It explains the original &#8220;file upload&#8221; than HTML specifications. It explains the original
...@@ -1311,5 +1311,5 @@ the free information site ...@@ -1311,5 +1311,5 @@ the free information site
by by
<a href="http://www.cs.tut.fi/%7Ejkorpela/personal.html" title="Jukka K. Korpela, an IT generalist and specialist (personal home page)"><span lang="fi">Jukka</span> &#8220;Yucca&#8221; <span lang="fi">Korpela</span></a>. <a href="http://www.cs.tut.fi/%7Ejkorpela/personal.html" title="Jukka K. Korpela, an IT generalist and specialist (personal home page)"><span lang="fi">Jukka</span> &#8220;Yucca&#8221; <span lang="fi">Korpela</span></a>.
</div></div> </div></div>
</body></html> </body></html>
\ No newline at end of file
...@@ -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()
......
...@@ -39,33 +39,33 @@ DAEMON = True ...@@ -39,33 +39,33 @@ DAEMON = True
class TestServer(CloudoooTestCase): class TestServer(CloudoooTestCase):
"""Test XmlRpc Server. Needs cloudooo server started""" """Test XmlRpc Server. Needs cloudooo server started"""
def afterSetUp(self): def afterSetUp(self):
"""Creates a connection with cloudooo server""" """Creates a connection with cloudooo server"""
self.proxy = ServerProxy("http://%s:%s/RPC2" % \ self.proxy = ServerProxy("http://%s:%s/RPC2" % \
(self.hostname, self.cloudooo_port), allow_none=True) (self.hostname, self.cloudooo_port), allow_none=True)
# XXX Duplicated list of filters # XXX Duplicated list of filters
self.text_expected_list = [['doc', 'Microsoft Word 6.0'], self.text_expected_list = [['doc', 'Microsoft Word 6.0'],
['doc', 'Microsoft Word 95'], ['doc', 'Microsoft Word 95'],
['doc', 'Microsoft Word 97/2000/XP'], ['doc', 'Microsoft Word 97/2000/XP'],
['docx', 'Microsoft Word 2007 XML'], ['docx', 'Microsoft Word 2007 XML'],
['docx', 'Office Open XML Text'], ['docx', 'Office Open XML Text'],
['htm', 'HTML Document (OpenOffice.org Writer)'], ['htm', 'HTML Document (OpenOffice.org Writer)'],
['html', 'HTML Document (OpenOffice.org Writer)'], ['html', 'HTML Document (OpenOffice.org Writer)'],
['html', 'XHTML'], ['odt', 'ODF Text Document'], ['html', 'XHTML'], ['odt', 'ODF Text Document'],
['ott', 'ODF Text Document Template'], ['ott', 'ODF Text Document Template'],
['pdf', 'PDF - Portable Document Format'], ['pdf', 'PDF - Portable Document Format'],
['rtf', 'Rich Text Format'], ['sdw', 'StarWriter 3.0'], ['rtf', 'Rich Text Format'], ['sdw', 'StarWriter 3.0'],
['sdw', 'StarWriter 4.0'], ['sdw', 'StarWriter 5.0'], ['sdw', 'StarWriter 4.0'], ['sdw', 'StarWriter 5.0'],
['sxw', 'OpenOffice.org 1.0 Text Document'], ['sxw', 'OpenOffice.org 1.0 Text Document'],
['txt', 'Text'], ['txt', 'Text Encoded'], ['txt', 'Text'], ['txt', 'Text Encoded'],
['xhtml', 'XHTML'], ['pdb', 'AportisDoc (Palm)'], ['xhtml', 'XHTML'], ['pdb', 'AportisDoc (Palm)'],
['psw', 'Pocket Word']] ['psw', 'Pocket Word']]
self.text_expected_list.sort() self.text_expected_list.sort()
self.presentation_expected_list = [['bmp', 'BMP - Windows Bitmap'], self.presentation_expected_list = [['bmp', 'BMP - Windows Bitmap'],
['emf', 'EMF - Enhanced Metafile'], ['emf', 'EMF - Enhanced Metafile'],
['eps', 'EPS - Encapsulated PostScript'], ['eps', 'EPS - Encapsulated PostScript'],
['gif', 'GIF - Graphics Interchange Format'], ['gif', 'GIF - Graphics Interchange Format'],
...@@ -80,7 +80,7 @@ class TestServer(CloudoooTestCase): ...@@ -80,7 +80,7 @@ class TestServer(CloudoooTestCase):
['odp', 'ODF Presentation'], ['odp', 'ODF Presentation'],
['otp', 'ODF Presentation Template'], ['otp', 'ODF Presentation Template'],
['pbm', 'PBM - Portable Bitmap'], ['pct', 'PCT - Mac Pict'], ['pbm', 'PBM - Portable Bitmap'], ['pct', 'PCT - Mac Pict'],
['pdf', 'PDF - Portable Document Format'], ['pdf', 'PDF - Portable Document Format'],
['pgm', 'PGM - Portable Graymap'], ['pict', 'PCT - Mac Pict'], ['pgm', 'PGM - Portable Graymap'], ['pict', 'PCT - Mac Pict'],
['png', 'PNG - Portable Network Graphic'], ['png', 'PNG - Portable Network Graphic'],
['pot', 'Microsoft PowerPoint 97/2000/XP Template'], ['pot', 'Microsoft PowerPoint 97/2000/XP Template'],
...@@ -91,13 +91,13 @@ class TestServer(CloudoooTestCase): ...@@ -91,13 +91,13 @@ class TestServer(CloudoooTestCase):
['sda', 'StarDraw 5.0 (OpenOffice.org Impress)'], ['sda', 'StarDraw 5.0 (OpenOffice.org Impress)'],
['sdd', 'StarDraw 3.0 (OpenOffice.org Impress)'], ['sdd', 'StarDraw 3.0 (OpenOffice.org Impress)'],
['sdd', 'StarImpress 4.0'], ['sdd', 'StarImpress 5.0'], ['sdd', 'StarImpress 4.0'], ['sdd', 'StarImpress 5.0'],
['svg', 'SVG - Scalable Vector Graphics'], ['svg', 'SVG - Scalable Vector Graphics'],
['svm', 'SVM - StarView Metafile'], ['svm', 'SVM - StarView Metafile'],
['sxd', 'OpenOffice.org 1.0 Drawing (OpenOffice.org Impress)'], ['sxd', 'OpenOffice.org 1.0 Drawing (OpenOffice.org Impress)'],
['sxi', 'OpenOffice.org 1.0 Presentation'], ['sxi', 'OpenOffice.org 1.0 Presentation'],
['tif', 'TIFF - Tagged Image File Format'], ['tif', 'TIFF - Tagged Image File Format'],
['tiff', 'TIFF - Tagged Image File Format'], ['tiff', 'TIFF - Tagged Image File Format'],
['wmf', 'WMF - Windows Metafile'], ['wmf', 'WMF - Windows Metafile'],
['xhtml', 'XHTML'], ['xpm', 'XPM - X PixMap']] ['xhtml', 'XHTML'], ['xpm', 'XPM - X PixMap']]
self.presentation_expected_list.sort() self.presentation_expected_list.sort()
...@@ -126,22 +126,22 @@ class TestServer(CloudoooTestCase): ...@@ -126,22 +126,22 @@ class TestServer(CloudoooTestCase):
text_allowed_list = self.proxy.getAllowedExtensionList(text_request) text_allowed_list = self.proxy.getAllowedExtensionList(text_request)
text_allowed_list.sort() text_allowed_list.sort()
for arg in text_allowed_list: for arg in text_allowed_list:
self.assertTrue(arg in self.text_expected_list, self.assertTrue(arg in self.text_expected_list,
"%s not in %s" % (arg, self.text_expected_list)) "%s not in %s" % (arg, self.text_expected_list))
request_dict = {'document_type': "presentation"} request_dict = {'document_type': "presentation"}
presentation_allowed_list = self.proxy.getAllowedExtensionList(request_dict) presentation_allowed_list = self.proxy.getAllowedExtensionList(request_dict)
presentation_allowed_list.sort() presentation_allowed_list.sort()
for arg in presentation_allowed_list: for arg in presentation_allowed_list:
self.assertTrue(arg in self.presentation_expected_list, self.assertTrue(arg in self.presentation_expected_list,
"%s not in %s" % (arg, self.presentation_expected_list)) "%s not in %s" % (arg, self.presentation_expected_list))
def testGetAllowedExtensionListByExtension(self): def testGetAllowedExtensionListByExtension(self):
"""Call getAllowedExtensionList and verify if the returns is a list with """Call getAllowedExtensionList and verify if the returns is a list with
extension and ui_name. The request is by extension""" extension and ui_name. The request is by extension"""
doc_allowed_list = self.proxy.getAllowedExtensionList({'extension': "doc"}) doc_allowed_list = self.proxy.getAllowedExtensionList({'extension': "doc"})
doc_allowed_list.sort() doc_allowed_list.sort()
for arg in doc_allowed_list: for arg in doc_allowed_list:
self.assertTrue(arg in self.text_expected_list, self.assertTrue(arg in self.text_expected_list,
"%s not in %s" % (arg, self.text_expected_list)) "%s not in %s" % (arg, self.text_expected_list))
def testGetAllowedExtensionListByMimetype(self): def testGetAllowedExtensionListByMimetype(self):
...@@ -151,7 +151,7 @@ class TestServer(CloudoooTestCase): ...@@ -151,7 +151,7 @@ class TestServer(CloudoooTestCase):
msword_allowed_list = self.proxy.getAllowedExtensionList(request_dict) msword_allowed_list = self.proxy.getAllowedExtensionList(request_dict)
msword_allowed_list.sort() msword_allowed_list.sort()
for arg in msword_allowed_list: for arg in msword_allowed_list:
self.assertTrue(arg in self.text_expected_list, self.assertTrue(arg in self.text_expected_list,
"%s not in %s" % (arg, self.text_expected_list)) "%s not in %s" % (arg, self.text_expected_list))
def testConvertDocToOdt(self): def testConvertDocToOdt(self):
...@@ -172,7 +172,7 @@ class TestServer(CloudoooTestCase): ...@@ -172,7 +172,7 @@ class TestServer(CloudoooTestCase):
def testgetFileMetadataItemListWithoutData(self): def testgetFileMetadataItemListWithoutData(self):
"""Test server using method getFileMetadataItemList. Without data """Test server using method getFileMetadataItemList. Without data
converted""" converted"""
data = open(join('data','testMetadata.odt'),'r').read() data = open(join('data','testMetadata.odt'),'r').read()
metadata_dict = self.proxy.getFileMetadataItemList(encodestring(data), metadata_dict = self.proxy.getFileMetadataItemList(encodestring(data),
'odt') 'odt')
...@@ -288,7 +288,7 @@ class TestServer(CloudoooTestCase): ...@@ -288,7 +288,7 @@ class TestServer(CloudoooTestCase):
'png', 'png',
'svg', 'svg',
'image/svg+xml') 'image/svg+xml')
def testConvertPPTXToODP(self): def testConvertPPTXToODP(self):
"""Test export pptx to odp""" """Test export pptx to odp"""
self._testConvertFile("data/test.pptx", self._testConvertFile("data/test.pptx",
...@@ -304,7 +304,7 @@ class TestServer(CloudoooTestCase): ...@@ -304,7 +304,7 @@ class TestServer(CloudoooTestCase):
'docx', 'docx',
'odt', 'odt',
'application/vnd.oasis.opendocument.text') 'application/vnd.oasis.opendocument.text')
def testConvertPyToPDF(self): def testConvertPyToPDF(self):
"""Test export python to pdf""" """Test export python to pdf"""
self._testConvertFile("cloudoooTestCase.py", self._testConvertFile("cloudoooTestCase.py",
...@@ -321,7 +321,7 @@ class TestServer(CloudoooTestCase): ...@@ -321,7 +321,7 @@ class TestServer(CloudoooTestCase):
res = self.proxy.getFileMetadataItemList(data, '') res = self.proxy.getFileMetadataItemList(data, '')
self.assertEquals(res['MIMEType'], "text/plain") self.assertEquals(res['MIMEType'], "text/plain")
res = decodestring(self.proxy.updateFileMetadata(data, '', res = decodestring(self.proxy.updateFileMetadata(data, '',
{"Subject": "subject"})) {"Subject": "subject"}))
self.assertEquals(decodestring(res), '') self.assertEquals(decodestring(res), '')
...@@ -358,7 +358,7 @@ class TestServer(CloudoooTestCase): ...@@ -358,7 +358,7 @@ class TestServer(CloudoooTestCase):
self.assertEquals(type(response_dict), DictType) self.assertEquals(type(response_dict), DictType)
self.assertEquals(response_dict, {}) self.assertEquals(response_dict, {})
msg = "This document can not be loaded or is empty\n" msg = "This document can not be loaded or is empty\n"
self.assertTrue(response_message.endswith(msg), self.assertTrue(response_message.endswith(msg),
"%s != %s" % (response_message, msg)) "%s != %s" % (response_message, msg))
def testRunGenerateMethod(self): def testRunGenerateMethod(self):
...@@ -404,7 +404,7 @@ class TestServer(CloudoooTestCase): ...@@ -404,7 +404,7 @@ class TestServer(CloudoooTestCase):
data = open(join('data', 'test_png.odp'),'r').read() data = open(join('data', 'test_png.odp'),'r').read()
generate_result = self.proxy.run_generate('test_png.odp', generate_result = self.proxy.run_generate('test_png.odp',
encodestring(data), encodestring(data),
None, 'html', None, 'html',
'application/vnd.oasis.opendocument.presentation') 'application/vnd.oasis.opendocument.presentation')
response_code, response_dict, response_message = generate_result response_code, response_dict, response_message = generate_result
self.assertEquals(response_code, 200) self.assertEquals(response_code, 200)
...@@ -433,7 +433,7 @@ class TestServer(CloudoooTestCase): ...@@ -433,7 +433,7 @@ class TestServer(CloudoooTestCase):
data = open(join('data','test.odp'),'r').read() data = open(join('data','test.odp'),'r').read()
generate_result = self.proxy.run_generate('test.odp', generate_result = self.proxy.run_generate('test.odp',
encodestring(data), encodestring(data),
None, 'html', None, 'html',
'application/vnd.oasis.opendocument.presentation') 'application/vnd.oasis.opendocument.presentation')
response_code, response_dict, response_message = generate_result response_code, response_dict, response_message = generate_result
self.assertEquals(response_code, 200) self.assertEquals(response_code, 200)
...@@ -467,35 +467,35 @@ class TestServer(CloudoooTestCase): ...@@ -467,35 +467,35 @@ class TestServer(CloudoooTestCase):
def testRunSetMetadata(self): def testRunSetMetadata(self):
"""Test run_setmetadata method""" """Test run_setmetadata method"""
data = open(join('data','testMetadata.odt'),'r').read() data = open(join('data','testMetadata.odt'),'r').read()
setmetadata_result = self.proxy.run_setmetadata('testMetadata.odt', setmetadata_result = self.proxy.run_setmetadata('testMetadata.odt',
encodestring(data), encodestring(data),
{"Title":"testSetMetadata", "Description": "Music"}) {"Title":"testSetMetadata", "Description": "Music"})
response_code, response_dict, response_message = setmetadata_result response_code, response_dict, response_message = setmetadata_result
self.assertEquals(response_code, 200) self.assertEquals(response_code, 200)
self.assertNotEquals(response_dict['data'], '') self.assertNotEquals(response_dict['data'], '')
getmetadata_result = self.proxy.run_getmetadata('testMetadata.odt', getmetadata_result = self.proxy.run_getmetadata('testMetadata.odt',
response_dict['data']) response_dict['data'])
response_code, response_dict, response_message = getmetadata_result response_code, response_dict, response_message = getmetadata_result
self.assertEquals(response_code, 200) self.assertEquals(response_code, 200)
self.assertEquals(response_dict['meta']['MIMEType'], self.assertEquals(response_dict['meta']['MIMEType'],
'application/vnd.oasis.opendocument.text') 'application/vnd.oasis.opendocument.text')
self.assertEquals(response_dict['meta']['Description'], "Music") self.assertEquals(response_dict['meta']['Description'], "Music")
setmetadata_result = self.proxy.run_setmetadata('testMetadata.odt', setmetadata_result = self.proxy.run_setmetadata('testMetadata.odt',
encodestring(data), encodestring(data),
{"Title":"Namie's working record", {"Title":"Namie's working record",
"Description": "Music"}) "Description": "Music"})
response_code, response_dict, response_message = setmetadata_result response_code, response_dict, response_message = setmetadata_result
getmetadata_result = self.proxy.run_getmetadata('testMetadata.odt', getmetadata_result = self.proxy.run_getmetadata('testMetadata.odt',
response_dict['data']) response_dict['data'])
response_code, response_dict, response_message = getmetadata_result response_code, response_dict, response_message = getmetadata_result
self.assertEquals(response_code, 200) self.assertEquals(response_code, 200)
self.assertEquals(response_dict['meta']['title'], self.assertEquals(response_dict['meta']['title'],
"Namie's working record") "Namie's working record")
def testRunSetMetadataFailResponse(self): def testRunSetMetadataFailResponse(self):
"""Test run_setmetadata method with invalid document""" """Test run_setmetadata method with invalid document"""
data = open(join('data','testMetadata.odt'),'r').read()[:100] data = open(join('data','testMetadata.odt'),'r').read()[:100]
setmetadata_result = self.proxy.run_setmetadata('testMetadata.odt', setmetadata_result = self.proxy.run_setmetadata('testMetadata.odt',
encodestring(data), encodestring(data),
{"Title":"testSetMetadata", "Description": "Music"}) {"Title":"testSetMetadata", "Description": "Music"})
response_code, response_dict, response_message = setmetadata_result response_code, response_dict, response_message = setmetadata_result
......
...@@ -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