Skip to content

Instantly share code, notes, and snippets.

View sloria's full-sized avatar

Steven Loria sloria

View GitHub Profile
# Meh
def match(self, items):
for each in items:
if each.match(self):
return each
# Is this supposed to reach the end? Is this a bug?
# Better
def match(self, items):
for each in items:
This file has been truncated, but you can view the full file.
------------------------------------------------------------
/usr/local/bin/pip run on Mon Jul 1 12:34:07 2013
Downloading/unpacking lxml
Getting page https://pypi.python.org/simple/lxml/
URLs to search for versions for lxml:
* https://pypi.python.org/simple/lxml/
Analyzing links from page https://pypi.python.org/simple/lxml/
Skipping link https://pypi.python.org/packages/2.4/l/lxml/lxml-1.3.4.win32-py2.4.exe#md5=3007a5b7556d5115e34da2e220630d1d (from https://pypi.python.org/simple/lxml/); unknown archive format: .exe
Skipping link https://pypi.python.org/packages/2.7/l/lxml/lxml-2.2.8-py2.7-win32.egg#md5=62180a1bf41e037cd2712957fa4acf62 (from https://pypi.python.org/simple/lxml/); unknown archive format: .egg
@sloria
sloria / gist:5902928
Created July 1, 2013 17:40
Error when installing lxml
This file has been truncated, but you can view the full file.
------------------------------------------------------------
/usr/local/bin/pip run on Mon Jul 1 12:34:07 2013
Downloading/unpacking lxml
Getting page https://pypi.python.org/simple/lxml/
URLs to search for versions for lxml:
* https://pypi.python.org/simple/lxml/
Analyzing links from page https://pypi.python.org/simple/lxml/
Skipping link https://pypi.python.org/packages/2.4/l/lxml/lxml-1.3.4.win32-py2.4.exe#md5=3007a5b7556d5115e34da2e220630d1d (from https://pypi.python.org/simple/lxml/); unknown archive format: .exe
Skipping link https://pypi.python.org/packages/2.7/l/lxml/lxml-2.2.8-py2.7-win32.egg#md5=62180a1bf41e037cd2712957fa4acf62 (from https://pypi.python.org/simple/lxml/); unknown archive format: .egg
------------------------------------------------------------
/usr/local/bin/pip run on Mon Jul 1 12:47:31 2013
Downloading/unpacking lxml
Running setup.py egg_info for package lxml
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Best match: lxml 3.2.1
Downloading http://pypi.python.org/packages/source/l/lxml/lxml-3.2.1.tar.gz#md5=d183ccd6bbd5ca139e9db9e9a675787e
Processing lxml-3.2.1.tar.gz
Writing /tmp/easy_install-Pg78um/lxml-3.2.1/setup.cfg
Running lxml-3.2.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Pg78um/lxml-3.2.1/egg-dist-tmp-083BG0
Building lxml version 3.2.1.
Building without Cython.
Using build configuration of libxslt 1.1.24
{
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night-Eighties.tmTheme",
"draw_white_space": "all",
"font_face": "Ubuntu Mono",
"font_options":
[
"subpixel_antialias"
],
"bold_folder_labels": true,
"caret_style": "phase",
from flask import render_template
from app import app, pages
@app.route('/')
def home():
posts = [page for page in pages if 'date' in page.meta]
# Sort pages by date
sorted_posts = sorted(posts, reverse=True,
key=lambda page: page.meta['date'])
return render_template('index.html', pages=sorted_posts)
# -*- coding: utf-8 -*-
from flask import Flask
from flask_flatpages import FlatPages
from flask_frozen import Freezer
app = Flask(__name__)
app.config.from_pyfile('settings.py')
pages = FlatPages(app)
freezer = Freezer(app)
# -*- coding: utf-8 -*-
import os
REPO_NAME = "flask-ghpages-example" # Used for FREEZER_BASE_URL
DEBUG = True
# Assumes the app is located in the same directory
# where this file resides
APP_DIR = os.path.dirname(os.path.abspath(__file__))
from project import main
if __name__ == '__main__':
main.freezer.freeze()