Skip to content

Commit

Permalink
Huge source tree reorganization:
Browse files Browse the repository at this point in the history
- put all sources in a subdirectory (src/yokadi)
- create a yokadi package
- make a wrapper to allow running yokadi from source tree
- create a setup.py that allow to make a proper yokadi install in python site-package with executable in PATH
- add script to generate RPM package and Windows installer with icon on desktop and menu entry
- add LICENCE with GNU GPL v3
- add a Changelog (generated from git) a changelog generator script and Changelog-Synthesis (end user readable)
- create a version file that contains yokadi version
  • Loading branch information
digitalfox committed Mar 14, 2009
1 parent cb381a0 commit 0e07cb1
Show file tree
Hide file tree
Showing 34 changed files with 3,071 additions and 14 deletions.
2,237 changes: 2,237 additions & 0 deletions ChangeLog

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions ChangeLog-Synthesis
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
v0.9 2009/02/07
First public release. Fully usable for home and work.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
include MANIFEST.in
global-include *.py *.markdown *.sh
include update/update*to*
include *py
include ChangeLog
include README.markdown
include LICENSE
include MANIFEST.in
include version
include ChangeLog-Synthesis
include yokadi
3 changes: 3 additions & 0 deletions script/changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
cd $(dirname $0)/..
git --no-pager log > ChangeLog
File renamed without changes.
9 changes: 9 additions & 0 deletions script/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
# Release tarballs in various format
cd $(dirname $0)/..
for format in gztar rpm wininst
do
python setup.py bdist --format=$format
done
rm -rf build
rm MANIFEST
52 changes: 41 additions & 11 deletions setup.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,15 +1,45 @@
#!/usr/bin/env python
# coding: utf-8
#!/usr/bin/python
# -*- coding: utf-8 -*-

"""Setup script used to build and install Yokadi
@author: Sébastien Renard ([email protected])
@license:GNU GPL V3
"""

from distutils.core import setup
import sys
from os.path import dirname, join

# Additional files
data_files=[]
data_files.append(["share/yokadi",
["version", "README.markdown", "ChangeLog", "ChangeLog-Synthesis", "LICENSE"]])

# Scripts
scripts=["src/bin/yokadi"]

# Version
try:
version=file(join(dirname(__file__), "version")).readline().rstrip().rstrip("\n")
except Exception, e:
print "Warning, cannot read version file (%s)" % e
print "Defaulting to 'snapshot'"
version="snaphot"

setup(
name='yokadi',
version='0.9.0',
description='Command-line, sqlite-powered, TODO list',
author='Aurélien Gâteau',
author_email='[email protected]',
url='http://yokadi.github.com',
)
# Windows post install script
if "win" in " ".join(sys.argv[1:]):
scripts.append("w32_postinst.py")

# vi: ts=4 sw=4 et
#Go for setup
setup(name="yokadi",
version=version,
description="Command line oriented todo list system",
author="The Yokadi Team",
author_email="[email protected]",
url="http://yokadi.github.com/",
package_dir={"yokadi" : "src/yokadi"},
packages=["yokadi"],
scripts=scripts,
data_files=data_files
)
12 changes: 12 additions & 0 deletions src/bin/yokadi
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""This is just a wrapper to yokadi package that rely in standard python site-package
This wrapper is intended to be placed in user PATH and to be executable
@author: Sébastien Renard ([email protected])
@license:GNU GPL V3
"""

from yokadi import yokadi
yokadi.main()
7 changes: 7 additions & 0 deletions src/yokadi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
"""
Yokadi main package
@author: Aurélien Gâteau <[email protected]>
@author: Sébastien Renard <[email protected]>
@license:GNU GPL V3
"""
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.10
76 changes: 76 additions & 0 deletions w32_postinst.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
Post installation script for win32 system
Thanks to the coin coin projet for the inspiration for this postinstall script
@author: Sébastien Renard ([email protected])
@license:GNU GPL V3
"""

from os.path import abspath, join
from os import mkdir
import sys

# pylint: disable-msg=E0602

# Description string
desc="Command line oriented todo list system"
# Shortcut name
lnk="yokadi.lnk"

# Only do things at install stage, not uninstall
if sys.argv[1] == "-install":
# Get python.exe path
py_path = abspath(join(sys.prefix, "python.exe"))

# Yokadi wrapper path
yokadi_dir=abspath(join(sys.prefix, "scripts"))
yokadi_path=join(yokadi_dir, "yokadi")

#TODO: create a sexy yokadi .ico file to be put in share dir


# Find desktop
try:
desktop_path = get_special_folder_path("CSIDL_COMMON_DESKTOPDIRECTORY")
except OSError:
desktop_path = get_special_folder_path("CSIDL_DESKTOPDIRECTORY")

# Desktop shortcut creation
create_shortcut(py_path, # program to launch
desc,
join(desktop_path, lnk), # shortcut file
yokadi_path, # Argument (pythohn script)
yokadi_dir, # Current work dir
"" # Ico file (nothing for now)
)

# Tel install process that we create a file so it can removed it during uninstallation
file_created(join(desktop_path, lnk))

# Start menu shortcut creation
try:
start_path = get_special_folder_path("CSIDL_COMMON_PROGRAMS")
except OSError:
start_path = get_special_folder_path("CSIDL_PROGRAMS")

# Menu folder creation
programs_path = join(start_path, "Yokadi")
try:
mkdir(programs_path)
except OSError:
pass
directory_created(programs_path)

create_shortcut(py_path, # program to launch
desc,
join(programs_path, lnk), # Shortcut file
yokadi_path, # Argument (python script)
yokadi_dir, # Cuurent work dir
"" # Icone
)
file_created(join(programs_path, lnk))

# End of script
sys.exit()
2 changes: 1 addition & 1 deletion yokadi

0 comments on commit 0e07cb1

Please sign in to comment.