Esempio n. 1
0
def init():
    css = resource_find('data/font-awesome.css')
    fontd = resource_find('data/font-awesome.fontd')
    ttf = resource_find('data/font-awesome.ttf')
    if not fontd:
        Logger.info('Container: Generating font-awesome.fontd')
        fontd = css.replace('.css', '.fontd')
        iconfonts.create_fontdict_file(css, fontd)
    iconfonts.register('default_font', ttf, fontd)
Esempio n. 2
0
def create_and_register_font():
    # FontAwesome #
    iconfonts.create_fontdict_file(join(dirname(__file__),"Fonts","font-awesome.css",),
                                   join(dirname(__file__),"Fonts","font-awesome.fontd"))

    iconfonts.register("font-awesome",
                       join(dirname(__file__),"Fonts","fontawesome-webfont.ttf"),
                       join(dirname(__file__),"Fonts","font-awesome.fontd"))

    # Flaticon font #
    iconfonts.create_fontdict_file(join(dirname(__file__), "Fonts", "flaticon.css", ),
                                   join(dirname(__file__), "Fonts", "flaticon.fontd"))

    iconfonts.register("flaticon",
                       join(dirname(__file__), "Fonts", "Flaticon.ttf"),
                       join(dirname(__file__), "Fonts", "flaticon.fontd"))
Esempio n. 3
0
import os

BASE_PATH = os.path.dirname(os.path.abspath(__file__))

from kivy.garden import iconfonts
iconfonts.register('default_font',
    os.path.join(BASE_PATH, 'fonts', 'fontawesome-webfont.ttf'),
    os.path.join(BASE_PATH, 'fonts', 'font-awesome.fontd')
)

from kivy.uix.boxlayout import BoxLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.popup import Popup
from kivy.app import App
from kivy.properties import (
    ObjectProperty,
    NumericProperty,
    StringProperty,
)

from wwb_scanner.core import JSONMixin
from wwb_scanner.ui.kivyui import plots
from wwb_scanner.ui.kivyui import scan
from wwb_scanner.ui.kivyui import actions
from wwb_scanner.ui.kivyui.actions import Action

class RootWidget(BoxLayout, JSONMixin):
    plot_container = ObjectProperty(None)
    scan_controls = ObjectProperty(None)
    status_bar = ObjectProperty(None)
    current_filename = StringProperty()
Esempio n. 4
0
import os

BASE_PATH = os.path.dirname(os.path.abspath(__file__))

from kivy.garden import iconfonts
iconfonts.register('default_font',
                   os.path.join(BASE_PATH, 'fonts', 'fontawesome-webfont.ttf'),
                   os.path.join(BASE_PATH, 'fonts', 'font-awesome.fontd'))

from kivy.uix.boxlayout import BoxLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.popup import Popup
from kivy.app import App
from kivy.properties import (
    ObjectProperty,
    NumericProperty,
    StringProperty,
)

from wwb_scanner.core import JSONMixin
from wwb_scanner.ui.kivyui import plots
from wwb_scanner.ui.kivyui import scan
from wwb_scanner.ui.kivyui import actions
from wwb_scanner.ui.kivyui.actions import Action


class RootWidget(BoxLayout, JSONMixin):
    plot_container = ObjectProperty(None)
    scan_controls = ObjectProperty(None)
    status_bar = ObjectProperty(None)
    current_filename = StringProperty()
Esempio n. 5
0
#!/usr/bin/env python
from datetime import datetime
from random import randint

import kivy
kivy.require('1.10.0')

from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.image import Image
from kivy.properties import DictProperty, ObjectProperty, StringProperty
from kivy.clock import Clock
from kivy.garden import iconfonts

iconfonts.register('default_font', 'fonts/icomoon.ttf', 'fonts/icomoon.fontd')


class Screen(BoxLayout):
    now = ObjectProperty(datetime.now(), rebind=True)
    background_image = ObjectProperty()

    def __init__(self, **kwargs):
        super(Screen, self).__init__(**kwargs)

        self.background_image = Image(source='background.jpg').texture
        self.background_image.wrap = 'repeat'
        self.background_image.uvsize = (1, -1)

        Clock.schedule_interval(self.update, 0.1)
        self.update()
Esempio n. 6
0
            oButton.bind (on_release=self.On_ButtonPressed)
    def set_value(self, section, key, value):
        # set_value normally reads the configparser values and runs on an error
        # to do nothing here
        return
    def On_ButtonPressed(self,instance):
        if instance.ID =="button_clear_cons":
            name_provider.delete_con_rating()
        self.panel.settings.dispatch('on_config_change',self.panel.config, self.section, self.key, instance.ID)

class BackPopup(Popup):
    def go_back(self, *args):
        self.dismiss()
        App.get_running_app().go_back = App.get_running_app().go_back_default

iconfonts.register('default_font', 'flaticon.ttf', 'flaticon.fontd')
name_provider = NameProvider()
Window.clearcolor = get_color_from_hex('#ffffff')
presentation = Builder.load_file("android.kv")

class AndroidApp(App):
    icon = "res/logo.png"
    use_kivy_settings  =  False

    def build(self):
        self.mainwidget = presentation
        self.go_back = self.go_back_default

        self.update_after_config()
        self.bind(on_start=self.post_build_init)
Esempio n. 7
0
from app import MainApp
from kivy.garden.iconfonts import register

from os.path import dirname, join

fonts_dir = join(dirname(__file__),
                 'app/assets/fonts/Material-Design-Iconic-Font.ttf')
zmd_file = join(dirname(__file__), 'app/assets/fonts/zmd.fontd')

if __name__ == '__main__':
    register('MatIcons', fonts_dir, zmd_file)
    MainApp().run()
Esempio n. 8
0
from app import MainApp
from kivy.garden.iconfonts import register

from os.path import dirname, join

if __name__ == '__main__':
    register(
        "MatIcons",
        join(dirname(__file__),
             'app/assets/fonts/Material-Design-Iconic-Font.ttf'),
        join(dirname(__file__), 'app/assets/fonts/zmd.fontd'))

    MainApp().run()
Esempio n. 9
0
PRINTER = 'ZJ-58_2'
# Pi Camera v2 Hardware 3280 × 2464 pixels
RESOLUTION = (960, 960)
STORAGE_FOLDER = 'pictures'
# Backlight timeout for extinction in seconds
BACKLIGHT_TIMEOUT = 300
# File to indicate nice exit
EXIT_INDICATOR = Path(__file__).parent / "selfie.exit"
# Initial email addresses list
EMAILS_LIST = Path(__file__).parent / "emails.csv"

bl = Backlight()

curdir = osp.dirname(osp.realpath(__file__))
iconfonts.register('default_font',
                   osp.join(curdir, 'data', 'fontawesome-webfont.ttf'),
                   osp.join(curdir, 'data', 'font-awesome.fontd'))


def is_printer_printing():
    p = Popen(["lpstat", "-p"], stdout=PIPE, stderr=PIPE)
    out, err = p.communicate()
    return re.search(r"ZJ-58.*printing", out.decode('utf-8')) is not None


class ComboEdit(TextInput):
    options = ListProperty((Button(text=''), ))

    def __init__(self, **kwargs):
        self.email_db = []
        if EMAILS_LIST.exists():
Esempio n. 10
0
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.lang.builder import Builder
from kivy.logger import Logger
from kivy.garden import iconfonts
from port_handler import port_handler
from kivy.uix.popup import Popup
from kivy.lang import Builder

from collections import deque, OrderedDict
from graph import EditableGraph, Axis, LineData
from kivy.clock import Clock

from common import resource_path

iconfonts.register('default_font', resource_path('data', 'fa-regular-400.ttf'),
                   resource_path('data', 'fontawesome.fontd'))
iconfonts.register('default_font', resource_path('data', 'fa-brands-400.ttf'),
                   resource_path('data', 'fontawesome.fontd'))
iconfonts.register('default_font', resource_path('data', 'fa-solid-900.ttf'),
                   resource_path('data', 'fontawesome.fontd'))

# default_freq = [90, 91, 93, 96, 100, 105, 111, 118, 126, 135, 145, 156, 168, 181, 195, 210, 226, 243, 261, 280, 300, 325, 360, 405, 460, 525, 600, 685, 780, 875, 960, 1025, 1070, 1105, 1130, 1150, 1165, 1180, 1195, 1210, 1225]
# default_pause = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 480, 370, 288, 233, 192, 163, 142, 128, 120, 112, 105, 98, 91, 84, 78, 72, 66, 60, 54, 48, 42]
# default_length = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 320, 265, 215, 180, 150, 125, 108, 97, 90, 83, 77, 72, 67, 62, 57, 52, 47, 42, 37, 32, 27]

Builder.load_file(resource_path('data', 'vario2.kv'))

default_freq = [0] * 41
default_pause = [0] * 41
default_length = [0] * 41