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
try: | |
from collections import OrderedDict | |
except ImportError: | |
OrderedDict = None | |
from UserDict import UserDict | |
if OrderedDict is not None: | |
class Cache(OrderedDict): | |
def flush(self): |
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
;;; python-flake8.el --- Thin wrapper around python-pylint to run flake8 | |
;; Copyright (C) 2011 Andi Albrecht | |
;; Author: Andi Albrecht <[email protected]> | |
;; Keywords: languages | |
;; This program is free software; you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or |
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 python2 | |
# git-branch-io -- show incoming and outgoing commits | |
# | |
# Place this file somewhere in your PATH. | |
# | |
# Usage: git branch-io [branch] | |
# | |
# If branch is not given the current branch will be used. The script | |
# prints out how many commits should go in either direction to bring |
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
;;; closure-gjslint.el --- Closure Lint mode | |
;; Copyright (C) 2011 Andi Albrecht | |
;; Author: Andi Albrecht <[email protected]> | |
;; Keywords: | |
;; This program is free software; you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or |
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
# Regex to extract error messages from "pylint -f parseable" output | |
import re | |
P_PYLINT_ERROR = re.compile(r""" | |
^(?P<file>.+?):(?P<line>[0-9]+):\ # file name and line number | |
\[(?P<type>[a-z])(?P<errno>\d+) # message type and error number, e.g. E0101 | |
(,\ (?P<hint>.+))?\]\ # optional class or function name | |
(?P<msg>.*) # finally, the error message | |
""", re.IGNORECASE|re.VERBOSE) |
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 -*- | |
# This hack adds a new Meta option "db_column_prefix". If not None all | |
# database columns in a model will be prepended with this prefix (the | |
# database columns, not the attributes). See Person model for an | |
# example. | |
# | |
# Issues: | |
# - How to set a prefix for a m2m table? - If "through" argument is | |
# not specified on a M2MField, Django automatically adds a model |
NewerOlder