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/python | |
# -*- coding: utf-8 -*- | |
# usage: $ odt.py [action] [filename.odf] | |
import zipfile, sys, os | |
action = sys.argv[1] | |
archname = sys.argv[2] | |
src = './%s.src' % '.'.join(archname.split('.')[:-1]) |
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 -*- | |
import unittest | |
from gisweb.doclinkTools.tests.testing import DOCLINKTOOLS_FUNCTIONAL_TESTING | |
class DoclinktoolsTest(unittest.TestCase): | |
layer = DOCLINKTOOLS_FUNCTIONAL_TESTING |
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 -*- | |
for url in [ | |
'http://dev.openlayers.org/theme/default/style.css', | |
'http://dev.openlayers.org/examples/style.css', | |
'http://dev.openlayers.org/OpenLayers.js' | |
]: | |
response.files.append(url) | |
def map(): |
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 -*- | |
from gluon import * | |
""" | |
################################################################################# | |
Courtesy of: | |
https://raw.githubusercontent.com/web2py/web2py/master/gluon/contrib/appconfig.py | |
################################################################################# |
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
#!/bin/bash | |
git clone --recursive https://github.com/web2py/web2py.git web2py_temp | |
cd web2py_temp | |
git checkout tags/R-2.11.2 | |
git submodule update --init --recursive | |
python scripts/make_min_web2py.py ../web2py | |
mv applications/admin ../web2py/applications/ | |
cd ../ | |
rm -rf web2py_temp |
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 -*- | |
import unittest | |
from gluon.serializers import json as json_dumper | |
class UsingJsonFieldWithValidateAndUpdateOrInsertTestCase(unittest.TestCase): | |
def setUp(self): | |
db.define_table('tt', Field('aa', 'json', default={})) |
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 -*- | |
from dal import Table | |
import geojson, json, pyproj | |
import shapely.wkt | |
from dal import Expression | |
# from gluon.dal import geoPolygon | |
from dal import geoPoint, geoLine, geoPolygon | |
# [...] |
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
@service.run | |
def getmap(conn, tablename, the_geom="geom", bbox=''): | |
""" """ | |
session.forget(response) | |
js = """ | |
var url = "%(url)s"; | |
var gargs = "%(bbox)s" && '?bbox='+"%(bbox)s"; | |
var dynSource = new ol.source.Vector({ | |
url: url + gargs, | |
format: new ol.format.GeoJSON(), |
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 -*- | |
import bisect | |
from itertools import izip | |
class Squeue(object): | |
""" """ | |
def __init__(self, _iter, key=None): | |
super(Squeue, self).__init__() |
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 conf: | |
def __init__(self, path): | |
self.config = configparser.SafeConfigParser() | |
self.config.read(path) | |
self.path = path | |
def write(self, section, option, value): | |
""" | |
http://www.programcreek.com/python/example/1033/ConfigParser.SafeConfigParser |
OlderNewer