/
gphotoframe
executable file
·44 lines (32 loc) · 918 Bytes
/
gphotoframe
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
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/python
#
# gphotoframe - Photo Frame for the GNOME Desktop.
#
# Copyright (c) 2009-2011, Yoshizumi Endo.
# Licence: GPL3
import os
import platform
from os.path import join, abspath, dirname
try:
from gi.repository import GtkClutter
GtkClutter.init([])
# from gi.repository import GObject
# GObject.threads_init()
except ImportError:
pass
try:
from lib.utils import gtk3reactor
except ImportError:
from gphotoframe.utils import gtk3reactor
gtk3reactor.install()
from twisted.internet import reactor
from twisted.web import server
from gphotoframe.liststore import PhotoListStore
from gphotoframe.defaultsource import set_default_photo_source
from gphotoframe.api_service import APIServer
if __name__ == '__main__':
set_default_photo_source()
photo = PhotoListStore()
site = server.Site(APIServer(photo))
reactor.listenTCP(5000, site)
reactor.run()