Skip to content

Instantly share code, notes, and snippets.

for repo in repos:
if foo(repo):
yield repo
elif bar(repo):
yield repo
elif baz(repo):
yield repo
@asl2
asl2 / gist:2159552
Created March 22, 2012 16:47
pymarc patch to handle III-style '{...}' in the middle of EACC
Here's a Q&D patch - it needs to be integrated w/ pymarc's test system, and maybe made optional in case EACC is ever extended to have chars in the 0x7Bxxxx range.
See https://groups.google.com/forum/?fromgroups#!topic/pymarc/z1xe1id1GTw
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
# see http://www.loc.gov/marc/specifications/speccharmarc8.html
"pymarc marc8.py file."
@@ -55,6 +56,11 @@ class MARC8ToUnicode:
@asl2
asl2 / gist:2159370
Created March 22, 2012 16:28
no 7bxxxx in EACC
>>> import marc8_mapping
>>> for k in marc8_mapping.CHARSET_31:
... if k & 0xFF0000 == 0x7B0000:
... print k
returns nothhing