2017-12-06 18:26:38 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
#
|
|
|
|
# Copyright 2017 Google Inc.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
import os
|
2017-12-11 19:59:03 +00:00
|
|
|
import re
|
2017-12-06 18:26:38 +00:00
|
|
|
import sys
|
|
|
|
|
2017-12-11 19:59:03 +00:00
|
|
|
dirpath = sys.argv[1]
|
|
|
|
regex = re.compile(sys.argv[2])
|
2017-12-06 18:26:38 +00:00
|
|
|
|
2017-12-11 19:59:03 +00:00
|
|
|
print sorted(filter(regex.match, os.listdir(dirpath)))[-1]
|