[Erp5-report] r37821 gabriel - in /erp5/trunk/utils/cloudooo: ./ cloudooo/
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Aug 13 22:12:47 CEST 2010
Author: gabriel
Date: Fri Aug 13 22:12:46 2010
New Revision: 37821
URL: http://svn.erp5.org?rev=37821&view=rev
Log:
refactor function that starts cloudooo application to check if temporary folder exists. And remove function that clean one directory, because it is very dangerous.
Modified:
erp5/trunk/utils/cloudooo/cloudooo/cloudooo.py
erp5/trunk/utils/cloudooo/cloudooo/utils.py
erp5/trunk/utils/cloudooo/setup.py
Modified: erp5/trunk/utils/cloudooo/cloudooo/cloudooo.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/cloudooo/cloudooo.py?rev=37821&r1=37820&r2=37821&view=diff
==============================================================================
--- erp5/trunk/utils/cloudooo/cloudooo/cloudooo.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/cloudooo/cloudooo.py [utf8] Fri Aug 13 22:12:46 2010
@@ -31,7 +31,7 @@ from application.openoffice import openo
from application.xvfb import xvfb
from wsgixmlrpcapplication import WSGIXMLRPCApplication
from utils import convertStringToBool, configureLogger, cleanDirectory
-from os import path
+from os import path, mkdir
from sys import executable
from mimemapper import mimemapper
import monitor, gc, pkg_resources
@@ -69,11 +69,13 @@ def application(global_config, **local_c
configureLogger(debug_mode=debug_mode)
# path of directory to run cloudooo
path_dir_run_cloudooo = local_config.get('path_dir_run_cloudooo')
- cleanDirectory(path_dir_run_cloudooo, ignore_list=["tmp",])
+ if not path.exists(path_dir_run_cloudooo):
+ mkdir(path_dir_run_cloudooo)
# directory to create temporary files
cloudooo_path_tmp_dir = path.join(path_dir_run_cloudooo, 'tmp')
- cleanDirectory(cloudooo_path_tmp_dir)
- # it extracts the path of cloudooo scripts
+ if not path.exists(cloudooo_path_tmp_dir):
+ mkdir(cloudooo_path_tmp_dir)
+ # it extracts the path of cloudooo scripts from pkg_resources
cloudooo_resources = pkg_resources.get_distribution('cloudooo')
console_scripts = cloudooo_resources.get_entry_map()['console_scripts']
unomimemapper_bin = path.join(path.dirname(executable),
Modified: erp5/trunk/utils/cloudooo/cloudooo/utils.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/cloudooo/utils.py?rev=37821&r1=37820&r2=37821&view=diff
==============================================================================
--- erp5/trunk/utils/cloudooo/cloudooo/utils.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/cloudooo/utils.py [utf8] Fri Aug 13 22:12:46 2010
@@ -43,22 +43,6 @@ def removeDirectory(path):
except OSError, msg:
logger.error(msg)
-def cleanDirectory(path, ignore_list=[]):
- """Cleans directory.
-
- Keyword arguments:
- path -- folder path
- """
- if not exists(path):
- return
- folder_list = [join(path, name) for name in listdir(path)]
- ignore_list = [join(path, name) for name in ignore_list]
- for path in folder_list:
- if isdir(path) and path not in ignore_list:
- removeDirectory(path)
- else:
- logger.debug("%s is not a folder or was ignored" % path)
-
def socketStatus(hostname, port):
"""Verify if the address is busy."""
try:
Modified: erp5/trunk/utils/cloudooo/setup.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/setup.py?rev=37821&r1=37820&r2=37821&view=diff
==============================================================================
--- erp5/trunk/utils/cloudooo/setup.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/setup.py [utf8] Fri Aug 13 22:12:46 2010
@@ -1,11 +1,11 @@
from setuptools import setup, find_packages
-version = '1.0.4'
+version = '1.0.5'
setup(name='cloudooo',
version=version,
description="XML-RPC openoffice document convertion server",
- long_description=open("README").read(),
+ long_description=open("./cloudooo/README").read(),
classifiers=["Topic :: System :: Networking",
"Topic :: System :: Operating System Kernels :: Linux",
"Topic :: Internet :: WWW/HTTP :: WSGI",
More information about the Erp5-report
mailing list