Skip to content

Instantly share code, notes, and snippets.

View esben's full-sized avatar

Esben Haabendal esben

  • Geanix ApS
  • Hobro, Denmark
View GitHub Profile
import requests
from requests.auth import HTTPBasicAuth
import re
from StringIO import StringIO
JIRA_URL = 'https://your-jira-url.tld/'
JIRA_ACCOUNT = ('jira-username', 'jira-password')
# the JIRA project ID (short)
JIRA_PROJECT = 'PRO'
GITLAB_URL = 'http://your-gitlab-url.tld/'
@kergoth
kergoth / bitbake-json.patch
Created May 25, 2012 14:25
Playing around with json in bitbake
diff --git i/lib/bb/parse/ast.py w/lib/bb/parse/ast.py
index eae840f..2fa5664 100644
--- i/lib/bb/parse/ast.py
+++ w/lib/bb/parse/ast.py
@@ -102,13 +102,23 @@ class DataNode(AstNode):
bb.data.update_data(e)
val = e.expand(groupd["value"], key + "[:=]")
elif "append" in groupd and groupd["append"] != None:
- val = "%s %s" % ((self.getFunc(key, data) or ""), groupd["value"])
+ val = self.getFunc(key, data) or ""
@kergoth
kergoth / fsm.py
Created May 25, 2011 16:08
One of the simpler state machine implementations I've run across
# Copyright Mike Sweeney, placed under the MIT license
# See http://code.activestate.com/recipes/577701-a-flexible-state-machine-class/ for reference
class StateMachine:
def __init__(self, transitions, initial=None):
if isinstance(transitions, basestring):
components = [term.split(':') for term in transitions.split()]
self.sm = dict([tuple(a.split(',')), tuple(b.split(','))]
for a, b in components)
@kergoth
kergoth / assume.bbclass
Created March 14, 2011 18:36
Automatic ASSUME_PROVIDED based upon what's available in the build machine (not for the faint of heart, you've been warned)
def auto_assume_provided():
import kergoth.assume as assume
import kergoth.assumptions
return ' '.join(assume.test_assumptions())
ASSUME_PROVIDED += "${@auto_assume_provided()}"
@mattbasta
mattbasta / codegen.py
Created January 22, 2011 18:16
A module to "unparse" a Python AST tree.
# -*- coding: utf-8 -*-
"""
codegen
~~~~~~~
Extension to ast that allow ast -> python code generation.
:copyright: Copyright 2008 by Armin Ronacher.
:license: BSD.
"""