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 TestCheckFailure(DemoBuildTest): | |
"""The demo build should pass 'nikola check'""" | |
def test_check_links_fail(self): | |
with cd(self.target_dir): | |
os.unlink(os.path.join("output", "archive.html")) | |
__main__.main(['check', '-l']) | |
def test_check_files_fail(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
#! /usr/bin/env python3 | |
import argparse | |
import os | |
def check_folder(folder): | |
logs = get_logs(folder) | |
failures = collect_failures(logs) | |
print_failures(failures) |
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
#Package on pypi is: http://pypi.python.org/pypi/python-dateutil/2.1 | |
from dateutil.parser import parse | |
#This is the value found somewhere | |
s = "20120629074518Z00'00'" | |
#This will give you a datetime to work with | |
dtime = parse(s) | |
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 python | |
# -*- coding: utf-8 -*- | |
import string | |
import sys | |
import timeit | |
STRING_INTERPOLATION = "%s ist %i ist %.2f" | |
NAMED_STRING_INTERPOLATION = "%(letter)s ist %(ganzzahl)i ist %(dezimalzahl).2f" |
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/python3 | |
# vim:ft=python ts=4 sw=4 sts=4 et | |
# table.py - Simple python script that dynamically formats an ascii art table where | |
# each table cell holds an integer number (incremented, per cell). | |
# This is a typical excercise task coding lesson for new workers and I just | |
# wanted to see how bad I perform on this task. | |
# Written by Armin (Github: netzverweigerer) |
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/python3 | |
import timeit | |
def list_comprehension(input): | |
data = [element for element in elements] | |
def for_loop(input): |
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 python3 | |
from pyStatus.Bar import Bar | |
from pyStatus.plugins import Time | |
from pyStatus.plugins import Battery | |
from pyStatus.plugins import CPU | |
from pyStatus.plugins import Memory | |
from pyStatus.plugins import Ip | |
from pyStatus.plugins import ESSID |