#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
from __future__ import with_statement | |
from kombu import BrokerConnection | |
from collections import defaultdict | |
import gevent | |
from gevent import monkey | |
monkey.patch_all() | |
class WorkerHub(): | |
""" | |
WorkerHub controls the local mailboxes that the @worker decorator assigns. |
import redis | |
import threading | |
class Listener(threading.Thread): | |
def __init__(self, r, channels): | |
threading.Thread.__init__(self) | |
self.redis = r | |
self.pubsub = self.redis.pubsub() | |
self.pubsub.subscribe(channels) | |
#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
#!/usr/bin/env python | |
############################################################################### | |
# $Id$ | |
# | |
# Project: GDAL2Tiles, Google Summer of Code 2007 & 2008 | |
# Global Map Tiles Classes | |
# Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326, | |
# generate a simple HTML viewers based on Google Maps and OpenLayers | |
# Author: Klokan Petr Pridal, klokan at klokan dot cz | |
# Web: http://www.klokan.cz/projects/gdal2tiles/ |
%% | |
%% mod_log_remote is a simple Ejabberd module and gen_server that | |
%% allow for remote logging. It uses the filter_packet hook to | |
%% intercept <message> stanzas addressed to logger@vhost. These | |
%% messages are beamed off to the configured Erland node / pid in | |
%% the form: | |
%% | |
%% {Type, LogTime, Payload} | |
%% | |
%% where Type and Payload are specified by the caller and LogTime is |
import os | |
import sys | |
import errno | |
import fcntl | |
def file_to_pipe(file, pipe): | |
if file.closed: | |
pipe.closed() | |
return |
%% mod_js is a prototype module that uses erlang_js | |
%% to allow filtering stanza's through JavaScript | |
%% for altering, dropping, etc. | |
%% | |
%% NOTE: The JavaScript path is hardcoded to "test.js" | |
%% at the end of this file. | |
%% | |
-module(mod_js). | |
-author('[email protected]'). |
%% | |
%% mod_msg_filter allows the filtering of "message" | |
%% stanzas across an HTTP service. The URL of the | |
%% service must be passed as part of the module's | |
%% configuration. Both JIDs and their resources are | |
%% passed as part of the query string and the result | |
%% is expected to be one of: | |
%% | |
%% <status value="denied"> | |
%% <stanza1><error/></stanza1> |
%% | |
%% mod_log_remote is a simple Ejabberd module and gen_server that | |
%% allow for remote logging. It uses the filter_packet hook to | |
%% intercept <message> stanzas addressed to logger@vhost. These | |
%% messages are beamed off to the configured Erland node / pid in | |
%% the form: | |
%% | |
%% {Type, LogTime, Payload} | |
%% | |
%% where Type and Payload are specified by the caller and LogTime is |
def get_tile_origin(self, tile_x, tile_y, zoom): | |
'''Return the lat, lng of the northwest corner of the tile.''' | |
tile_width = 360.0/pow(2,zoom) # degrees | |
tile_height = tile_width/2 # degrees | |
n = 90 - tile_y * tile_height | |
w = -180 + tile_x * tile_width | |
return (n,w) | |
def get_bb(self, tile_x, tile_y, zoom): | |
"""Return bounding coordinates (n, e, s, w) of the tile.""" |