Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from snapcraft import storeapi
- from snapcraft._store import _login
- def _acquire_credentials(packages, channels):
- store = storeapi.StoreClient()
- if not _login(store, packages=packages, channels=channels, save=False):
- raise RuntimeError(
- 'Cannot continue without logging in successfully.')
- store.conf.parser.write(sys.stdout)
- sys.stdout.flush()
- def main():
- series = storeapi.constants.DEFAULT_SERIES
- snap_name = "firefox"
- packages = [{'name': snap_name, 'series': series}]
- channels = ['edge']
- _acquire_credentials(packages, channels)
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement