forked from hforge/ikaaro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
58 lines (48 loc) · 1.83 KB
/
__init__.py
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# -*- coding: UTF-8 -*-
# Copyright (C) 2006-2007 Nicolas Deram <[email protected]>
# Copyright (C) 2006-2008 Juan David Ibáñez Palomar <[email protected]>
# Copyright (C) 2007 Hervé Cauwelier <[email protected]>
# Copyright (C) 2008 Sylvain Taverne <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Import from itools
from itools.core import get_abspath, get_version
from itools.gettext import register_domain
# Import from ikaaro
from file import File
from folder import Folder
from registry import register_document_type
import root
from webpage import WebPage
# Check for required software
for name, import_path, reason in [
("poppler", "itools.pdf.pdftotext", "PDF indexation"),
("wv2", "itools.office.doctotext", "DOC indexation"),
("xlrd", "xlrd", "XLS indexation")]:
try:
__import__(import_path)
except ImportError:
print '%s: You need to install "%s" and reinstall itools.' % (reason,
name)
# The version
__version__ = get_version()
# Import required modules
import users
# Register the itools domain
path = get_abspath('locale')
register_domain('ikaaro', path)
# Register document types
register_document_type(WebPage)
register_document_type(Folder)
register_document_type(File)