Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Copyright © 2013, Chris “Kwpolska” Warrick <[email protected]>. | |
# Licensed under the 3-clause BSD license, see: | |
# https://github.com/Kwpolska/python-project-template/blob/master/LICENSE | |
class KeyClass(object): | |
""" | |
A class with an optional dict-like interface. | |
spam = KeyClass() | |
spam.eggs == spam['eggs'] |
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
## go from here | |
mylist = [{'pk':1, 'f_id':5,'bool':True}, {'pk':2, 'f_id':2, 'bool':True}, {'pk':3, 'f_id':2, 'bool':False}, {'pk':4, 'f_id':7, 'bool':True}, {'pk':5,'f_id':2,'bool':True}, {'pk':6,'f_id':7, 'bool':False}] | |
## to here | |
# mynewlist = [{'pk':1,'f_id':5,'bool':True}, {'pk':5,'f_id':2,'bool':True}] | |
### filter out Falsey elements | |
mynewlist = [i for i in mylist if i['bool']] | |
### dropped Falsey element f_id’s | |
dropped = [i['f_id'] for i in mylist if not i['bool']] |
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 Cleanable(object): | |
def __init__(self): | |
self.resources = [] | |
def add_resource(self, name, obj): | |
setattr(self, name, obj) | |
self.resources.append(obj) | |
def close(self): | |
for res in self.resources: |
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
#!/usr/bin/perl | |
# PKGBUILDer | |
# Part of KRU | |
# Copyright Kwpolska 2010. Licensed on GPLv3. | |
# USAGE: ./build pkg1 [pkg2] [pkg3] (and more) | |
use warnings; | |
use strict; | |
use LWP::Simple; | |
use Archive::Any; |
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
### original code: | |
for i in X: | |
if i != 0: | |
print(i) | |
else: | |
break | |
else: | |
print('done, no zeroes') | |
### re-implemented as: |
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
diff --git a/CHANGES.txt b/CHANGES.txt | |
index df8aab1..59318e3 100644 | |
--- a/CHANGES.txt | |
+++ b/CHANGES.txt | |
@@ -32,6 +32,8 @@ Features | |
* Add rel=alternate <link> elements to translations of the current page (Issues #988, #989) | |
* Added a INDEXES_PAGES_MAIN setting to show the page number on the index page | |
if desired (True) (Issues #210, #987) | |
+* Added a TRANSLATIONS_PATTERN setting to specify the format for | |
+ language-dependent filenames (Issue #990) |
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 54477ea80d3be097cc84b37b0a61a8661eb7d03b Mon Sep 17 00:00:00 2001 | |
From: =?UTF-8?q?Chris=20=E2=80=9CKwpolska=E2=80=9D=20Warrick?= | |
<[email protected]> | |
Date: Thu, 23 Jan 2014 17:29:53 +0100 | |
Subject: [PATCH] update documentation for TRANSLATIONS_PATTERN | |
MIME-Version: 1.0 | |
Content-Type: text/plain; charset=UTF-8 | |
Content-Transfer-Encoding: 8bit | |
Signed-off-by: Chris “Kwpolska” Warrick <[email protected]> |