Browse Source

Read testing environment variable

Determine if an XDGMENUMAKER_TEST exists and equals "1". If it does,
read the .desktop files from the tests directory instead of reading the
standard systemwide and homedir .desktop files.
pull/5/head
George Vlahavas 9 years ago
parent
commit
258978281f
  1. 7
      src/xdgmenumaker

7
src/xdgmenumaker

@ -314,6 +314,13 @@ def sortedcategories(applist):
def desktopfilelist():
# if this env variable is set to 1, then only read .desktop files from the
# tests directory, not systemwide. This gives a standard set of .desktop
# files to compare against for testing.
testing = os.getenv('XDGMENUMAKER_TEST')
if testing == "1":
dirs = ['../tests']
else:
dirs = []
# some directories are mentioned twice in bd.xdg_data_dirs, once
# with and once without a trailing /

Loading…
Cancel
Save