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 sys | |
import argparse | |
from getpass import getpass | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
def navigate(card_number, user_name, passkey): | |
try: | |
browser = webdriver.Firefox() |
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
""" | |
Generate PDF reports from data included in several Pandas DataFrames | |
From pbpython.com | |
""" | |
from __future__ import print_function | |
import pandas as pd | |
import numpy as np | |
import argparse | |
from jinja2 import Environment, FileSystemLoader | |
from weasyprint import HTML |
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
# Makefile for Sphinx documentation | |
# | |
# You can set these variables from the command line. | |
SPHINXOPTS = | |
SPHINXBUILD = sphinx-build -E | |
PAPER = | |
BUILDDIR = build | |
LATEX-BW = $(BUILDDIR)/latex-bw |
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
\usepackage{wasysym} | |
\usepackage{moresize} | |
\usepackage{multicol} | |
\usepackage[Sonny]{fncychap} | |
\usepackage[margin=1in, paperwidth=6.69in, paperheight=9.61in]{geometry} | |
\usepackage[protrusion=true,expansion=true]{microtype} | |
\usepackage{xltxtra} | |
\setmainfont[Mapping=tex-text]{Minion Pro} | |
\setmonofont[Mapping=tex-text,Scale=0.85]{Inconsolata} | |
%\setmonofont[Mapping=tex-text,Scale=0.75]{DejaVu Sans Mono} |
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 -*- | |
import sys, os | |
sys.path.insert(0, os.path.abspath('extensions')) | |
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', | |
'sphinx.ext.coverage', 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig', | |
'epub2', 'mobi', 'autoimage', 'code_example'] |
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 os | |
from docutils import nodes | |
from docutils.parsers.rst import directives | |
from docutils.parsers.rst.directives.images import Image | |
def find_image(path, filename): | |
fname = os.path.join(path, filename) | |
if os.path.exists(fname + '.pdf'): | |
return fname + '.pdf' |
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
from __future__ import division | |
import os | |
import sys | |
import codecs | |
import textwrap | |
from StringIO import StringIO | |
from docutils import nodes | |
from docutils.parsers.rst import Directive, directives | |
from sphinx.directives.code import LiteralInclude | |
from sphinx.util.nodes import set_source_info |
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 os | |
import shutil | |
from sphinx.builders.epub import EpubBuilder | |
# We subclass EpubBuilder and re-define build_epub to call | |
# clean_html_file_for_ibooks. This function replaces all instances of | |
# the SPAN tag to SAMP. It's uglish but it works. A better way would | |
# be to change sphinx.writers.html to emmit the SAMP tag in the first | |
# place, but it seems even more difficult to do. |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}"/> | |
{{ metatags }} | |
{%- block htmltitle %} |
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 logging | |
l = logging.getLogger('django.db.backends') | |
l.setLevel(logging.DEBUG) | |
l.addHandler(logging.StreamHandler()) |
NewerOlder