+ #!/usr/bin/env python
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
- #!/usr/bin/python
+ #!/usr/bin/env python
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
rml2html_help()
print parseString(file(sys.argv[1], 'r').read()),
else:
- print 'Usage: trml2pdf input.rml >output.pdf'
- print 'Try \'trml2pdf --help\' for more information.'
+ print 'Usage: rml2html input.rml >output.html'
+ print 'Try \'rml2html --help\' for more information.'
- # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+ # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
cr.close()
return True
- def db_exist(self, db_name):
+ def exp_db_exist(self, db_name):
- try:
- db = sql_db.db_connect(db_name)
- return True
- except:
- return False
+ ## Not True: in fact, check if connection to database is possible. The database may exists
+ return bool(sql_db.db_connect(db_name))
- def list(self):
+ def exp_list(self):
db = sql_db.db_connect('template1')
cr = db.cursor()
try:
return res
def print_log(self):
+ global sql_counter
+ sql_counter += self.sql_log_count
if not self.sql_log:
return
-
def process(type):
sqllogs = {'from':self.sql_from_log, 'into':self.sql_into_log}
- if not sqllogs[type]:
- return
- sqllogitems = sqllogs[type].items()
- sqllogitems.sort(key=lambda k: k[1][1])
sum = 0
- log("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]))
- sum+= r[1][1]
+ if sqllogs[type]:
+ sqllogitems = sqllogs[type].items()
+ sqllogitems.sort(key=lambda k: k[1][1])
+ log("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]))
+ sum+= r[1][1]
+ sqllogs[type].clear()
sum = timedelta(microseconds=sum)
- log("SUM:%s/%d" % (str(sum), self.sql_log_count))
+ log("SUM %s:%s/%d [%d]" % (type, str(sum), self.sql_log_count, sql_counter))
+ sqllogs[type].clear()
process('from')
process('into')
self.sql_log_count = 0
- #!/usr/bin/python
+ #!/usr/bin/env python
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
- #!/usr/bin/python
+ #!/usr/bin/env python
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of