This is an example of loading code and dynamically creating a class based on the version requested.
project/init.py # in gist project/client/init.py # EMPTY project/client/v1_test.py # in gist project/client/v2_test.py # in gist
#!/usr/bin/env python3 | |
""" | |
Super simple POC | |
""" | |
import sys | |
import markdown | |
import yaml | |
filename = sys.argv[1] |
# Copyright (C) 2016-2017 Red Hat, Inc | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
import json | |
class A: | |
def __init__(self): | |
self.b = None | |
@property | |
def a(self): | |
if self.b is None: |
import os # for listing files | |
import sys # for finding current location | |
import importlib # Used to dynamically import modules | |
# object subclasses for 2.x support | |
# Path to the importable code. This is important when loading | |
# code from a directory. We need to know where the files will be located. | |
MODULE_PATH = os.path.sep.join([ | |
os.path.dirname(os.path.abspath( |
#!/usr/bin/env python | |
import inspect | |
import re | |
#: Regex that finds exception raising | |
RAISE_RX = re.compile('raise ([^\(]*)\(') | |
def test(a, b='ok', c=False): | |
if False: |
Chair: ashcrow
[vagrant@commissaire ~]$ . commissaire_env/bin/activate | |
(commissaire_env) [vagrant@commissaire ~]$ pip --version | |
pip 9.0.1 from /home/vagrant/commissaire_env/lib/python3.5/site-packages (python 3.5) |
07:37:54 ashcrow- | Let's go ahead and get started | |
07:37:58 ashcrow- | Agenda Item 1: Presentations | |
07:38:03 ashcrow- | None this week | |
07:38:32 ashcrow- | Agenda Item 2: Open PR Discussions | |
07:38:48 ashcrow- | We actually have all outstanding PRs merged as of Friday :-D | |
07:38:54 ashcrow- | commissaire: 7 merged | |
07:38:54 ashcrow- | commissaire-http: 2 merged | |
07:38:54 ashcrow- | commissaire-service: 4 merged | |
07:39:05 ashcrow- | a few of them were big PRs | |
07:39:20 ashcrow- | Highlights from this past 2 weeks include: |
Chair: ashcrow