File: getprevdir.py

package info (click to toggle)
fvwm-crystal 3.4.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 21,700 kB
  • ctags: 1,494
  • sloc: sh: 3,265; cs: 1,335; python: 875; makefile: 214
file content (10 lines) | stat: -rwxr-xr-x 281 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env python2
# Return the path to the previous mpd library directory
import sys

if __name__ == "__main__":
	if (sys.argv[1].rfind('/') == -1):
		#No slashes probably means we're one down from the mpd root
		print "''"
	else:
		print sys.argv[1][:sys.argv[1].rfind('/')]