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 importlib.machinery import ModuleSpec, SourceFileLoader | |
from _frozen_importlib import _SpecMethods | |
path = '/tmp/test.py' | |
loader = SourceFileLoader('plugin_base', path) | |
spec = ModuleSpec(name='plugin_base', loader=loader) | |
mod = _SpecMethods(spec).create() |
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
fn main() { | |
let numbers = [1, 2, 3]; | |
let keys = ["foo", "bar", "baz"]; | |
for iter::zip(numbers, keys) |&number, &key| { | |
io::println(fmt!("%s => %d", key, number)); | |
} | |
for iter::enumerate(keys) |&index, &key| { | |
io::println(fmt!("%u => %s", index, key)); |
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
fn main() { | |
match os::homedir() { | |
None => { | |
io::println("You have no home folder :-("); | |
} | |
Some(ref homedir) => { | |
io::println("Files in your home folder:"); | |
for os::list_dir_path(homedir).each |path| { | |
match path.filename() { | |
Some(ref filename) => io::println(*filename), |
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
Debugging middleware caught exception in streamed response at a point where response headers were already sent. | |
Traceback (most recent call last): | |
File "/home/max/.virtualenvs/flask/lib/python2.7/site-packages/werkzeug/wsgi.py", line 513, in next | |
return self._next() | |
File "/home/max/.virtualenvs/flask/lib/python2.7/site-packages/werkzeug/wrappers.py", line 829, in iter_encoded | |
for item in self.response: | |
File "/home/max/.virtualenvs/flask/lib/python2.7/site-packages/jinja2/environment.py", line 918, in generate | |
yield self.environment.handle_exception(exc_info, True) | |
File "/home/max/Projekte/flask-testing-stuff/templates/index.html", line 1, in top-level template code | |
{% extends "layout.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
import sys | |
from werkzeug.datastructures import ImmutableDict, MultiDict | |
from flask import request | |
from flaskext.script import Manager | |
from postfixmgmt import app, db, __version__ | |
from postfixmgmt.forms import DomainAddForm | |
manager = Manager(app) | |