#!/usr/bin/env python2
from xdg.DesktopEntry import *

import os, sys

def checkfiles(path):
	if os.path.isdir(path):
		ls = os.listdir(path)
		for file in ls:
			checkfiles(os.path.join(path, file))
	else:
		entry = DesktopEntry()
		try:
			entry.parse(path)
		except ParsingError, e:
			print e
			return

		entry.setLocale("C")
		for i in range(1,100000):
			entry.getName()

#		try:
#			entry.validate()
#		except ValidationError, e:
#			print e

try:
	checkfiles(sys.argv[1])

except IndexError:
	print("No file or directory given!")

@@ -328,37 +328,8 @@
 C%22)%0A
-%09%09for i in range(1,100000):%0A%09
 %09%09en
@@ -347,17 +347,15 @@
 ()%0A%0A
-#
 %09%09try:%0A
-#
 %09%09%09e
@@ -370,17 +370,16 @@
 idate()%0A
-#
 %09%09except
@@ -399,17 +399,16 @@
 ror, e:%0A
-#
 %09%09%09print

revert old test-desktop.py