Exemplo n.º 1
0
    # Resize files to 80px x 80px
    pixbuf = GdkPixbuf.Pixbuf.new_from_file(local_path)
    size = scale * 100
    pixbuf = pixbuf.scale_simple(size, size, GdkPixbuf.InterpType.BILINEAR)
    img = Gtk.Image.new_from_pixbuf(pixbuf)
    return img


def mk_label(text):
    label = Gtk.Label()
    label.set_markup(text)
    label.set_line_wrap(True)
    return label


if __name__ == "__main__":
    # Load conf file
    yaml_location = os.path.join(os.path.split(__file__)[0], 'settings.yaml')
    with open(yaml_location) as yaml_file:
        conf = yaml.load(yaml_file)

    # Set up Knowledge
    engine = create_engine(conf['db_uri'])
    init_model(engine)
    metadata.create_all(engine)

    win = InfoWin(conf)
    win.connect("delete-event", Gtk.main_quit)

    Gtk.main()
Exemplo n.º 2
0
                if not Entity.by_name(event['repo']):
                    client.repo_information(event['repo'])
        except:
            print("Something went wrong updating the events for {0}." \
                  .format(user['login']))
            continue


    print("You have {0} of {1} calls left this hour."
          .format(*client.rate_limiting))


if __name__ == '__main__':
    yaml_location = os.path.join(os.path.split(__file__)[0], 'settings.yaml')
    with open(yaml_location) as yaml_file:
        conf = yaml.load(yaml_file)

    # Set up Knowledge
    engine = create_engine(conf['db_uri'])
    init_model(engine)
    metadata.create_all(engine)

    if conf['user'] and conf['password']:
        client = Github((conf['user'], conf['password']))
    else:
        client = Github()

    while True:
        cache_events(client, conf['organization'])
        sleep(conf['interval'])
Exemplo n.º 3
0
 def setUp(self):
     engine = create_engine('sqlite:///:memory:')
     init_model(engine)
     metadata.create_all(engine)
     PolyScraper().consume('http://www.data.gov/raw/994')
     self.entity = Entity.by_name('data.gov')
Exemplo n.º 4
0
 def setUp(self):
     engine = create_engine('sqlite:///:memory:')
     init_model(engine)
     metadata.create_all(engine)