Brian Osman | d34c4a3 | 2017-12-06 13:26:38 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # |
| 3 | # Copyright 2017 Google Inc. |
| 4 | # |
| 5 | # Use of this source code is governed by a BSD-style license that can be |
| 6 | # found in the LICENSE file. |
| 7 | |
Martin Vejdarski | beaaf47 | 2020-03-03 13:53:20 +0700 | [diff] [blame] | 8 | from __future__ import print_function |
| 9 | |
Brian Osman | d34c4a3 | 2017-12-06 13:26:38 -0500 | [diff] [blame] | 10 | import os |
Brian Osman | 5c54892 | 2017-12-11 14:59:03 -0500 | [diff] [blame] | 11 | import re |
Brian Osman | d34c4a3 | 2017-12-06 13:26:38 -0500 | [diff] [blame] | 12 | import sys |
| 13 | |
Brian Osman | 5c54892 | 2017-12-11 14:59:03 -0500 | [diff] [blame] | 14 | dirpath = sys.argv[1] |
| 15 | regex = re.compile(sys.argv[2]) |
Brian Osman | d34c4a3 | 2017-12-06 13:26:38 -0500 | [diff] [blame] | 16 | |
Martin Vejdarski | beaaf47 | 2020-03-03 13:53:20 +0700 | [diff] [blame] | 17 | print(sorted(filter(regex.match, os.listdir(dirpath)))[-1]) |