Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /home/ift/52_procpy/fibu/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : //home/ift/52_procpy/fibu/acc_db.py

#  coding:  utf8

import procpy,os,sys,re,glob
import procpy.acc_kto
import sqlite3
import rules

#******************************************************************************

class Acc_db (object):

    def __init__ (self):
    
        self.rules = rules.Rules()
        if "dbfile" in vars(self.rules):
            self.configure_sqlite(self.rules.dbfile)
        
#*******************************************************************************
    
    def configure_sqlite (self,dbfile):


        if type(dbfile) == type([]):
            if len(dbfile) > 1:
                return("ERROR 112. More than one db-file.")
            if len(dbfile) == 0:
                dbfile = ":memory:"
            else:
                dbfile = dbfile[0]
        
        self.db             = sqlite3.connect(dbfile)
        self.db.row_factory = sqlite3.Row

        cursor  = self.db.cursor()
        cursor.execute("create table if not exists buchungen " +
             "(DATUM,BETRAG,KTOA,KTOB,REMARK,FORMEL default '')")

        try:
            cursor.execute("create index DATUM_IDX  on buchungen (DATUM)"   )
            cursor.execute("create index KTOA_IDX   on buchungen (KTOA)"    )
            cursor.execute("create index KTOB_IDX   on buchungen (KTOB)"    )
        except Exception as e:
            pass

#        cursor.execute("create table if not exists buchungen " +
#             "(DATUM,BETRAG,KTOA,KTOB,REMARK,FORMEL default '')")
#
#        try:
#            cursor.execute("create index DATUM_IDX  on buchungen (DATUM)"   )
#            cursor.execute("create index KTOA_IDX   on buchungen (KTOA)"    )
#            cursor.execute("create index KTOB_IDX   on buchungen (KTOB)"    )
#        except Exception as e:
#            pass
#
#
#********************************************************************************

    def sync (self,uktofile):
    
        report = procpy.acc_kto.Acc_kto(uktofile,self.db,self.rules)        
        report.read_report_kto()

        dbhash = report.compute_dbhash()

        if report.ktohash == report.ktohash_new:  # Kontofile - oder die zugehoerigen Dateien - haben sich nicht geaendert

            if dbhash == report.dbhash:           #  Kontoeintraege in der Datenbank haben sich auch nicht geaendert.
                return("Kto is up-to-date")       #  Dann nichts machen

        print "-----------"
        buch = report.get_from_db()
        print "-----------"

        if not report.ktohash == report.ktohash_new:  # Kontofile - oder die zugehoerigen Dateien - haben sich geaendert

            print report.ukto,dbhash,report.dbhash
            if dbhash == report.dbhash or "xxxxxx" in (dbhash,report.dbhash):  #  wenn sich die Kontoeintraege in der
                cursor = self.db.cursor()                                      #  Datenbank nicht geaendert haben, dann
                cursor.execute("delete from buchungen where KTOA like '" +     #  koennen sie ueberschrieben werden
                                report.ukto1 + "%' OR " + " KTOB like '" + report.ukto1 + "'")
                report.store_to_db()
            else:   #  spezielle Merge-Strategie waehlen
#                report.merge()
                pass #   mergen!
                
                
            
        self.db.commit()

#        report.get_from_db()

#        print os.getcwd()
        

        
if __name__ == "__main__":
    Acc_db.__dict__[sys.argv[1]](Acc_db(),*sys.argv[2:])

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net