GoogleCloudPlatform / endpoints-proto-datastore

Apache License 2.0
154 stars 52 forks source link

Add script to make endpoints_proto_datastore.zip #15

Open dhermes opened 11 years ago

dhermes commented 11 years ago

To make endpoints_proto_datastore.zip for Downloads: http://code.google.com/p/endpoints-proto-datastore/downloads/detail?name=endpoints_proto_datastore.zip

I used a script and I'm not sure if it's worth adding or not. Contents here:

import os
import subprocess
import zipfile

FILES = [
    'endpoints_proto_datastore/__init__.py',
    'endpoints_proto_datastore/ndb/__init__.py',
    'endpoints_proto_datastore/ndb/model.py',
    'endpoints_proto_datastore/ndb/properties.py',
    'endpoints_proto_datastore/ndb/utils.py',
    'endpoints_proto_datastore/utils.py',
]

def main():
  git_root_process = subprocess.Popen(['git', 'rev-parse', '--show-toplevel'],
                                      stdout=subprocess.PIPE)
  git_root_process.wait()
  git_root = git_root_process.stdout.read().strip()
  print 'Process changing directory to', git_root
  os.chdir(git_root)

  with zipfile.ZipFile('endpoints_proto_datastore.zip', 'w') as library_zip:
    for filename in FILES:
      print 'Writing', filename
      library_zip.write(filename)

if __name__ == '__main__':
  main()

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata: sub>author.htmlLink=https://code.google.com/u/dhermes@google.com/</sub sub>author.name=dhermes@google.com</sub id=0 published=2013-02-18T03:24:20.000Z

Code Hosting Issue Metadata: published=2013-02-18T03:24:20.000Z stars=1 updated=2013-02-18T03:24:20.000Z originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=45 sub>author=@dhermes</sub

Bekt commented 10 years ago

Can this be closed since the repo is on GitHub now?

dhermes commented 10 years ago

I still have a custom branch for hosting zipfiles: https://github.com/GoogleCloudPlatform/endpoints-proto-datastore/tree/zipfile-branch

The current way I create them is using zip from the command line, which is too hacky.

The script above would do the trick, and should probably be added to that branch.

Bekt commented 10 years ago

I see, thanks for clarification. I was going through open issues to look if there are any issues that are similar to what I'm looking for. Just wanted to make sure all open issues are still valid.

dhermes commented 10 years ago

I really appreciate the effort. Thanks!