def notesRoot(): dataLocation = os.path.expanduser('~/notes_db') try: # If you are using dcore system, take root from there. import dcore.data as data dataLocation = data.dcoreData() dataLocation = os.path.join(dataLocation, 'notes_db') except ImportError as e: pass #If want to test... #dataLocation = os.path.expanduser('~/Downloads/notes_db') return dataLocation
import sys import os import argparse import platform try: from tkinter import Tk except: pass import dcore.data as data path_ext_folder = data.pathExt() cacheFile = os.path.join(data.dcoreData(), '%s.cache' % os.path.split(__file__)[1]) cacheFilePerimated = cacheFile + ".deleted" tempBatch = cacheFile + '.temp.bat' def rememberDirs(): dirs = [os.getcwd()] dirs += getFileContent() bad = [d for d in dirs if not os.path.isdir(d) and not (len(d.split(',')) == 2 and os.path.isdir(d.split(',')[1]))] print('Removing non-existent directories: %s.' % bad) dirs = [d for d in dirs if d not in bad] setFileContent( dirs ) # need to read again because might be different if there are duplicates
import os import dcore.data as data dbFile = os.path.join(data.dcoreData(), 'work_tracking_db.json') htmlFile = os.path.join(data.dcoreData(), 'work_tracking.html') dataFile = os.path.join(data.dcoreData(), 'data.js') mainDir = os.path.abspath(os.path.dirname(__file__)) utFolder = os.path.abspath('./unit_tests_inout')
def getPrivateDataFilename(): return os.path.join(data.dcoreData(), "private_file_v2")