File: python.py

package info (click to toggle)
lunar-calendar 3.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 292 kB
  • sloc: ansic: 812; xml: 37; sh: 28; javascript: 24; python: 23; makefile: 5
file content (34 lines) | stat: -rwxr-xr-x 824 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python
# -*- encoding:utf-8 -*-
# FileName: python.py

import gi

gi.require_version('Gtk', '3.0')
gi.require_version('LunarCalendar', '3.0')
from gi.repository import Gtk
from gi.repository import LunarCalendar
import sys

class CalWindow(Gtk.ApplicationWindow):
    def __init__(self, app):
        Gtk.Window.__init__(self, title="Lunar Calendar", application=app)
        calendar = LunarCalendar.Calendar()
        self.add(calendar)

class CalApplication(Gtk.Application):

    def __init__(self):
        Gtk.Application.__init__(self)

    def do_activate(self):
        win = CalWindow(self)
        win.show_all()

    def do_startup(self):
        Gtk.Application.do_startup(self)

if __name__ == '__main__':
    app = CalApplication()
    exit_status = app.run(sys.argv)
    sys.exit(exit_status)