Browse Source

Initial setup.py

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

+ 4
- 4
Makefile View File

@@ -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

+ 2
- 4
docs/installation.rst View File

@@ -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
~~~~~~~


+ 7
- 2
docs/usage.rst View File

@@ -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.

+ 0
- 7
hadaly.py View File

@@ -1,7 +0,0 @@
#!/usr/bin/env python
#-*- coding: utf-8 -*-

from hadaly.__main__ import main

if __name__ == '__main__':
main()

+ 7
- 7
hadaly/__main__.py View File

@@ -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()




+ 6
- 6
hadaly/app.py View File

@@ -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()



data/fonts/fontawesome-webfont.ttf → hadaly/data/fonts/fontawesome-webfont.ttf View File


data/icon.png → hadaly/data/icon.png View File


data/icon/128x128/icon.png → hadaly/data/icon/128x128/icon.png View File


data/icon/32x32/icon.png → hadaly/data/icon/32x32/icon.png View File


data/icon/48x48/icon.png → hadaly/data/icon/48x48/icon.png View File


data/icon/64x64/icon.png → hadaly/data/icon/64x64/icon.png View File


data/icon/icon.ico → hadaly/data/icon/icon.ico View File


data/icon/icon.svg → hadaly/data/icon/icon.svg View File


data/locales/po/fr.po → hadaly/data/locales/po/fr.po View File


data/presplash.jpg → hadaly/data/presplash.jpg View File


data/settings_panel.json → hadaly/data/settings_panel.json View File


+ 1
- 1
hadaly/editor.py View File

@@ -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


+ 3
- 3
hadaly/hadaly.kv View File

@@ -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
- 0
hadaly/meta.py View File

@@ -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'

+ 1
- 1
hadaly/search.py View File

@@ -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


+ 1
- 1
hadaly/viewer.py View File

@@ -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
- 0
scripts/hadaly View File

@@ -0,0 +1,5 @@
#!/usr/bin/env python
import runpy

if __name__ == '__main__':
runpy.run_module('hadaly', run_name=__name__, alter_sys=True)

+ 37
- 0
setup.py View File

@@ -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