Skip to content

Instantly share code, notes, and snippets.

View kklimonda's full-sized avatar

Krzysztof Klimonda kklimonda

View GitHub Profile
@kklimonda
kklimonda / pybrowser.py
Created March 28, 2011 15:18
A minimal Gtk+/Webkit based browser in Python
import sys
from gi.repository import Gtk, Gdk, WebKit
class BrowserTab(Gtk.VBox):
def __init__(self, *args, **kwargs):
super(BrowserTab, self).__init__(*args, **kwargs)
go_button = Gtk.Button("go to...")
go_button.connect("clicked", self._load_url)
self.url_bar = Gtk.Entry()
@kklimonda
kklimonda / django_test_manage.py
Last active April 26, 2018 10:07
A custom django_test_manage.py for PyCharm 2.7 that adds support for running Django tests for projects that use Buildout. Two things had to be done. First, python egg paths from the buildout script have to be added. Some AST magic does that. Second, the working directory gets mangled because "manage.py" script resides in <<project root>>/bin, so…
#!/usr/bin/env python
import os
def _inject_buildout_modules(buildout_script):
import sys
import ast
with open(buildout_script, 'r') as fh:
content = fh.read()
[
{
"backcolor": "#333333",
"name": "naps62 Ergodox - Base Layer",
"author": "Miguel Palhas <miguel@subvisual.co>",
"radii": "20px",
"switchMount": "cherry",
"switchBrand": "cherry",
"switchType": "MX1A-G1xx",
"pcb": false,
@kklimonda
kklimonda / SConscript
Created August 10, 2017 12:07
SConscript patch to fix target dependencies
diff --git a/src/control-node/SConscript b/src/control-node/SConscript
index c0f2960..4e45fd4 100644
--- a/src/control-node/SConscript
+++ b/src/control-node/SConscript
@@ -44,7 +44,7 @@ rel_path = Dir('control_node').path
def BuildInfoAction(target, source, env):
env.GenerateBuildInfoPyCode(path=rel_path)
-build_info_rules = [env.Command(target='buildinfo.py', source = None, action=BuildInfoAction)]
+build_info_rules = [env.Command(target='control_node/buildinfo.py', source = None, action=BuildInfoAction)]
scons: *** Found dependency cycle(s):
build/production/dns/cmn/buildinfo.h -> build/production/dns/cmn/buildinfo.h
build/production/control-node/buildinfo.h -> build/production/control-node/buildinfo.h
Internal Error: no cycle found for node build/production/dns/cmn/buildinfo.cc (<SCons.Node.FS.File object at 0x4654720>) in state pending
build/production/analytics/buildinfo.h -> build/production/analytics/buildinfo.h
Internal Error: no cycle found for node build/production/vnsw/agent/contrail/buildinfo.cc (<SCons.Node.FS.File object at 0x2a121b0>) in state pending
Internal Error: no cycle found for node build/production/analytics/buildinfo.cc (<SCons.Node.FS.File object at 0x2bd1af0>) in state pending
build/production/query_engine/buildinfo.h -> build/production/query_engine/buildinfo.h
File "/home/ubuntu/scons-2.5/lib/python2.7/site-packages/scons-2.5.1/SCons/Taskmaster.py", line 1043, in cleanup
@kklimonda
kklimonda / buildinfo.cc
Created August 11, 2017 14:52
contrail autogenerated build information
/*
* Autogenerated file. DO NOT EDIT.
*/
#include "buildinfo.h"
const std::string BuildInfo = "{\"build-info\": [{\"build-time\": \"2017-08-11 06:05:27.301890\", \"build-hostname\": \"grown-marten\", \"build-user\": \"ubuntu\", \"build-version\": \"4.1.0.0\"}]}";
CONTROLLER_PATCHSETS="
34917
34918
34919
34920
34924
34986
35098
"
BUILD_PATCHSETS="
---
- job:
name: test-job
vars:
test_variable: "{{ ansible_env.HOME }}/test-path"
---
- hosts: all
vars:
test_variable: "{{ ansible_env.HOME }}/test-path"
---
- job:
name: job-base
- job:
name: job-base
branches: master
vars:
version: 5.0
- hosts: localhost
connection: local
tasks:
- name: Create a list of YAML files to validate
find:
paths: .
patterns: "*.yaml"
recurse: true
register: yaml
changed_when: false