Skip to content

Instantly share code, notes, and snippets.

View ianjosephwilson's full-sized avatar

Ian Wilson ianjosephwilson

View GitHub Profile
import string
def to_index(col):
col = col.lower()
assert len(col) > 0 and not \
[l for l in col if l not in string.lowercase]
index = 0
for i in range(1, len(col) + 1):
if i == 1:
GridsApp.directive('gridTag', function() {
return {
template: '<div ng_class="{{grid.getCssClasses()}}"' +
' ng_switch="grid.type">' +
' <div ng_switch_when="{{GRID_TYPES.container}}">' +
' <div data-grid-tag="" ng_model="nestedGrid" ' +
' ng_repeat="nestedGrid in grid.children"></div>' +
' </div>' +
' <div ng_switch_when="{{GRID_TYPES.text}}">TEXT</div>' +
' <div ng_switch_when="{{GRID_TYPES.image}}">IMAGE</div>' +
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
debug("onCreate");
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = getIntent();
String type = intent.getType();
String action = intent.getAction();
ERROR:tryton.common.common:Traceback (most recent call last):
File "/trytond/protocols/jsonrpc.py", line 123, in _marshaled_dispatch
response['result'] = dispatch_method(method, params)
File "/trytond/protocols/jsonrpc.py", line 156, in _dispatch
res = dispatch(*args)
File "/trytond/protocols/dispatcher.py", line 154, in dispatch
result = rpc.result(meth(*args, **kwargs))
File "/trytond/wizard/wizard.py", line 259, in execute
return wizard._execute(state_name)
File "/trytond/wizard/wizard.py", line 271, in _execute
import logging
from decimal import Decimal
from trytond.modules.company import CompanyReport
from trytond.wizard import Wizard, StateAction
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
__metaclass__ = PoolMeta
import logging
from decimal import Decimal
from trytond.modules.company import CompanyReport
from trytond.wizard import Wizard, StateTransition
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
__metaclass__ = PoolMeta
import logging
from decimal import Decimal
from trytond.modules.company import CompanyReport
from trytond.wizard import Wizard, StateAction
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
__metaclass__ = PoolMeta
<?xml version="1.0"?>
<tryton>
<data>
<record model="ir.action.wizard" id="close_sale">
<field name="name">Close Sale</field>
<field name="wiz_name">sale_wizard.close</field>
<field name="model">sale.sale</field>
</record>
<record model="ir.action.keyword" id="close_sale_keyword">
<field name="keyword">form_action</field>
ContentResolver cr = getContentResolver();
InputStream is = cr.openInputStream(uri);
InputStreamEntity ise = new InputStreamEntity(is, -1);
String scheme = "http";
String host = "192.168.0.3";
String path = "/photos";
HttpClient client = AndroidHttpClient.newInstance("Android");
// @TODO: Use a URL builder.
HttpPut put = new HttpPut(scheme + "://" + host + path);
from formencode.schema import Schema
from formencode.validators import UnicodeString
from formencode import ForEach
from webob.multidict import MultiDict
d = MultiDict([('mlocales', 'en_US'), ('mlocales', 'en_GB')])
assert Schema(mlocales=ForEach(UnicodeString())).to_python(d) == {'mlocales': ['en_US', 'en_GB']}