@@ -7,13 +7,13 @@ msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 5.0.4\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-12-18 08:39+0000\n"
|
||||
"PO-Revision-Date: 2010-02-28 05:54+0000\n"
|
||||
"PO-Revision-Date: 2010-03-01 06:21+0000\n"
|
||||
"Last-Translator: goranc <goranc@gmail.com>\n"
|
||||
"Language-Team: openerp-translators\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-03-01 05:00+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-03-02 04:41+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
"Language: hr\n"
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@ msgstr ""
|
||||
"Project-Id-Version: openobject-server\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2009-12-18 08:39+0000\n"
|
||||
"PO-Revision-Date: 2010-02-28 05:56+0000\n"
|
||||
"PO-Revision-Date: 2010-03-01 06:18+0000\n"
|
||||
"Last-Translator: OpenERP Administrators <Unknown>\n"
|
||||
"Language-Team: Japanese <ja@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-03-01 05:00+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-03-02 04:41+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: base
|
||||
|
||||
+11
-9
@@ -36,6 +36,7 @@ import threading
|
||||
import time
|
||||
import xmlrpclib
|
||||
import release
|
||||
import warnings
|
||||
|
||||
class Service(object):
|
||||
""" Base class for *Local* services
|
||||
@@ -129,15 +130,13 @@ class ExportService(object):
|
||||
LOG_NOTSET = 'notset'
|
||||
LOG_DEBUG_RPC = 'debug_rpc'
|
||||
LOG_DEBUG = 'debug'
|
||||
LOG_DEBUG2 = 'debug2'
|
||||
LOG_INFO = 'info'
|
||||
LOG_WARNING = 'warn'
|
||||
LOG_ERROR = 'error'
|
||||
LOG_CRITICAL = 'critical'
|
||||
|
||||
# add new log level below DEBUG
|
||||
logging.DEBUG2 = logging.DEBUG - 1
|
||||
logging.DEBUG_RPC = logging.DEBUG2 - 1
|
||||
logging.DEBUG_RPC = logging.DEBUG - 2
|
||||
logging.addLevelName(logging.DEBUG_RPC, 'DEBUG_RPC')
|
||||
|
||||
def init_logger():
|
||||
import os
|
||||
@@ -197,7 +196,6 @@ def init_logger():
|
||||
|
||||
mapping = {
|
||||
'DEBUG_RPC': ('blue', 'white'),
|
||||
'DEBUG2': ('green', 'white'),
|
||||
'DEBUG': ('blue', 'default'),
|
||||
'INFO': ('green', 'default'),
|
||||
'WARNING': ('yellow', 'default'),
|
||||
@@ -211,16 +209,20 @@ def init_logger():
|
||||
|
||||
|
||||
class Logger(object):
|
||||
def __init__(self):
|
||||
warnings.warn("The netsvc.Logger API shouldn't be used anymore, please "
|
||||
"use the standard `logging.getLogger` API instead",
|
||||
PendingDeprecationWarning, stacklevel=2)
|
||||
super(Logger, self).__init__()
|
||||
|
||||
def notifyChannel(self, name, level, msg):
|
||||
warnings.warn("notifyChannel API shouldn't be used anymore, please use "
|
||||
"the standard `logging` module instead",
|
||||
PendingDeprecationWarning, stacklevel=2)
|
||||
from service.web_services import common
|
||||
|
||||
log = logging.getLogger(tools.ustr(name))
|
||||
|
||||
if level == LOG_DEBUG2 and not hasattr(log, level):
|
||||
fct = lambda msg, *args, **kwargs: log.log(logging.DEBUG2, msg, *args, **kwargs)
|
||||
setattr(log, LOG_DEBUG2, fct)
|
||||
|
||||
if level == LOG_DEBUG_RPC and not hasattr(log, level):
|
||||
fct = lambda msg, *args, **kwargs: log.log(logging.DEBUG_RPC, msg, *args, **kwargs)
|
||||
setattr(log, LOG_DEBUG_RPC, fct)
|
||||
|
||||
@@ -37,17 +37,6 @@ import sys
|
||||
import os
|
||||
import signal
|
||||
import pwd
|
||||
#----------------------------------------------------------
|
||||
# ubuntu 8.04 has obsoleted `pyxml` package and installs here.
|
||||
# the path needs to be updated before any `import xml`
|
||||
# TODO: remove PyXML dependencies, use lxml instead.
|
||||
#----------------------------------------------------------
|
||||
_oldxml1 = '/usr/lib/python%s/site-packages/oldxml' % sys.version[:3]
|
||||
_oldxml2 = '/usr/lib/python%s/dist-packages/oldxml' % sys.version[:3]
|
||||
if os.path.exists(_oldxml1):
|
||||
sys.path.insert(0,_oldxml1)
|
||||
elif os.path.exists(_oldxml2):
|
||||
sys.path.insert(0,_oldxml2)
|
||||
|
||||
import release
|
||||
__author__ = release.author
|
||||
|
||||
+2
-2
@@ -21,8 +21,8 @@
|
||||
##############################################################################
|
||||
|
||||
name = 'openerp-server'
|
||||
version = '5.0.7'
|
||||
major_version = '5.0'
|
||||
version = '5.2dev'
|
||||
major_version = '5.2'
|
||||
description = 'OpenERP Server'
|
||||
long_desc = '''\
|
||||
OpenERP is a complete ERP and CRM. The main features are accounting (analytic
|
||||
|
||||
@@ -30,12 +30,9 @@ class ExceptionNoTb(Exception):
|
||||
self.args = (msg, '')
|
||||
|
||||
def login(db, login, password):
|
||||
print 'login'
|
||||
pool = pooler.get_pool(db)
|
||||
user_obj = pool.get('res.users')
|
||||
res = user_obj.login(db, login, password)
|
||||
print 'login end'
|
||||
return res
|
||||
return user_obj.login(db, login, password)
|
||||
|
||||
def check_super(passwd):
|
||||
if passwd == tools.config['admin_passwd']:
|
||||
|
||||
+15
-16
@@ -21,6 +21,7 @@
|
||||
|
||||
__all__ = ['db_connect', 'close_db']
|
||||
|
||||
import logging
|
||||
import netsvc
|
||||
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT, ISOLATION_LEVEL_READ_COMMITTED, ISOLATION_LEVEL_SERIALIZABLE
|
||||
from psycopg2.psycopg1 import cursor as psycopg1cursor
|
||||
@@ -60,15 +61,11 @@ import re
|
||||
re_from = re.compile('.* from "?([a-zA-Z_0-9]+)"? .*$');
|
||||
re_into = re.compile('.* into "?([a-zA-Z_0-9]+)"? .*$');
|
||||
|
||||
|
||||
def log(msg, lvl=netsvc.LOG_DEBUG2):
|
||||
logger = netsvc.Logger()
|
||||
logger.notifyChannel('sql', lvl, msg)
|
||||
|
||||
sql_counter = 0
|
||||
|
||||
class Cursor(object):
|
||||
IN_MAX = 1000
|
||||
__logger = logging.getLogger('db.cursor')
|
||||
|
||||
def check(f):
|
||||
@wraps(f)
|
||||
@@ -102,15 +99,16 @@ class Cursor(object):
|
||||
# pool, preventing some operation on the database like dropping it.
|
||||
# This can also lead to a server overload.
|
||||
msg = "Cursor not closed explicitly\n" \
|
||||
"Cursor was created at %s:%s" % self.__caller
|
||||
log(msg, netsvc.LOG_WARNING)
|
||||
"Cursor was created at %s:%s"
|
||||
self.__logger.warn(msg, *self.__caller)
|
||||
self.close()
|
||||
|
||||
@check
|
||||
def execute(self, query, params=None):
|
||||
if '%d' in query or '%f' in query:
|
||||
log(query, netsvc.LOG_WARNING)
|
||||
log("SQL queries cannot contain %d or %f anymore. Use only %s", netsvc.LOG_WARNING)
|
||||
self.__logger.warn(query)
|
||||
self.__logger.warn("SQL queries cannot contain %d or %f anymore. "
|
||||
"Use only %s")
|
||||
if params:
|
||||
query = query.replace('%d', '%s').replace('%f', '%s')
|
||||
|
||||
@@ -124,16 +122,15 @@ class Cursor(object):
|
||||
logger= netsvc.Logger()
|
||||
logger.notifyChannel('sql_db', netsvc.LOG_ERROR, "Programming error: %s, in query %s" % (pe, query))
|
||||
raise
|
||||
except Exception, e:
|
||||
log("bad query: %s" % self._obj.query)
|
||||
log(e)
|
||||
except Exception:
|
||||
self.__logger.exception("bad query: %s", self._obj.query)
|
||||
raise
|
||||
|
||||
if self.sql_log:
|
||||
delay = mdt.now() - now
|
||||
delay = delay.seconds * 1E6 + delay.microseconds
|
||||
|
||||
log("query: %s" % self._obj.query)
|
||||
self.__logger.debug("query: %s", self._obj.query)
|
||||
self.sql_log_count+=1
|
||||
res_from = re_from.match(query.lower())
|
||||
if res_from:
|
||||
@@ -158,14 +155,16 @@ class Cursor(object):
|
||||
if sqllogs[type]:
|
||||
sqllogitems = sqllogs[type].items()
|
||||
sqllogitems.sort(key=lambda k: k[1][1])
|
||||
log("SQL LOG %s:" % (type,))
|
||||
self.__logger.debug("SQL LOG %s:", type)
|
||||
for r in sqllogitems:
|
||||
delay = timedelta(microseconds=r[1][1])
|
||||
log("table: %s: %s/%s" %(r[0], str(delay), r[1][0]))
|
||||
self.__logger.debug("table: %s: %s/%s",
|
||||
r[0], delay, r[1][0])
|
||||
sum+= r[1][1]
|
||||
sqllogs[type].clear()
|
||||
sum = timedelta(microseconds=sum)
|
||||
log("SUM %s:%s/%d [%d]" % (type, str(sum), self.sql_log_count, sql_counter))
|
||||
self.__logger.debug("SUM %s:%s/%d [%d]",
|
||||
type, sum, self.sql_log_count, sql_counter)
|
||||
sqllogs[type].clear()
|
||||
process('from')
|
||||
process('into')
|
||||
|
||||
+1
-16
@@ -883,23 +883,8 @@ if not hasattr(__builtin__, 'any'):
|
||||
__builtin__.any = any
|
||||
del any
|
||||
|
||||
get_iso = {'ca_ES':'ca',
|
||||
'cs_CZ': 'cs',
|
||||
'et_EE': 'et',
|
||||
'sv_SE': 'sv',
|
||||
'sq_AL': 'sq',
|
||||
'uk_UA': 'uk',
|
||||
'vi_VN': 'vi',
|
||||
'af_ZA': 'af',
|
||||
'be_BY': 'be',
|
||||
'ja_JP': 'ja',
|
||||
'ko_KR': 'ko'
|
||||
}
|
||||
|
||||
def get_iso_codes(lang):
|
||||
if lang in get_iso:
|
||||
lang = get_iso[lang]
|
||||
elif lang.find('_') != -1:
|
||||
if lang.find('_') != -1:
|
||||
if lang.split('_')[0] == lang.split('_')[1].lower():
|
||||
lang = lang.split('_')[0]
|
||||
return lang
|
||||
|
||||
+2
-6
@@ -8,11 +8,9 @@ Required dependencies:
|
||||
|
||||
You need the following software installed:
|
||||
|
||||
* Python 2.4 or 2.5
|
||||
* Python 2.5 or 2.6
|
||||
* Postgresql 8.2 or above
|
||||
* Psycopg2 python module
|
||||
* libxml2 and python bindings
|
||||
* libxslt and python bindings
|
||||
* Reportlab pdf generation library for python
|
||||
* lxml python module
|
||||
* pytz python module
|
||||
@@ -29,7 +27,7 @@ for generating reports using non .jpg images, you need:
|
||||
For Debian-based distributions, the required packages can be installed with the
|
||||
following command:
|
||||
|
||||
#> apt-get install -y postgresql graphviz python-psycopg2 python-xml python-lxml python-libxml2 python-libxslt1 python-tz python-imaging
|
||||
#> apt-get install -y postgresql graphviz python-psycopg2 python-lxml python-tz python-imaging
|
||||
|
||||
For Fedora
|
||||
if they are not installed, install:
|
||||
@@ -37,8 +35,6 @@ python and postgresql
|
||||
|
||||
uses yum or you can recover required packages on fedora web site in "core" or "extra" repository :
|
||||
postgresql-python
|
||||
libxml2-python
|
||||
libxslt-python
|
||||
python-lxml
|
||||
python-imaging
|
||||
python-psycopg2
|
||||
|
||||
@@ -171,10 +171,10 @@ options = {
|
||||
"optimize": 2,
|
||||
"dist_dir": 'dist',
|
||||
"packages": ["lxml", "lxml.builder", "lxml._elementpath", "lxml.etree",
|
||||
"lxml.objectify", "decimal", "xml", "xml.dom", "xml.xpath",
|
||||
"encodings","dateutil","wizard","pychart","PIL",
|
||||
"pyparsing", "pydot","asyncore","asynchat", "reportlab",
|
||||
"vobject", "HTMLParser", "select"],
|
||||
"lxml.objectify", "decimal", "xml", "encodings",
|
||||
"dateutil", "wizard", "pychart", "PIL", "pyparsing",
|
||||
"pydot", "asyncore","asynchat", "reportlab", "vobject",
|
||||
"HTMLParser", "select"],
|
||||
"excludes" : ["Tkconstants","Tkinter","tcl"],
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user