Skip to content

Commit

Permalink
Let's make this an egg.
Browse files Browse the repository at this point in the history
  • Loading branch information
reinhardt committed Nov 25, 2019
1 parent 1e4b928 commit c21d0a3
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 3 deletions.
11 changes: 11 additions & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:orphan:

Changelog
=========


1.0.0 (unreleased)
------------------

- Nothing changed yet.

32 changes: 32 additions & 0 deletions docs/LICENSE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
:orphan:

License (3-clause BSD)
======================

Copyright (c) 2013, Syslab.com GmbH. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

* Neither the name of Syslab.com GmbH. nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL SYSLAB.COM GMBH BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

File renamed without changes.
12 changes: 9 additions & 3 deletions octodon.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ def get_harvest_target(self, entry):
class Octodon(Cmd):
def __init__(self, config, spent_on, new_session=False, *args):
Cmd.__init__(self, *args)
self.config = get_config(cfgfile)
self.config = config

if config.get("main", "source") == "hamster":
self.time_log = HamsterTimeLog()
Expand All @@ -798,6 +798,8 @@ def __init__(self, config, spent_on, new_session=False, *args):
log_path = config.get("plaintext", "log_path")
self.time_log = ClockWorkTimeLog(log_path=log_path)

self.editor = config.get("main", "editor")

self.redmine = None
if config.has_section("redmine"):
if config.has_option("redmine", "password_command"):
Expand Down Expand Up @@ -983,7 +985,7 @@ def postcmd(self, stop, line):
def do_edit(self, *args):
""" Edit the current time booking values in an editor. """
subprocess.check_call(
[config.get("main", "editor") + " " + self.sessionfile], shell=True
[self.editor + " " + self.sessionfile], shell=True
)
activities = self.redmine and self.redmine.activities or []
spent_on, self.bookings = read_from_file(self.sessionfile, activities)
Expand Down Expand Up @@ -1063,7 +1065,7 @@ def get_config(cfgfile):
return config


if __name__ == "__main__":
def main():
parser = argparse.ArgumentParser(
description="Extract time tracking data "
"from hamster or emacs org mode and book it to redmine/jira/harvest"
Expand Down Expand Up @@ -1116,3 +1118,7 @@ def get_config(cfgfile):

octodon = Octodon(config, spent_on, new_session=args.new_session)
octodon.cmdloop()


if __name__ == "__main__":
main()
45 changes: 45 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
"""Installer for the octodon package."""

from setuptools import find_packages
from setuptools import setup

import os


def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()


long_description = (
read("README.rst") + read("docs", "CHANGELOG.rst") + read("docs", "LICENSE.rst")
)

setup(
name="octodon",
version="1.0.0.dev0",
description="Import, manage and export time tracking data",
long_description=long_description,
# Get more from http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
"Environment :: Console",
"Environment :: Plugins",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
],
keywords="time tracking harvest redmine jira",
author="Manuel Reinhardt",
author_email="manuel.reinhardt@neon-cathedral.net",
url="https://pypi.python.org/pypi/octodon",
license="BSD",
packages=find_packages(".", exclude=["ez_setup"]),
package_dir={"": "."},
include_package_data=True,
zip_safe=False,
install_requires=["jira", "pyactiveresource", "python-harvest", "setuptools"],
extras_require={"test": ["mock"]},
entry_points="""
[console_scripts]
octodon=octodon:main
""",
)

0 comments on commit c21d0a3

Please sign in to comment.