This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
#This file is part of Tryton. The COPYRIGHT file at the top level of | |
#this repository contains the full copyright notices and license terms. | |
import unittest | |
import threading | |
from functools import partial | |
from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT, \ | |
install_module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Get all your bitbucket issues at once-Fetches/Displays your bitbucket issues | |
- | |
:copyright: (c) 2011 by Openlabs Technologies & Consulting (P) Limited | |
:license: BSD, see LICENSE for more details. | |
- | |
The username and password for this program can be set in multiple ways. | |
- | |
1. Set environment variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StringField(BaseField): | |
"""A unicode string field. | |
""" | |
def __init__(self, regex=None, max_length=None, min_length=None, **kwargs): | |
self.regex = re.compile(regex) if regex else None | |
self.max_length = max_length | |
self.min_length = min_length | |
super(StringField, self).__init__(**kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function drawVisualization() { | |
var data = new google.visualization.DataTable(); | |
data.addRows(6); | |
data.addColumn('string', 'State'); | |
data.addColumn('number', 'Customers'); | |
data.setValue(0, 0, 'US-FL'); | |
data.setValue(0, 1, 200); | |
data.setValue(1, 0, 'US-MN'); | |
data.setValue(1, 1, 300); | |
data.setValue(2, 0, 'US-NJ'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -mindepth 1 -maxdepth 1 -type d -exec sh -c "cd \"{}\" && python setup.py install" \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class cached_property(object): | |
"""A decorator that converts a function into a lazy property. The | |
function wrapped is called the first time to retrieve the result | |
and then that calculated result is used the next time you access | |
the value:: | |
class Foo(object): | |
@cached_property | |
def foo(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
wsgi_app | |
A wsgi application script to load tryton and also the middleware required | |
to support Cross Origin Resource Sharing (CORS). | |
Inspired by the original work at http://codereview.tryton.org/92001/ by | |
Cedric. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ir_ui_menu_proxy = new Ext.createByAlias('proxy.tmodel', { | |
modelName: "ir.ui.menu" | |
}); | |
ir_ui_menu_proxy.doRequest( | |
'search_read', | |
[['parent', '=', false], 0, 1000, null, ['name', 'childs']], | |
// Callback | |
function(result) { | |
console.log(result); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
test | |
Testing the warning stack level usage | |
:copyright: (c) 2012 by Openlabs Technologies & Consulting (P) Limited | |
:license: BSD, see LICENSE for more details. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Authentication proxy for Tornado to use Google apps authentication to | |
serve the files in a protected location. Ideal to serve files like | |
sphinx documentation behind a password. | |
:copyright: (c) 2011 by Openlabs Technologies & Consulting (P) Limited | |
:license: BSD, see LICENSE for more details. | |
""" |
OlderNewer