This file contains hidden or 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
with import <nixpkgs> {}; | |
let rubyenv = bundlerEnv { | |
name = "pygotham-2017-ruby-env"; | |
inherit ruby; | |
gemfile = ./Gemfile; | |
lockfile = ./Gemfile.lock; | |
# This can be generated using $(nix-build '<nixpkgs>' -A bundix)/bin/bundix | |
gemset = ./gemset.nix; |
This file contains hidden or 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
{ | |
packageOverrides = pkgs_: with pkgs_;{ | |
vim = pkgs.vim_configurable.override { | |
python = python3; | |
pythonSupport = true; | |
rubySupport = true; | |
}; | |
all = with pkgs; buildEnv { | |
name = "all"; |
This file contains hidden or 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
⋊> ~/s/i/Henson-MongoDB on initial-functionality ⨯ (Henson-MongoDB) python -m sphinx.ext.intersphinx "https://motor.readthedocs.io/en/stable/objects.inv" | |
py:attribute | |
motor.motor_tornado.MotorClient.document_class api/motor_client.html#motor.motor_tornado.MotorClient.document_class | |
motor.motor_tornado.MotorClient.host api/motor_client.html#motor.motor_tornado.MotorClient.host | |
motor.motor_tornado.MotorClient.is_mongos api/motor_client.html#motor.motor_tornado.MotorClient.is_mongos | |
motor.motor_tornado.MotorClient.is_primary api/motor_client.html#motor.motor_tornado.MotorClient.is_primary | |
motor.motor_tornado.MotorClient.max_bson_size api/motor_client.html#motor.motor_tornado.MotorClient.max_bson_size | |
motor.motor_tornado.MotorClient.max_message_size api/motor_client.html#motor.motor_tornado.MotorClient.max_message_size | |
motor.motor_tornado.MotorClient.max_pool_size api/motor_client.html#motor.motor_tornado.MotorClient.max_pool_size | |
motor.motor_tor |
This file contains hidden or 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
"""Create a schedule from a spreadsheet.""" | |
import datetime | |
import os | |
import sqlalchemy | |
from sqlalchemy import ( | |
Column, Date, Enum, ForeignKey, Integer, String, Table, Text, Time, | |
) | |
from sqlalchemy.ext.declarative import declarative_base |
This file contains hidden or 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
def _split_args(f): | |
@wraps(f) | |
def dispatch(parsed_args, *args, **kwargs): | |
parsed_args = vars(parsed_args) | |
parsed_args.pop('_functions_stack', None) | |
return f(**parsed_args) | |
return dispatch | |
def register_commands(functions, namespace=None, namespace_kwargs=None, |
This file contains hidden or 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 Range: | |
"""A validator to check if a value is within a range.""" | |
def __init__(self, start, stop=None, step=1): | |
# Do our best to match range's signature. | |
if stop is None: | |
# If there is no value for stop, use start as stop instead. | |
self.range = range(start) | |
else: | |
self.range = range(start, stop, step) |
This file contains hidden or 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
FROM ubuntu:14.04 | |
ENV DEBIAN_FRONTEND noninteractive | |
VOLUME ["/data/devpi"] | |
EXPOSE 3141 | |
RUN apt-get update -q && apt-get install -y netbase python | |
ADD https://bootstrap.pypa.io/get-pip.py /get-pip.py | |
RUN python /get-pip.py |
This file contains hidden or 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
- name: PyGotham | |
docker: | |
name: web | |
image: python:3.4.3 | |
pull: always | |
state: reloaded | |
env: | |
PYTHONUNBUFFERED: 1 | |
link: | |
- "db:db" |
This file contains hidden or 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
"""The PyGotham home page.""" | |
from flask import Blueprint, render_template | |
from pygotham.news import get_active | |
from pygotham.sponsors import get_accepted | |
__all__ = ('blueprint',) | |
blueprint = Blueprint( |
This file contains hidden or 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 AliasedDict(dict): | |
def __init__(self, mapping): | |
self.mapping = mapping | |
def __getitem__(self, key): | |
if key in self.mapping: | |
key = self.mapping[key] | |
return super().__getitem__(key) | |
def __setitem__(self, key, value): |
NewerOlder