gitinspector/interval.py
Adam Waldenberg f4c3285cb8 Added the ability to limit results by date range (Fixes issue 1).
This can now be done by supplying one (or both) of the "--since" and
"--until" parameters to the gitinspector executable. These parameters
work in the same manner as they do in git and accept the same values.
Statistics will only be generated from data between the given interval.
2013-05-01 23:09:10 +02:00

49 lines
1.2 KiB
Python

#!/usr/bin/python
# coding: utf-8
#
# Copyright © 2012-2013 Ejwa Software. All rights reserved.
#
# This file is part of gitinspector.
#
# gitinspector 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.
#
# gitinspector 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 gitinspector. If not, see <http://www.gnu.org/licenses/>.
__since__ = ""
__until__ = ""
__ref__ = "HEAD"
def has_interval():
return __since__ + __until__ != ""
def get_since():
return __since__
def set_since(since):
global __since__
__since__ = "--since=\"" + since + "\" "
def get_until():
return __until__
def set_until(until):
global __until__
__until__ = "--until=\"" + until + "\" "
def get_ref():
return __ref__
def set_ref(ref):
global __ref__
__ref__ = ref