Skip to content

Commit

Permalink
index example prototype pointing to live backup of diary files
Browse files Browse the repository at this point in the history
  • Loading branch information
acutesoftware committed Feb 15, 2017
1 parent 3123051 commit fc0c220
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions aikif/.z_prototype/ex_index_mydocs.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
# coding: utf-8
# ex_index_mydocs.py written by Duncan Murray 22/5/2014
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# ex_index_mydocs.py
# Example program to index all personal data for keyword searches using AIKIF.
# Source data is taken from Acute Softwares Diary and FileLister

import os
import sys
import aikif.index as ndx
import aikif.config as mod_cfg
import aikif.lib.cls_filelist as mod_fl


local_folder = mod_cfg.fldrs['pers_data'] + os.sep + 'diary' + os.sep
diary_folder = 'C:\\APPS\\netDiary\\data'
diary_folder = os.path.join('T:\\','user','AIKIF','diary','netDiary_backup')

manual_files_to_index = [
local_folder + 'diary_Ent_duncan.txt',
print('diary_folder = ', diary_folder)
print('local_folder = ', local_folder)

sys.exit

manual_files_to_index = [ # local_folder + 'diary_Ent_duncan.txt',
local_folder + 'lf_folders.csv',
local_folder + 'lf_files.csv'
]
Expand All @@ -34,7 +40,7 @@ def main():
try:
numFiles += 1
print('indexing ', str(numFiles) , ' of ', str(len(all_files)), ' : ', f)
ndx.buildIndex(f, ndxFile, 'Y', 'N') # run the index routine
ndx.buildIndex(f, ndxFile, 'Y', 'Y') # run the index routine
except Exception:
print('ERROR - cant index file ', f)

Expand All @@ -44,7 +50,7 @@ def main():

def add_diary_files_to_list(lst, fldr):
""" adds all Diary files from folder to the lst """
fl = mod_fl.FileList([fldr], ['D2014*.DAT'], ["__pycache__", ".git"], "temp.csv")
fl = mod_fl.FileList([fldr], ['D2013*.DAT'], ["__pycache__", ".git"], "temp.csv")

for f in fl.get_list():
lst.append(f)
Expand Down

0 comments on commit fc0c220

Please sign in to comment.