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 ISDATA: | |
def __init__(self, com, seg, on): | |
self.com = com | |
self.segs = [(seg % 8, on)] | |
self.offset = com * 6 + seg // 8 | |
self.max_seg = seg // 8 * 8 + 7 | |
def attempt_add(self, com, seg, on): | |
if com != self.com or seg > self.max_seg: | |
return False |
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
Migrating some-custom-site | |
--------------------------------- | |
rake aborted! | |
StandardError: An error has occurred, this and all later migrations canceled: | |
PG::UndefinedColumn: ERROR: column categories.text_color does not exist | |
LINE 1: ... "categories"."slug", "categories"."description", "categorie... | |
^ | |
: SELECT "categories"."id", "categories"."name", "categories"."color", "categories"."topic_id", "categories"."topic_count", "categories"."created_at", "categories"."updated_at", "categories"."user_id", "categories"."topics_year", "categories"."topics_month", "categories"."topics_week", "categories"."slug", "categories"."description", "categories"."text_color", "categories"."read_restricted", "categories"."auto_close_hours", "categories"."post_count", "categories"."latest_post_id", "categories"."latest_topic_id", "categories"."position", "categories"."parent_category_id", "categories"."posts_year", "categories"."posts_month", "categories"."posts_week", |
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
beforeEach(function () { | |
this.aws = {}; | |
stubAwsRequest(stubs); | |
}); | |
afterEach(function () { | |
AWS.Request.prototype.runTo.restore(); | |
}); | |
AWS.Request.prototype.originalRunTo = AWS.Request.prototype.runTo; |
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
import geoalchemy2, geoalchemy2.shape | |
import shapely.geometry | |
# Could use geomet rather than pushing this through shapely. | |
class Geometry(geoalchemy2.Geometry): | |
"""Deal in GeoJSON rather than WKB/WKT""" | |
def result_processor(self, dialect, coltype): | |
super_proc = super(Geometry, self).result_processor(dialect, coltype) | |
def process(v): | |
return v and shapely.geometry.mapping( |