csfile.py 1.74 KB
Newer Older
Daniel Armbruster's avatar
Daniel Armbruster committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
## @file csfile.py
# @brief  Provide a module to read, write and treat with a csback chechsumfile.
# 
# -----------------------------------------------------------------------------
# 
# $Id$
# @author Daniel Armbruster
# \date 15/09/2011
# 
# Purpose: Provide a module to read, write and treat with a csback checksumfile.
# file.
#
# ----
# This file is part of csback.
#
# csback 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.
# 
# csback 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 csback.  If not, see <http://www.gnu.org/licenses/>.
# ----
# 
# Copyright (c) 2011 by Daniel Armbruster
# 
# REVISIONS and CHANGES 
# 15/09/2011  V0.1    Daniel Armbruster
# 
# =============================================================================

Daniel Armbruster's avatar
Daniel Armbruster committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import os
import re
import hashlib

class csFile:
  def __init__(self, fname):
    self.__fname = fname
    self.__lines = []

  def __init__(self, fname, dir, hashfunc=hashlib.sha256):
    self.__fname = fname
    self.__dir = dir

  def __init__(self, fname, dir, regex, hashfunc=hashlib.sha256):
    self.__fname = fname
    self.__dir = dir

  def __getitem__(self, index):
    return self.__lines[index]

  def __setitem__(self, index, item):
    self.__lines[index] = item 
    
class csLine:
  def __init__(self, file, hashfunc = hashlib.sha256):
  
  
Daniel Armbruster's avatar
Daniel Armbruster committed
64
# ----- END OF csfile.py -----