Skip to content

Instantly share code, notes, and snippets.

@hpk42
Created March 16, 2015 08:10
Show Gist options
  • Save hpk42/a59c80a35d80e731e5bd to your computer and use it in GitHub Desktop.
Save hpk42/a59c80a35d80e731e5bd to your computer and use it in GitHub Desktop.
+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