# Path: lib/utilities.py
# TOKENIZER = None
# ACK_LANGUAGE_MAP = {
#     'c': 'cc',
#     'c++': 'cpp',
#     'c#': 'csharp',
#     'objective-c': 'objc',
#     'ojective-c++': 'objcpp',
# }
# def get_cache_hits():
# def get_loc(path, files=None):
# def search(
#     pattern, path, recursive=True, whole=False, ignorecase=False, include=None,
#     exclude=None
# ):
# def url_to_json(url, headers={}):
# def get_repo_path(repo_id, repositories_dir):
# def clone(owner, name, directory, date=None):
# def read(jsonfile):
# def parse_datetime_delta(datetime_delta):
# def is_cloneable(owner, name):
# def get_files(path, language):


import sys
from lib import utilities


MAP = {
    'C': ['C', 'C/C++ Header'],
    'C++': ['C++', 'C/C++ Header'],
    'Objective C': ['Objective C', 'C/C++ Header']
}


def run(project_id, repo_path, cursor, **options):
    threshold = options.get('threshold', 0)

    query = 'SELECT language FROM projects WHERE id = %d' % project_id
    cursor.execute(query)

    record = cursor.fetchone()
    language = record[0]
    languages = MAP[language] if language in MAP else [language]


# Path: lib/utilities.py
# TOKENIZER = None
# ACK_LANGUAGE_MAP = {
#     'c': 'cc',
#     'c++': 'cpp',
#     'c#': 'csharp',
#     'objective-c': 'objc',
#     'ojective-c++': 'objcpp',
# }
# def get_cache_hits():
# def get_loc(path, files=None):
# def search(
#     pattern, path, recursive=True, whole=False, ignorecase=False, include=None,
#     exclude=None
# ):
# def url_to_json(url, headers={}):
# def get_repo_path(repo_id, repositories_dir):
# def clone(owner, name, directory, date=None):
# def read(jsonfile):
# def parse_datetime_delta(datetime_delta):
# def is_cloneable(owner, name):
# def get_files(path, language):


# Path: attributes/project_size/main.py
import sys
from lib import utilities



MAP = {
    'C': ['C', 'C/C++ Header'],
    'C++': ['C++', 'C/C++ Header'],
    'Objective C': ['Objective C', 'C/C++ Header']
}


def run(project_id, repo_path, cursor, **options):
    threshold = options.get('threshold', 0)

    query = 'SELECT language FROM projects WHERE id = %d' % project_id
    cursor.execute(query)

    record = cursor.fetchone()
    language = record[0]
    languages = MAP[language] if language in MAP else [language]


    sloc = utilities.get_loc(repo_path)