Commit b082dcee authored by Simon Pintarelli's avatar Simon Pintarelli

bugfix in get_ftype

parent 87a5e393
......@@ -94,13 +94,13 @@ def get_ftype(fname):
code_matches = []
# unix file command does not always recognize python scripts
if text_matches and fname[:-3] == '.py':
if text_matches and fname[-3:] == '.py':
text_matches = []
code_matches = ['Python script']
if text_matches and fname[:-4] == '.cpp':
if text_matches and fname[-4:] == '.cpp':
text_matches = []
code_matches = ['C++ source file']
if text_matches and fname[:-2] == '.c':
if text_matches and fname[-2:] == '.c':
text_matches = []
code_matches = ['C source file']
......@@ -210,6 +210,14 @@ def tex_verb_listing(dd):
def collect_files(dirname):
Keyword Arguments:
dirname -- directory name
dictionary `section_label` -> list of files
default value is an empty list
all_files = []
for dirpath, subdirs, files in os.walk(dirname):
......@@ -373,7 +381,7 @@ def main(dirname, ip, identifier, original_files=[], lecture_title='', template_
r'\hline\multicolumn{3}{|l|}{\textbf{Modified (duplicates)}}\\\hline')
for item in filter(
lambda x: (x['is_modified'] is True and x['omitted'] is False
lambda x: (x['is_modified'] is True and x['omitted'] is False
and x['is_duplicate'] is True and not x['ftype'] == 'symbolic link'),
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment