Created
March 16, 2015 08:10
-
-
Save hpk42/a59c80a35d80e731e5bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+def get_name_version_doczip(path): | |
+ path = str(path) | |
+ DOCZIPSUFFIX = ".doc.zip" | |
+ assert path.endswith(DOCZIPSUFFIX) | |
+ fn = path[:-len(DOCZIPSUFFIX)] | |
+ # for documentation we presume that versions do not contain "-" | |
+ name, version = re.match("(.*)-([a-zA-Z0-9\.!]+)", fn).groups() | |
+ return name, version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment