Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import sys
  2.  
  3. from snapcraft import storeapi
  4. from snapcraft._store import _login
  5.  
  6.  
  7. def _acquire_credentials(packages, channels):
  8. store = storeapi.StoreClient()
  9. if not _login(store, packages=packages, channels=channels, save=False):
  10. raise RuntimeError(
  11. 'Cannot continue without logging in successfully.')
  12.  
  13. store.conf.parser.write(sys.stdout)
  14. sys.stdout.flush()
  15.  
  16.  
  17. def main():
  18. series = storeapi.constants.DEFAULT_SERIES
  19. snap_name = "firefox"
  20.  
  21. packages = [{'name': snap_name, 'series': series}]
  22. channels = ['edge']
  23. _acquire_credentials(packages, channels)
  24.  
  25.  
  26. if __name__ == "__main__":
  27. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement