# Path: ififuncs.py
# def make_desktop_logs_dir():
#     desktop_logs_dir = os.path.expanduser("~/Desktop/ifiscripts_logs")
#     if not os.path.isdir(desktop_logs_dir):
#         #I should probably ask permission here, or ask for alternative location
#         os.makedirs(desktop_logs_dir)
#     return desktop_logs_dir


import sys
import os
import argparse
import time
import unicodedata
import ififuncs
from ififuncs import make_desktop_logs_dir
    logs_dir = os.path.join(sip_dir, 'logs')
    logfile = os.path.join(logs_dir, logname)
    if os.path.isfile(logfile):
        with open(log, 'r') as fo:
            validate_log = fo.readlines()
        with open(logfile, 'a') as ba:
            for lines in validate_log:
                ba.write(lines)
        for possible_manifest in possible_manifests:
            if os.path.isfile(possible_manifest):
                with open(possible_manifest, 'r') as manifesto:
                    manifest_lines = manifesto.readlines()
                    for lines in manifest_lines:
                        if logname in lines:
                            if 'manifest-sha512.txt' in possible_manifest:
                                lines = lines[:127].replace(lines[:127], ififuncs.hashlib_sha512(logfile)) + lines[128:]
                            elif '_manifest.md5' in possible_manifest:
                                lines = lines[:31].replace(lines[:31], ififuncs.hashlib_md5(logfile)) + lines[32:]
                        updated_manifest.append(lines)
                with open(possible_manifest, 'w') as fo:
                    for lines in updated_manifest:
                        fo.write(lines)
                updated_manifest = []


def main(args_):
    '''
    Launches all other functions when called from the command line.
    '''
    args = make_parser(args_)

# Path: ififuncs.py
# def make_desktop_logs_dir():
#     desktop_logs_dir = os.path.expanduser("~/Desktop/ifiscripts_logs")
#     if not os.path.isdir(desktop_logs_dir):
#         #I should probably ask permission here, or ask for alternative location
#         os.makedirs(desktop_logs_dir)
#     return desktop_logs_dir


# Path: validate.py
import sys
import os
import argparse
import time
import unicodedata
import ififuncs
from ififuncs import make_desktop_logs_dir

    logs_dir = os.path.join(sip_dir, 'logs')
    logfile = os.path.join(logs_dir, logname)
    if os.path.isfile(logfile):
        with open(log, 'r') as fo:
            validate_log = fo.readlines()
        with open(logfile, 'a') as ba:
            for lines in validate_log:
                ba.write(lines)
        for possible_manifest in possible_manifests:
            if os.path.isfile(possible_manifest):
                with open(possible_manifest, 'r') as manifesto:
                    manifest_lines = manifesto.readlines()
                    for lines in manifest_lines:
                        if logname in lines:
                            if 'manifest-sha512.txt' in possible_manifest:
                                lines = lines[:127].replace(lines[:127], ififuncs.hashlib_sha512(logfile)) + lines[128:]
                            elif '_manifest.md5' in possible_manifest:
                                lines = lines[:31].replace(lines[:31], ififuncs.hashlib_md5(logfile)) + lines[32:]
                        updated_manifest.append(lines)
                with open(possible_manifest, 'w') as fo:
                    for lines in updated_manifest:
                        fo.write(lines)
                updated_manifest = []


def main(args_):
    '''
    Launches all other functions when called from the command line.
    '''
    args = make_parser(args_)

    desktop_logs_dir = make_desktop_logs_dir()