Mercurial > hrm
changeset 12:97fb91f12cb7
Added BSD license, TODOs, fixed a bug in config file writing.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Mon, 08 Dec 2008 15:58:51 -0800 |
parents | 220a8a38dedd |
children | 54668eda7f1d |
files | kharon.py |
diffstat | 1 files changed, 42 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/kharon.py Mon Dec 08 15:41:38 2008 -0800 +++ b/kharon.py Mon Dec 08 15:58:51 2008 -0800 @@ -1,9 +1,49 @@ #! /usr/bin/env python3.0 +# ---------------------------------------------------------------------------- +# Copyright (c) 2006, Atul Varma +# 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 Kharon 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 THE +# COPYRIGHT OWNER OR CONTRIBUTORS 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. +# ---------------------------------------------------------------------------- ''' - This is a drop-in replacement for rm, with support for undo. + This is Kharon, a drop-in replacement for rm, with support for undo. ''' +# TODO: +# +# * Add support for expiration, so that if removed files aren't undeleted +# within a certain amount of time, they are purged. +# +# * Optional log messages for deletions. + import os import re import sys @@ -27,7 +67,7 @@ def save(self): state = {} keys = [key for key in self.__dict__ - if not key.startswith('__')] + if not key.startswith('_')] for key in keys: state[key] = self.__dict__[key] json.dump(state, open(self.__filename, 'w'))