Browse Source

Initial setup.py

- Refactored project structure.
- Fixed import.
- Add launch script.
- Fixed *.mo loading dir.
- Updated documentation
fix_readme
octogene 6 years ago
parent
commit
dcd06a2d17
  1. 8
      Makefile
  2. 6
      docs/installation.rst
  3. 9
      docs/usage.rst
  4. 7
      hadaly.py
  5. 14
      hadaly/__main__.py
  6. 12
      hadaly/app.py
  7. 0
      hadaly/data/fonts/fontawesome-webfont.ttf
  8. 0
      hadaly/data/icon.png
  9. 0
      hadaly/data/icon/128x128/icon.png
  10. 0
      hadaly/data/icon/32x32/icon.png
  11. 0
      hadaly/data/icon/48x48/icon.png
  12. 0
      hadaly/data/icon/64x64/icon.png
  13. 0
      hadaly/data/icon/icon.ico
  14. 0
      hadaly/data/icon/icon.svg
  15. 0
      hadaly/data/locales/po/fr.po
  16. 0
      hadaly/data/presplash.jpg
  17. 0
      hadaly/data/settings_panel.json
  18. 2
      hadaly/editor.py
  19. 6
      hadaly/hadaly.kv
  20. 7
      hadaly/meta.py
  21. 2
      hadaly/search.py
  22. 2
      hadaly/viewer.py
  23. 5
      scripts/hadaly
  24. 37
      setup.py

8
Makefile

@ -1,9 +1,9 @@
.PHONY: po mo
po:
xgettext -LPython -o data/locales/po/hadaly.pot --from-code=UTF-8 hadaly/*.kv hadaly/*.py
msgmerge --update --no-fuzzy-matching --backup=off data/locales/po/fr.po data/locales/po/hadaly.pot
xgettext -LPython -o hadaly/data/locales/po/hadaly.pot --from-code=UTF-8 hadaly/*.kv hadaly/*.py
msgmerge --update --no-fuzzy-matching --backup=off hadaly/data/locales/po/fr.po hadaly/data/locales/po/hadaly.pot
mo:
mkdir -p data/locales/fr/LC_MESSAGES
msgfmt data/locales/po/fr.po -o data/locales/fr/LC_MESSAGES/hadaly.mo
mkdir -p hadaly/data/locales/fr/LC_MESSAGES
msgfmt hadaly/data/locales/po/fr.po -o hadaly/data/locales/fr/LC_MESSAGES/hadaly.mo

6
docs/installation.rst

@ -25,16 +25,14 @@ Requirements
::
pip install kivy-garden
garden install magnet
garden install filechooserthumbview
For now, no setup or binary are available, you have to clone the repository:
::
git clone https://github.com/octogene/hadaly.git
cd hadaly
python setup.py install
Windows
~~~~~~~

9
docs/usage.rst

@ -6,11 +6,16 @@ GNU/Linux
::
python hadaly.py [file.opah]
hadaly [file.opah]
Windows
~~~~~~~
For now, to directly open a presentation file (\*.opah) you'll have to drag'n drop the file on the hadaly.exe executable or the shortcut.
::
hadaly.exe [file.opah]
Or open *.opah files like any other by double clicking on it.

7
hadaly.py

@ -1,7 +0,0 @@
#!/usr/bin/env python
#-*- coding: utf-8 -*-
from hadaly.__main__ import main
if __name__ == '__main__':
main()

14
hadaly/__main__.py

@ -1,19 +1,19 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '0.1a'
from __future__ import absolute_import
import os, sys
def main(args=None):
from app import HadalyApp
from .app import HadalyApp
import locale
import gettext
current_locale, encoding = locale.getdefaultlocale()
language = gettext.translation('hadaly', 'data/locales/',
[current_locale], fallback=True)
abspath = os.path.abspath(os.path.dirname(sys.argv[0]))
langpath = abspath + '/data/locales/'
language = gettext.translation('hadaly', langpath,
[current_locale])
language.install()
HadalyApp().run()

12
hadaly/app.py

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
from __future__ import division, unicode_literals, absolute_import
import shutil
from kivy import require
@ -9,7 +9,7 @@ require('1.9.0')
import os, json
from sys import argv
import __main__
from .meta import version as app_version
import urllib
import re
@ -32,16 +32,16 @@ from kivy.uix.popup import Popup
from kivy.uix.label import Label
from kivy.factory import Factory
from kivy.uix.progressbar import ProgressBar
from editor import Slide, SlideInfoDialog, DraggableSlide
from viewer import SlideBox
from .editor import Slide, SlideInfoDialog, DraggableSlide
from .viewer import SlideBox
from kivy.logger import Logger
from kivy.network.urlrequest import UrlRequest
from hadaly.search import ItemButton
from .search import ItemButton
from kivy.uix.filechooser import FileChooserIconView, FileChooserListView
class HadalyApp(App):
presentation = DictProperty({'app': ('hadaly', __main__.__version__), 'title': 'New Title', 'slides': []})
presentation = DictProperty({'app': ('hadaly', app_version), 'title': 'New Title', 'slides': []})
slides_list = ListProperty()

0
data/fonts/fontawesome-webfont.ttf → hadaly/data/fonts/fontawesome-webfont.ttf

0
data/icon.png → hadaly/data/icon.png

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

0
data/icon/128x128/icon.png → hadaly/data/icon/128x128/icon.png

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

0
data/icon/32x32/icon.png → hadaly/data/icon/32x32/icon.png

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

0
data/icon/48x48/icon.png → hadaly/data/icon/48x48/icon.png

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

0
data/icon/64x64/icon.png → hadaly/data/icon/64x64/icon.png

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

0
data/icon/icon.ico → hadaly/data/icon/icon.ico

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

0
data/icon/icon.svg → hadaly/data/icon/icon.svg

Before

Width:  |  Height:  |  Size: 668 KiB

After

Width:  |  Height:  |  Size: 668 KiB

0
data/locales/po/fr.po → hadaly/data/locales/po/fr.po

0
data/presplash.jpg → hadaly/data/presplash.jpg

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

0
data/settings_panel.json → hadaly/data/settings_panel.json

2
hadaly/editor.py

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
from __future__ import division, unicode_literals, absolute_import
import os
from functools import partial

6
hadaly/hadaly.kv

@ -1,4 +1,4 @@
#:kivy 1.9.0
#:include hadaly/editor.kv
#:include hadaly/viewer.kv
#:include hadaly/search.kv
#:include editor.kv
#:include viewer.kv
#:include search.kv

7
hadaly/meta.py

@ -0,0 +1,7 @@
"""This module contains metadata about the project."""
title = 'hadaly'
version = '0.1a'
description = 'Presentation software for art historians'
author = 'Bogdan Cordie'
author_email = 'ooctogene@gmail.com'
license = 'GPLv3'

2
hadaly/search.py

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
from __future__ import division, unicode_literals, absolute_import
try:
from urlparse import urlparse, parse_qs

2
hadaly/viewer.py

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
from __future__ import division, unicode_literals, absolute_import
from kivy.uix.screenmanager import Screen
from kivy.uix.scatter import Matrix

5
scripts/hadaly

@ -0,0 +1,5 @@
#!/usr/bin/env python
import runpy
if __name__ == '__main__':
runpy.run_module('hadaly', run_name=__name__, alter_sys=True)

37
setup.py

@ -0,0 +1,37 @@
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
from hadaly import meta
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='hadaly',
version=meta.version,
description=meta.description,
packages=find_packages(),
url='https://octogene.github.io/hadaly/',
license=meta.license,
author=meta.author,
author_email=meta.author_email,
requires=['lxml', 'Pillow', 'kivy'],
long_description=read('README.md'),
package_data={'hadaly': ['data/*.png',
'data/fonts/*.ttf',
'data/locales/fr/LC_MESSAGES/*.mo']},
include_package_data=True,
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: X11 Applications",
"Programming Language :: Python :: 2.7",
"Operating System :: OS Independent",
"Natural Language :: English",
"Natural Language :: French",
"Topic :: Education",
"Intended Audience :: Education",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
],
scripts = ['scripts/hadaly'],
zip_safe = False,
)
Loading…
Cancel
Save