import pygtk pygtk.require('2.0') import gtk from mayan_api_client import API api = API(host='http://www.sspu-opava.cz:82', username='******', password='******') dokument = "" metadata = "" active_label_id = "" class RadioButtons: def callback(self, widget, data=None): global active_label_id active_label_id = data print "%s was toggled %s" % (data, ("OFF", "ON")[widget.get_active()]) def close_application(self, widget, event, data=None): gtk.main_quit() return False def __init__(self): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.connect("delete_event", self.close_application) self.window.set_title("Typ dokumentu") self.window.set_border_width(0)
from mayan_api_client import API from flask import render_template, Blueprint from flask_wtf import FlaskForm from wtforms.fields import StringField, SelectField from wtforms.validators import DataRequired main_blueprint = Blueprint( 'main', __name__, ) api = API(host='http://192.168.22.188:81', username='******', password='******') '''for result in api.metadata.metadata_types.get()['results']: print(result['name']) ''' '''for result in api.documents.document_types.get()['results']: print(result['label']) ''' class SomeForm(FlaskForm): label = SelectField( 'label', choices=[(result['label'], result['label']) for result in api.documents.document_types.get()['results']]) '''invoice_number = StringField('Invoice number (Required)', [DataRequired()])
def __init__(self, host, username, password): if host is None or username is None or password is None: return self.api = API(host=host, username=username, password=password)