{"filter":false,"title":"install_stash.py","tooltip":"/Pythonista/install_stash.py","undoManager":{"mark":69,"position":69,"stack":[[{"start":{"row":0,"column":0},"end":{"row":156,"column":0},"action":"insert","lines":["","Skip to content","All gists","Back to GitHub","Sign in","Sign up","","Instantly share code, notes, and snippets.","@greinacker","greinacker/","pythonista-install-boto.py","forked from najibninaba/pythonista-install-boto.py","Created 5 years ago","","4","","    0","","Code","Revisions 4","Stars 4","Pythonista script for installing boto","pythonista-install-boto.py","# Source: https://gist.github.com/najibninaba/5062153","# ","# This script installs Boto in Pythonista. Run this script in your root folder and it will download and install Boto along with its","# dependencies. To use Boto, be sure to add boto-module in your sys.path before importing boto like so:","# import sys; sys.path.append('boto-module')","# import boto.ec2","#","# Credits:","# This script is inspired by omz's Evernote Installer script: https://gist.github.com/omz/5048588","#","","","packages = ['https://pypi.python.org/packages/source/b/boto/boto-2.8.0.tar.gz',","    'https://pypi.python.org/packages/source/m/mock/mock-1.0.1.tar.gz',","    'https://pypi.python.org/packages/source/r/rsa/rsa-3.1.1.tar.gz',","    'https://pypi.python.org/packages/source/t/tox/tox-1.4.zip',","    'https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.1.3.tar.gz',","    'https://pypi.python.org/packages/source/s/simplejson/simplejson-2.5.2.tar.gz',","    'http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz',","    'https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gz'","]","","configparser_src = 'http://hg.python.org/cpython/raw-file/70274d53c1dd/Lib/ConfigParser.py'","","import shutil","import urllib","from urlparse import urlparse","import tarfile","import zipfile","import os","","","def create_module_dir():","    try:","        os.mkdir('boto-module')","    except:","        pass","","","def get_filename_from_url(url):","    parsed_url = urlparse(url)","    return parsed_url.path.rpartition('/')[-1]","","def is_zipfile(f):","    return f.endswith('.zip')","","def is_targzfile(f):","    return f.endswith('.tar.gz')","","def download_packages():","    for f in packages:","        print('Downloading %s' % f)","        filepath, headers = urllib.urlretrieve(f)","        print('Extracting %s' % filepath)","        filename = get_filename_from_url(f)","        if is_targzfile(filename):","            t = tarfile.open(filepath, 'r')","            t.extractall()","            t.close()","        elif is_zipfile(filename):","            z = zipfile.ZipFile(filepath, 'r')","            z.extractall()","            z.close()","","def install_configparser_src():","    print('Installing ConfigParser...')","    filepath, headers = urllib.urlretrieve(configparser_src)","    shutil.move(filepath, 'boto-module/ConfigParser.py')","","def install_packages():","    print('Installing boto...')","    shutil.move('boto-2.8.0/boto', 'boto-module/boto')","    shutil.rmtree('boto-2.8.0')","","    print('Installing mock...')","    shutil.move('mock-1.0.1/mock.py', 'boto-module/mock.py')","    shutil.rmtree('mock-1.0.1')","","    print('Installing rsa...')","    shutil.move('rsa-3.1.1/rsa', 'boto-module/rsa')","    shutil.rmtree('rsa-3.1.1')","","    print('Installing tox...')","    shutil.move('tox-1.4/tox', 'boto-module/tox')","    shutil.rmtree('tox-1.4')","","    print('Installing Sphinx...')","    shutil.move('Sphinx-1.1.3/sphinx', 'boto-module/sphinx')","    shutil.rmtree('Sphinx-1.1.3')","","    print('Installing simplejson...')","    shutil.move('simplejson-2.5.2/simplejson', 'boto-module/simplejson')","    shutil.rmtree('simplejson-2.5.2')","","    print('Installing argparse...')","    shutil.move('argparse-1.2.1/argparse.py', 'boto-module/argparse.py')","    shutil.rmtree('argparse-1.2.1')","","    print('Installing unittest2...')","    shutil.move('unittest2-0.5.1/unittest2', 'boto-module/unittest2')","    shutil.rmtree('unittest2-0.5.1')","","def reload_pythonista_editor():","    print('Reloading Pythonista editor')","    import editor","    editor.reload_files()","","","if __name__ == '__main__':","    create_module_dir()","    download_packages()","    install_packages()","    install_configparser_src()","    reload_pythonista_editor()","    print('All done!')","    ","","to join this conversation on GitHub. Already have an account? Sign in to comment","","    © 2020 GitHub, Inc.","    Terms","    Privacy","    Security","    Status","    Help","","    Contact GitHub","    Pricing","    API","    Training","    Blog","    About","",""],"id":1}],[{"start":{"row":0,"column":0},"end":{"row":156,"column":0},"action":"remove","lines":["","Skip to content","All gists","Back to GitHub","Sign in","Sign up","","Instantly share code, notes, and snippets.","@greinacker","greinacker/","pythonista-install-boto.py","forked from najibninaba/pythonista-install-boto.py","Created 5 years ago","","4","","    0","","Code","Revisions 4","Stars 4","Pythonista script for installing boto","pythonista-install-boto.py","# Source: https://gist.github.com/najibninaba/5062153","# ","# This script installs Boto in Pythonista. Run this script in your root folder and it will download and install Boto along with its","# dependencies. To use Boto, be sure to add boto-module in your sys.path before importing boto like so:","# import sys; sys.path.append('boto-module')","# import boto.ec2","#","# Credits:","# This script is inspired by omz's Evernote Installer script: https://gist.github.com/omz/5048588","#","","","packages = ['https://pypi.python.org/packages/source/b/boto/boto-2.8.0.tar.gz',","    'https://pypi.python.org/packages/source/m/mock/mock-1.0.1.tar.gz',","    'https://pypi.python.org/packages/source/r/rsa/rsa-3.1.1.tar.gz',","    'https://pypi.python.org/packages/source/t/tox/tox-1.4.zip',","    'https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.1.3.tar.gz',","    'https://pypi.python.org/packages/source/s/simplejson/simplejson-2.5.2.tar.gz',","    'http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz',","    'https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gz'","]","","configparser_src = 'http://hg.python.org/cpython/raw-file/70274d53c1dd/Lib/ConfigParser.py'","","import shutil","import urllib","from urlparse import urlparse","import tarfile","import zipfile","import os","","","def create_module_dir():","    try:","        os.mkdir('boto-module')","    except:","        pass","","","def get_filename_from_url(url):","    parsed_url = urlparse(url)","    return parsed_url.path.rpartition('/')[-1]","","def is_zipfile(f):","    return f.endswith('.zip')","","def is_targzfile(f):","    return f.endswith('.tar.gz')","","def download_packages():","    for f in packages:","        print('Downloading %s' % f)","        filepath, headers = urllib.urlretrieve(f)","        print('Extracting %s' % filepath)","        filename = get_filename_from_url(f)","        if is_targzfile(filename):","            t = tarfile.open(filepath, 'r')","            t.extractall()","            t.close()","        elif is_zipfile(filename):","            z = zipfile.ZipFile(filepath, 'r')","            z.extractall()","            z.close()","","def install_configparser_src():","    print('Installing ConfigParser...')","    filepath, headers = urllib.urlretrieve(configparser_src)","    shutil.move(filepath, 'boto-module/ConfigParser.py')","","def install_packages():","    print('Installing boto...')","    shutil.move('boto-2.8.0/boto', 'boto-module/boto')","    shutil.rmtree('boto-2.8.0')","","    print('Installing mock...')","    shutil.move('mock-1.0.1/mock.py', 'boto-module/mock.py')","    shutil.rmtree('mock-1.0.1')","","    print('Installing rsa...')","    shutil.move('rsa-3.1.1/rsa', 'boto-module/rsa')","    shutil.rmtree('rsa-3.1.1')","","    print('Installing tox...')","    shutil.move('tox-1.4/tox', 'boto-module/tox')","    shutil.rmtree('tox-1.4')","","    print('Installing Sphinx...')","    shutil.move('Sphinx-1.1.3/sphinx', 'boto-module/sphinx')","    shutil.rmtree('Sphinx-1.1.3')","","    print('Installing simplejson...')","    shutil.move('simplejson-2.5.2/simplejson', 'boto-module/simplejson')","    shutil.rmtree('simplejson-2.5.2')","","    print('Installing argparse...')","    shutil.move('argparse-1.2.1/argparse.py', 'boto-module/argparse.py')","    shutil.rmtree('argparse-1.2.1')","","    print('Installing unittest2...')","    shutil.move('unittest2-0.5.1/unittest2', 'boto-module/unittest2')","    shutil.rmtree('unittest2-0.5.1')","","def reload_pythonista_editor():","    print('Reloading Pythonista editor')","    import editor","    editor.reload_files()","","","if __name__ == '__main__':","    create_module_dir()","    download_packages()","    install_packages()","    install_configparser_src()","    reload_pythonista_editor()","    print('All done!')","    ","","to join this conversation on GitHub. Already have an account? Sign in to comment","","    © 2020 GitHub, Inc.","    Terms","    Privacy","    Security","    Status","    Help","","    Contact GitHub","    Pricing","    API","    Training","    Blog","    About","",""],"id":2}],[{"start":{"row":0,"column":0},"end":{"row":118,"column":0},"action":"insert","lines":["# Source: https://gist.github.com/najibninaba/5062153","# ","# This script installs Boto in Pythonista. Run this script in your root folder and it will download and install Boto along with its","# dependencies. To use Boto, be sure to add boto-module in your sys.path before importing boto like so:","# import sys; sys.path.append('boto-module')","# import boto.ec2","#","# Credits:","# This script is inspired by omz's Evernote Installer script: https://gist.github.com/omz/5048588","#","","","packages = ['https://pypi.python.org/packages/source/b/boto/boto-2.8.0.tar.gz',","    'https://pypi.python.org/packages/source/m/mock/mock-1.0.1.tar.gz',","    'https://pypi.python.org/packages/source/r/rsa/rsa-3.1.1.tar.gz',","    'https://pypi.python.org/packages/source/t/tox/tox-1.4.zip',","    'https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.1.3.tar.gz',","    'https://pypi.python.org/packages/source/s/simplejson/simplejson-2.5.2.tar.gz',","    'http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz',","    'https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gz'","]","","configparser_src = 'http://hg.python.org/cpython/raw-file/70274d53c1dd/Lib/ConfigParser.py'","","import shutil","import urllib","from urlparse import urlparse","import tarfile","import zipfile","import os","","","def create_module_dir():","    try:","        os.mkdir('boto-module')","    except:","        pass","","","def get_filename_from_url(url):","    parsed_url = urlparse(url)","    return parsed_url.path.rpartition('/')[-1]","","def is_zipfile(f):","    return f.endswith('.zip')","","def is_targzfile(f):","    return f.endswith('.tar.gz')","","def download_packages():","    for f in packages:","        print('Downloading %s' % f)","        filepath, headers = urllib.urlretrieve(f)","        print('Extracting %s' % filepath)","        filename = get_filename_from_url(f)","        if is_targzfile(filename):","            t = tarfile.open(filepath, 'r')","            t.extractall()","            t.close()","        elif is_zipfile(filename):","            z = zipfile.ZipFile(filepath, 'r')","            z.extractall()","            z.close()","","def install_configparser_src():","    print('Installing ConfigParser...')","    filepath, headers = urllib.urlretrieve(configparser_src)","    shutil.move(filepath, 'boto-module/ConfigParser.py')","","def install_packages():","    print('Installing boto...')","    shutil.move('boto-2.8.0/boto', 'boto-module/boto')","    shutil.rmtree('boto-2.8.0')","","    print('Installing mock...')","    shutil.move('mock-1.0.1/mock.py', 'boto-module/mock.py')","    shutil.rmtree('mock-1.0.1')","","    print('Installing rsa...')","    shutil.move('rsa-3.1.1/rsa', 'boto-module/rsa')","    shutil.rmtree('rsa-3.1.1')","","    print('Installing tox...')","    shutil.move('tox-1.4/tox', 'boto-module/tox')","    shutil.rmtree('tox-1.4')","","    print('Installing Sphinx...')","    shutil.move('Sphinx-1.1.3/sphinx', 'boto-module/sphinx')","    shutil.rmtree('Sphinx-1.1.3')","","    print('Installing simplejson...')","    shutil.move('simplejson-2.5.2/simplejson', 'boto-module/simplejson')","    shutil.rmtree('simplejson-2.5.2')","","    print('Installing argparse...')","    shutil.move('argparse-1.2.1/argparse.py', 'boto-module/argparse.py')","    shutil.rmtree('argparse-1.2.1')","","    print('Installing unittest2...')","    shutil.move('unittest2-0.5.1/unittest2', 'boto-module/unittest2')","    shutil.rmtree('unittest2-0.5.1')","","def reload_pythonista_editor():","    print('Reloading Pythonista editor')","    import editor","    editor.reload_files()","","","if __name__ == '__main__':","    create_module_dir()","    download_packages()","    install_packages()","    install_configparser_src()","    reload_pythonista_editor()","    print('All done!')","    ","","",""],"id":3}],[{"start":{"row":117,"column":0},"end":{"row":118,"column":0},"action":"remove","lines":["",""],"id":4},{"start":{"row":116,"column":0},"end":{"row":117,"column":0},"action":"remove","lines":["",""]},{"start":{"row":115,"column":4},"end":{"row":116,"column":0},"action":"remove","lines":["",""]},{"start":{"row":115,"column":0},"end":{"row":115,"column":4},"action":"remove","lines":["    "]}],[{"start":{"row":0,"column":0},"end":{"row":0,"column":53},"action":"remove","lines":["# Source: https://gist.github.com/najibninaba/5062153"],"id":5}],[{"start":{"row":0,"column":0},"end":{"row":1,"column":0},"action":"remove","lines":["",""],"id":6}],[{"start":{"row":0,"column":0},"end":{"row":0,"column":2},"action":"remove","lines":["# "],"id":7},{"start":{"row":0,"column":0},"end":{"row":1,"column":0},"action":"remove","lines":["",""]}],[{"start":{"row":0,"column":78},"end":{"row":0,"column":79},"action":"remove","lines":[" "],"id":8}],[{"start":{"row":0,"column":78},"end":{"row":1,"column":0},"action":"insert","lines":["",""],"id":9}],[{"start":{"row":1,"column":0},"end":{"row":1,"column":1},"action":"insert","lines":["#"],"id":10}],[{"start":{"row":1,"column":1},"end":{"row":1,"column":2},"action":"insert","lines":[" "],"id":11}],[{"start":{"row":1,"column":54},"end":{"row":1,"column":55},"action":"insert","lines":[" "],"id":12}],[{"start":{"row":1,"column":55},"end":{"row":2,"column":2},"action":"remove","lines":["","# "],"id":13}],[{"start":{"row":1,"column":75},"end":{"row":1,"column":76},"action":"remove","lines":[" "],"id":14}],[{"start":{"row":1,"column":75},"end":{"row":2,"column":0},"action":"insert","lines":["",""],"id":15},{"start":{"row":2,"column":0},"end":{"row":2,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":2,"column":1},"end":{"row":2,"column":2},"action":"insert","lines":[" "],"id":16}],[{"start":{"row":2,"column":78},"end":{"row":2,"column":79},"action":"remove","lines":[" "],"id":17}],[{"start":{"row":2,"column":78},"end":{"row":3,"column":0},"action":"insert","lines":["",""],"id":18},{"start":{"row":3,"column":0},"end":{"row":3,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":3,"column":1},"end":{"row":3,"column":2},"action":"insert","lines":[" "],"id":19}],[{"start":{"row":3,"column":5},"end":{"row":4,"column":0},"action":"insert","lines":["",""],"id":20},{"start":{"row":4,"column":0},"end":{"row":4,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":5,"column":2},"end":{"row":5,"column":4},"action":"insert","lines":["  "],"id":21}],[{"start":{"row":6,"column":2},"end":{"row":6,"column":4},"action":"insert","lines":["  "],"id":22}],[{"start":{"row":9,"column":17},"end":{"row":9,"column":43},"action":"remove","lines":["inspired by omz's Evernote"],"id":23},{"start":{"row":9,"column":17},"end":{"row":9,"column":18},"action":"insert","lines":["b"]},{"start":{"row":9,"column":18},"end":{"row":9,"column":19},"action":"insert","lines":["a"]},{"start":{"row":9,"column":19},"end":{"row":9,"column":20},"action":"insert","lines":["s"]},{"start":{"row":9,"column":20},"end":{"row":9,"column":21},"action":"insert","lines":["e"]},{"start":{"row":9,"column":21},"end":{"row":9,"column":22},"action":"insert","lines":["d"]}],[{"start":{"row":9,"column":22},"end":{"row":9,"column":23},"action":"insert","lines":[" "],"id":24},{"start":{"row":9,"column":23},"end":{"row":9,"column":24},"action":"insert","lines":["o"]},{"start":{"row":9,"column":24},"end":{"row":9,"column":25},"action":"insert","lines":["n"]}],[{"start":{"row":9,"column":25},"end":{"row":9,"column":26},"action":"insert","lines":[" "],"id":25}],[{"start":{"row":9,"column":26},"end":{"row":10,"column":26},"action":"insert","lines":["greinacker/","pythonista-install-boto.py"],"id":26}],[{"start":{"row":9,"column":37},"end":{"row":10,"column":0},"action":"remove","lines":["",""],"id":27}],[{"start":{"row":9,"column":64},"end":{"row":9,"column":80},"action":"remove","lines":["Installer script"],"id":28}],[{"start":{"row":9,"column":65},"end":{"row":9,"column":66},"action":"remove","lines":[" "],"id":29}],[{"start":{"row":9,"column":65},"end":{"row":10,"column":0},"action":"insert","lines":["",""],"id":30},{"start":{"row":10,"column":0},"end":{"row":10,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":10,"column":1},"end":{"row":10,"column":2},"action":"insert","lines":[" "],"id":31}],[{"start":{"row":10,"column":2},"end":{"row":10,"column":37},"action":"remove","lines":["https://gist.github.com/omz/5048588"],"id":32},{"start":{"row":10,"column":2},"end":{"row":10,"column":57},"action":"insert","lines":["https://gist.github.com/greinacker/5a61309be34490a63aa6"]}],[{"start":{"row":23,"column":0},"end":{"row":24,"column":0},"action":"insert","lines":["",""],"id":33},{"start":{"row":24,"column":0},"end":{"row":25,"column":0},"action":"insert","lines":["",""]},{"start":{"row":25,"column":0},"end":{"row":26,"column":0},"action":"insert","lines":["",""]}],[{"start":{"row":25,"column":0},"end":{"row":27,"column":13},"action":"insert","lines":["nose==1.3.3","mock==1.3.0","wheel==0.24.0"],"id":34}],[{"start":{"row":14,"column":12},"end":{"row":15,"column":0},"action":"insert","lines":["",""],"id":35},{"start":{"row":15,"column":0},"end":{"row":15,"column":4},"action":"insert","lines":["    "]}],[{"start":{"row":17,"column":0},"end":{"row":23,"column":0},"action":"remove","lines":["    'https://pypi.python.org/packages/source/r/rsa/rsa-3.1.1.tar.gz',","    'https://pypi.python.org/packages/source/t/tox/tox-1.4.zip',","    'https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.1.3.tar.gz',","    'https://pypi.python.org/packages/source/s/simplejson/simplejson-2.5.2.tar.gz',","    'http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz',","    'https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gz'",""],"id":36}],[{"start":{"row":15,"column":51},"end":{"row":15,"column":52},"action":"insert","lines":["3"],"id":37}],[{"start":{"row":15,"column":53},"end":{"row":15,"column":70},"action":"remove","lines":["boto-2.8.0.tar.gz"],"id":38},{"start":{"row":15,"column":53},"end":{"row":15,"column":73},"action":"insert","lines":["boto3-1.14.47.tar.gz"]}],[{"start":{"row":16,"column":52},"end":{"row":16,"column":69},"action":"remove","lines":["mock-1.0.1.tar.gz"],"id":39},{"start":{"row":16,"column":52},"end":{"row":16,"column":70},"action":"insert","lines":["mock-4.0.2.tar.gz "]}],[{"start":{"row":16,"column":69},"end":{"row":16,"column":70},"action":"remove","lines":[" "],"id":40}],[{"start":{"row":117,"column":0},"end":{"row":118,"column":0},"action":"insert","lines":["",""],"id":41},{"start":{"row":118,"column":0},"end":{"row":119,"column":0},"action":"insert","lines":["",""]},{"start":{"row":119,"column":0},"end":{"row":120,"column":0},"action":"insert","lines":["",""]},{"start":{"row":120,"column":0},"end":{"row":121,"column":0},"action":"insert","lines":["",""]},{"start":{"row":121,"column":0},"end":{"row":122,"column":0},"action":"insert","lines":["",""]}],[{"start":{"row":122,"column":0},"end":{"row":122,"column":31},"action":"insert","lines":["pip install -r requirements.txt"],"id":42}],[{"start":{"row":122,"column":0},"end":{"row":122,"column":31},"action":"remove","lines":["pip install -r requirements.txt"],"id":43}],[{"start":{"row":122,"column":0},"end":{"row":166,"column":39},"action":"insert","lines":["(venv) admin:~/boto3/boto3 (develop) $ pip install -r requirements.txt","Obtaining botocore from git+git://github.com/boto/botocore.git@develop#egg=botocore (from -r requirements.txt (line 1))","  Cloning git://github.com/boto/botocore.git (to revision develop) to ./venv/src/botocore","Obtaining jmespath from git+git://github.com/boto/jmespath.git@develop#egg=jmespath (from -r requirements.txt (line 2))","  Cloning git://github.com/boto/jmespath.git (to revision develop) to ./venv/src/jmespath","Obtaining s3transfer from git+git://github.com/boto/s3transfer.git@develop#egg=s3transfer (from -r requirements.txt (line 3))","  Cloning git://github.com/boto/s3transfer.git (to revision develop) to ./venv/src/s3transfer","Collecting nose==1.3.3","  Downloading nose-1.3.3.tar.gz (274 kB)","     |████████████████████████████████| 274 kB 648 kB/s ","Collecting mock==1.3.0","  Downloading mock-1.3.0-py2.py3-none-any.whl (56 kB)","     |████████████████████████████████| 56 kB 2.5 MB/s ","Collecting wheel==0.24.0","  Downloading wheel-0.24.0-py2.py3-none-any.whl (63 kB)","     |████████████████████████████████| 63 kB 1.7 MB/s ","Collecting docutils<0.16,>=0.10","  Downloading docutils-0.15.2-py3-none-any.whl (547 kB)","     |████████████████████████████████| 547 kB 2.0 MB/s ","Collecting python-dateutil<3.0.0,>=2.1","  Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)","     |████████████████████████████████| 227 kB 3.2 MB/s ","Collecting urllib3<1.26,>=1.20","  Downloading urllib3-1.25.10-py2.py3-none-any.whl (127 kB)","     |████████████████████████████████| 127 kB 3.3 MB/s ","Collecting six>=1.7","  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)","Collecting pbr>=0.11","  Downloading pbr-5.4.5-py2.py3-none-any.whl (110 kB)","     |████████████████████████████████| 110 kB 3.6 MB/s ","Building wheels for collected packages: nose","  Building wheel for nose (setup.py) ... done","  Created wheel for nose: filename=nose-1.3.3-py3-none-any.whl size=153083 sha256=92beb5bd88fbc4021a3b0ba80612ddc209782e1344791c771a7392a54ff8701f","  Stored in directory: /home/ec2-user/.cache/pip/wheels/0f/1e/f7/27e4abff8fcdfdf42c96b88fabbb03359acc9ec78b2d743812","Successfully built nose","Installing collected packages: jmespath, docutils, six, python-dateutil, urllib3, botocore, s3transfer, nose, pbr, mock, wheel","  Running setup.py develop for jmespath","  Running setup.py develop for botocore","  Running setup.py develop for s3transfer","  Attempting uninstall: wheel","    Found existing installation: wheel 0.35.1","    Uninstalling wheel-0.35.1:","      Successfully uninstalled wheel-0.35.1","Successfully installed botocore docutils-0.15.2 jmespath mock-1.3.0 nose-1.3.3 pbr-5.4.5 python-dateutil-2.8.1 s3transfer six-1.15.0 urllib3-1.25.10 wheel-0.24.0","(venv) admin:~/boto3/boto3 (develop) $ "],"id":44}],[{"start":{"row":120,"column":0},"end":{"row":166,"column":39},"action":"remove","lines":["","","(venv) admin:~/boto3/boto3 (develop) $ pip install -r requirements.txt","Obtaining botocore from git+git://github.com/boto/botocore.git@develop#egg=botocore (from -r requirements.txt (line 1))","  Cloning git://github.com/boto/botocore.git (to revision develop) to ./venv/src/botocore","Obtaining jmespath from git+git://github.com/boto/jmespath.git@develop#egg=jmespath (from -r requirements.txt (line 2))","  Cloning git://github.com/boto/jmespath.git (to revision develop) to ./venv/src/jmespath","Obtaining s3transfer from git+git://github.com/boto/s3transfer.git@develop#egg=s3transfer (from -r requirements.txt (line 3))","  Cloning git://github.com/boto/s3transfer.git (to revision develop) to ./venv/src/s3transfer","Collecting nose==1.3.3","  Downloading nose-1.3.3.tar.gz (274 kB)","     |████████████████████████████████| 274 kB 648 kB/s ","Collecting mock==1.3.0","  Downloading mock-1.3.0-py2.py3-none-any.whl (56 kB)","     |████████████████████████████████| 56 kB 2.5 MB/s ","Collecting wheel==0.24.0","  Downloading wheel-0.24.0-py2.py3-none-any.whl (63 kB)","     |████████████████████████████████| 63 kB 1.7 MB/s ","Collecting docutils<0.16,>=0.10","  Downloading docutils-0.15.2-py3-none-any.whl (547 kB)","     |████████████████████████████████| 547 kB 2.0 MB/s ","Collecting python-dateutil<3.0.0,>=2.1","  Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)","     |████████████████████████████████| 227 kB 3.2 MB/s ","Collecting urllib3<1.26,>=1.20","  Downloading urllib3-1.25.10-py2.py3-none-any.whl (127 kB)","     |████████████████████████████████| 127 kB 3.3 MB/s ","Collecting six>=1.7","  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)","Collecting pbr>=0.11","  Downloading pbr-5.4.5-py2.py3-none-any.whl (110 kB)","     |████████████████████████████████| 110 kB 3.6 MB/s ","Building wheels for collected packages: nose","  Building wheel for nose (setup.py) ... done","  Created wheel for nose: filename=nose-1.3.3-py3-none-any.whl size=153083 sha256=92beb5bd88fbc4021a3b0ba80612ddc209782e1344791c771a7392a54ff8701f","  Stored in directory: /home/ec2-user/.cache/pip/wheels/0f/1e/f7/27e4abff8fcdfdf42c96b88fabbb03359acc9ec78b2d743812","Successfully built nose","Installing collected packages: jmespath, docutils, six, python-dateutil, urllib3, botocore, s3transfer, nose, pbr, mock, wheel","  Running setup.py develop for jmespath","  Running setup.py develop for botocore","  Running setup.py develop for s3transfer","  Attempting uninstall: wheel","    Found existing installation: wheel 0.35.1","    Uninstalling wheel-0.35.1:","      Successfully uninstalled wheel-0.35.1","Successfully installed botocore docutils-0.15.2 jmespath mock-1.3.0 nose-1.3.3 pbr-5.4.5 python-dateutil-2.8.1 s3transfer six-1.15.0 urllib3-1.25.10 wheel-0.24.0","(venv) admin:~/boto3/boto3 (develop) $ "],"id":45}],[{"start":{"row":0,"column":2},"end":{"row":11,"column":1},"action":"remove","lines":["This script installs Boto in Pythonista. Run this script in your root folder","# and it will download and install Boto along with its dependencies. To use","# Boto, be sure to add boto-module in your sys.path before importing boto like","# so:","#","#   import sys; sys.path.append('boto-module')","#   import boto.ec2","#","# Credits:","# This script is based on greinacker/pythonista-install-boto.py :","# https://gist.github.com/greinacker/5a61309be34490a63aa6","#"],"id":46}],[{"start":{"row":0,"column":2},"end":{"row":0,"column":44},"action":"insert","lines":["StaSh - Shell Like an Expert in Pythonista"],"id":47}],[{"start":{"row":0,"column":44},"end":{"row":1,"column":0},"action":"insert","lines":["",""],"id":48},{"start":{"row":1,"column":0},"end":{"row":1,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":1,"column":1},"end":{"row":2,"column":0},"action":"insert","lines":["",""],"id":49},{"start":{"row":2,"column":0},"end":{"row":2,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":2,"column":1},"end":{"row":2,"column":2},"action":"insert","lines":[" "],"id":50},{"start":{"row":2,"column":2},"end":{"row":2,"column":3},"action":"insert","lines":["s"]},{"start":{"row":2,"column":3},"end":{"row":2,"column":4},"action":"insert","lines":["o"]},{"start":{"row":2,"column":4},"end":{"row":2,"column":5},"action":"insert","lines":["u"]},{"start":{"row":2,"column":5},"end":{"row":2,"column":6},"action":"insert","lines":["r"]},{"start":{"row":2,"column":6},"end":{"row":2,"column":7},"action":"insert","lines":["c"]},{"start":{"row":2,"column":7},"end":{"row":2,"column":8},"action":"insert","lines":["e"]}],[{"start":{"row":2,"column":8},"end":{"row":2,"column":9},"action":"insert","lines":[":"],"id":51}],[{"start":{"row":2,"column":9},"end":{"row":2,"column":10},"action":"insert","lines":[" "],"id":52}],[{"start":{"row":2,"column":10},"end":{"row":2,"column":41},"action":"insert","lines":["https://github.com/ywangd/stash"],"id":53}],[{"start":{"row":2,"column":41},"end":{"row":3,"column":0},"action":"insert","lines":["",""],"id":54},{"start":{"row":3,"column":0},"end":{"row":3,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":3,"column":1},"end":{"row":3,"column":2},"action":"insert","lines":[" "],"id":55}],[{"start":{"row":3,"column":1},"end":{"row":3,"column":2},"action":"remove","lines":[" "],"id":56}],[{"start":{"row":3,"column":1},"end":{"row":4,"column":0},"action":"insert","lines":["",""],"id":57},{"start":{"row":4,"column":0},"end":{"row":4,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":4,"column":1},"end":{"row":4,"column":2},"action":"insert","lines":[" "],"id":58},{"start":{"row":4,"column":2},"end":{"row":4,"column":3},"action":"insert","lines":["r"]},{"start":{"row":4,"column":3},"end":{"row":4,"column":4},"action":"insert","lines":["e"]},{"start":{"row":4,"column":4},"end":{"row":4,"column":5},"action":"insert","lines":["q"]},{"start":{"row":4,"column":5},"end":{"row":4,"column":6},"action":"insert","lines":["u"]},{"start":{"row":4,"column":6},"end":{"row":4,"column":7},"action":"insert","lines":["i"]},{"start":{"row":4,"column":7},"end":{"row":4,"column":8},"action":"insert","lines":["r"]},{"start":{"row":4,"column":8},"end":{"row":4,"column":9},"action":"insert","lines":["e"]},{"start":{"row":4,"column":9},"end":{"row":4,"column":10},"action":"insert","lines":["d"]}],[{"start":{"row":4,"column":10},"end":{"row":4,"column":11},"action":"insert","lines":[" "],"id":59},{"start":{"row":4,"column":11},"end":{"row":4,"column":12},"action":"insert","lines":["t"]},{"start":{"row":4,"column":12},"end":{"row":4,"column":13},"action":"insert","lines":["o"]}],[{"start":{"row":4,"column":13},"end":{"row":4,"column":14},"action":"insert","lines":[" "],"id":60},{"start":{"row":4,"column":14},"end":{"row":4,"column":15},"action":"insert","lines":["i"]},{"start":{"row":4,"column":15},"end":{"row":4,"column":16},"action":"insert","lines":["n"]},{"start":{"row":4,"column":16},"end":{"row":4,"column":17},"action":"insert","lines":["s"]},{"start":{"row":4,"column":17},"end":{"row":4,"column":18},"action":"insert","lines":["t"]},{"start":{"row":4,"column":18},"end":{"row":4,"column":19},"action":"insert","lines":["a"]},{"start":{"row":4,"column":19},"end":{"row":4,"column":20},"action":"insert","lines":["l"]},{"start":{"row":4,"column":20},"end":{"row":4,"column":21},"action":"insert","lines":["l"]}],[{"start":{"row":4,"column":21},"end":{"row":4,"column":22},"action":"insert","lines":[" "],"id":61},{"start":{"row":4,"column":22},"end":{"row":4,"column":23},"action":"insert","lines":["b"]},{"start":{"row":4,"column":23},"end":{"row":4,"column":24},"action":"insert","lines":["o"]},{"start":{"row":4,"column":24},"end":{"row":4,"column":25},"action":"insert","lines":["t"]},{"start":{"row":4,"column":25},"end":{"row":4,"column":26},"action":"insert","lines":["o"]}],[{"start":{"row":4,"column":26},"end":{"row":4,"column":27},"action":"insert","lines":["3"],"id":62}],[{"start":{"row":4,"column":22},"end":{"row":4,"column":23},"action":"insert","lines":["t"],"id":63},{"start":{"row":4,"column":23},"end":{"row":4,"column":24},"action":"insert","lines":["h"]},{"start":{"row":4,"column":24},"end":{"row":4,"column":25},"action":"insert","lines":["e"]}],[{"start":{"row":4,"column":25},"end":{"row":4,"column":26},"action":"insert","lines":[" "],"id":64}],[{"start":{"row":4,"column":31},"end":{"row":4,"column":32},"action":"insert","lines":[" "],"id":65},{"start":{"row":4,"column":32},"end":{"row":4,"column":33},"action":"insert","lines":["l"]},{"start":{"row":4,"column":33},"end":{"row":4,"column":34},"action":"insert","lines":["i"]},{"start":{"row":4,"column":34},"end":{"row":4,"column":35},"action":"insert","lines":["b"]},{"start":{"row":4,"column":35},"end":{"row":4,"column":36},"action":"insert","lines":["r"]},{"start":{"row":4,"column":36},"end":{"row":4,"column":37},"action":"insert","lines":["a"]},{"start":{"row":4,"column":37},"end":{"row":4,"column":38},"action":"insert","lines":["r"]},{"start":{"row":4,"column":38},"end":{"row":4,"column":39},"action":"insert","lines":["y"]}],[{"start":{"row":4,"column":39},"end":{"row":5,"column":0},"action":"insert","lines":["",""],"id":66}],[{"start":{"row":5,"column":0},"end":{"row":6,"column":0},"action":"remove","lines":["",""],"id":67}],[{"start":{"row":6,"column":0},"end":{"row":113,"column":0},"action":"remove","lines":["","packages = [","    'https://pypi.python.org/packages/source/b/boto3/boto3-1.14.47.tar.gz',","    'https://pypi.python.org/packages/source/m/mock/mock-4.0.2.tar.gz',","]","","","nose==1.3.3","mock==1.3.0","wheel==0.24.0","","configparser_src = 'http://hg.python.org/cpython/raw-file/70274d53c1dd/Lib/ConfigParser.py'","","import shutil","import urllib","from urlparse import urlparse","import tarfile","import zipfile","import os","","","def create_module_dir():","    try:","        os.mkdir('boto-module')","    except:","        pass","","","def get_filename_from_url(url):","    parsed_url = urlparse(url)","    return parsed_url.path.rpartition('/')[-1]","","def is_zipfile(f):","    return f.endswith('.zip')","","def is_targzfile(f):","    return f.endswith('.tar.gz')","","def download_packages():","    for f in packages:","        print('Downloading %s' % f)","        filepath, headers = urllib.urlretrieve(f)","        print('Extracting %s' % filepath)","        filename = get_filename_from_url(f)","        if is_targzfile(filename):","            t = tarfile.open(filepath, 'r')","            t.extractall()","            t.close()","        elif is_zipfile(filename):","            z = zipfile.ZipFile(filepath, 'r')","            z.extractall()","            z.close()","","def install_configparser_src():","    print('Installing ConfigParser...')","    filepath, headers = urllib.urlretrieve(configparser_src)","    shutil.move(filepath, 'boto-module/ConfigParser.py')","","def install_packages():","    print('Installing boto...')","    shutil.move('boto-2.8.0/boto', 'boto-module/boto')","    shutil.rmtree('boto-2.8.0')","","    print('Installing mock...')","    shutil.move('mock-1.0.1/mock.py', 'boto-module/mock.py')","    shutil.rmtree('mock-1.0.1')","","    print('Installing rsa...')","    shutil.move('rsa-3.1.1/rsa', 'boto-module/rsa')","    shutil.rmtree('rsa-3.1.1')","","    print('Installing tox...')","    shutil.move('tox-1.4/tox', 'boto-module/tox')","    shutil.rmtree('tox-1.4')","","    print('Installing Sphinx...')","    shutil.move('Sphinx-1.1.3/sphinx', 'boto-module/sphinx')","    shutil.rmtree('Sphinx-1.1.3')","","    print('Installing simplejson...')","    shutil.move('simplejson-2.5.2/simplejson', 'boto-module/simplejson')","    shutil.rmtree('simplejson-2.5.2')","","    print('Installing argparse...')","    shutil.move('argparse-1.2.1/argparse.py', 'boto-module/argparse.py')","    shutil.rmtree('argparse-1.2.1')","","    print('Installing unittest2...')","    shutil.move('unittest2-0.5.1/unittest2', 'boto-module/unittest2')","    shutil.rmtree('unittest2-0.5.1')","","def reload_pythonista_editor():","    print('Reloading Pythonista editor')","    import editor","    editor.reload_files()","","","if __name__ == '__main__':","    create_module_dir()","    download_packages()","    install_packages()","    install_configparser_src()","    reload_pythonista_editor()","    print('All done!')","","","",""],"id":68}],[{"start":{"row":6,"column":0},"end":{"row":6,"column":69},"action":"insert","lines":["import requests as r; exec(r.get('https://bit.ly/get-stash').content)"],"id":69}],[{"start":{"row":6,"column":69},"end":{"row":7,"column":0},"action":"insert","lines":["",""],"id":70}]]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":7,"column":0},"end":{"row":7,"column":0},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1598330159797,"hash":"3c9864acfcd25b79e78cfb7e67cbb54fb5ca8f20"}
de9045aefd47947ab8f8cc3de9c604652095e935
<mask token>

{'filter': false, 'title': 'install_stash.py', 'tooltip':
    '/Pythonista/install_stash.py', 'undoManager': {'mark': 69, 'position':
    69, 'stack': [[{'start': {'row': 0, 'column': 0}, 'end': {'row': 156,
    'column': 0}, 'action': 'insert', 'lines': ['', 'Skip to content',
    'All gists', 'Back to GitHub', 'Sign in', 'Sign up', '',
    'Instantly share code, notes, and snippets.', '@greinacker',
    'greinacker/', 'pythonista-install-boto.py',
    'forked from najibninaba/pythonista-install-boto.py',
    'Created 5 years ago', '', '4', '', '    0', '', 'Code', 'Revisions 4',
    'Stars 4', 'Pythonista script for installing boto',
    'pythonista-install-boto.py',
    '# Source: https://gist.github.com/najibninaba/5062153', '# ',
    '# This script installs Boto in Pythonista. Run this script in your root folder and it will download and install Boto along with its'
    ,
    '# dependencies. To use Boto, be sure to add boto-module in your sys.path before importing boto like so:'
    , "# import sys; sys.path.append('boto-module')", '# import boto.ec2',
    '#', '# Credits:',
    "# This script is inspired by omz's Evernote Installer script: https://gist.github.com/omz/5048588"
    , '#', '', '',
    "packages = ['https://pypi.python.org/packages/source/b/boto/boto-2.8.0.tar.gz',"
    ,
    "    'https://pypi.python.org/packages/source/m/mock/mock-1.0.1.tar.gz',",
    "    'https://pypi.python.org/packages/source/r/rsa/rsa-3.1.1.tar.gz',",
    "    'https://pypi.python.org/packages/source/t/tox/tox-1.4.zip',",
    "    'https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.1.3.tar.gz',"
    ,
    "    'https://pypi.python.org/packages/source/s/simplejson/simplejson-2.5.2.tar.gz',"
    , "    'http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz',",
    "    'https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gz'"
    , ']', '',
    "configparser_src = 'http://hg.python.org/cpython/raw-file/70274d53c1dd/Lib/ConfigParser.py'"
    , '', 'import shutil', 'import urllib', 'from urlparse import urlparse',
    'import tarfile', 'import zipfile', 'import os', '', '',
    'def create_module_dir():', '    try:',
    "        os.mkdir('boto-module')", '    except:', '        pass', '',
    '', 'def get_filename_from_url(url):', '    parsed_url = urlparse(url)',
    "    return parsed_url.path.rpartition('/')[-1]", '',
    'def is_zipfile(f):', "    return f.endswith('.zip')", '',
    'def is_targzfile(f):', "    return f.endswith('.tar.gz')", '',
    'def download_packages():', '    for f in packages:',
    "        print('Downloading %s' % f)",
    '        filepath, headers = urllib.urlretrieve(f)',
    "        print('Extracting %s' % filepath)",
    '        filename = get_filename_from_url(f)',
    '        if is_targzfile(filename):',
    "            t = tarfile.open(filepath, 'r')",
    '            t.extractall()', '            t.close()',
    '        elif is_zipfile(filename):',
    "            z = zipfile.ZipFile(filepath, 'r')",
    '            z.extractall()', '            z.close()', '',
    'def install_configparser_src():',
    "    print('Installing ConfigParser...')",
    '    filepath, headers = urllib.urlretrieve(configparser_src)',
    "    shutil.move(filepath, 'boto-module/ConfigParser.py')", '',
    'def install_packages():', "    print('Installing boto...')",
    "    shutil.move('boto-2.8.0/boto', 'boto-module/boto')",
    "    shutil.rmtree('boto-2.8.0')", '',
    "    print('Installing mock...')",
    "    shutil.move('mock-1.0.1/mock.py', 'boto-module/mock.py')",
    "    shutil.rmtree('mock-1.0.1')", '', "    print('Installing rsa...')",
    "    shutil.move('rsa-3.1.1/rsa', 'boto-module/rsa')",
    "    shutil.rmtree('rsa-3.1.1')", '', "    print('Installing tox...')",
    "    shutil.move('tox-1.4/tox', 'boto-module/tox')",
    "    shutil.rmtree('tox-1.4')", '', "    print('Installing Sphinx...')",
    "    shutil.move('Sphinx-1.1.3/sphinx', 'boto-module/sphinx')",
    "    shutil.rmtree('Sphinx-1.1.3')", '',
    "    print('Installing simplejson...')",
    "    shutil.move('simplejson-2.5.2/simplejson', 'boto-module/simplejson')",
    "    shutil.rmtree('simplejson-2.5.2')", '',
    "    print('Installing argparse...')",
    "    shutil.move('argparse-1.2.1/argparse.py', 'boto-module/argparse.py')",
    "    shutil.rmtree('argparse-1.2.1')", '',
    "    print('Installing unittest2...')",
    "    shutil.move('unittest2-0.5.1/unittest2', 'boto-module/unittest2')",
    "    shutil.rmtree('unittest2-0.5.1')", '',
    'def reload_pythonista_editor():',
    "    print('Reloading Pythonista editor')", '    import editor',
    '    editor.reload_files()', '', '', "if __name__ == '__main__':",
    '    create_module_dir()', '    download_packages()',
    '    install_packages()', '    install_configparser_src()',
    '    reload_pythonista_editor()', "    print('All done!')", '    ', '',
    'to join this conversation on GitHub. Already have an account? Sign in to comment'
    , '', '    © 2020 GitHub, Inc.', '    Terms', '    Privacy',
    '    Security', '    Status', '    Help', '', '    Contact GitHub',
    '    Pricing', '    API', '    Training', '    Blog', '    About', '',
    ''], 'id': 1}], [{'start': {'row': 0, 'column': 0}, 'end': {'row': 156,
    'column': 0}, 'action': 'remove', 'lines': ['', 'Skip to content',
    'All gists', 'Back to GitHub', 'Sign in', 'Sign up', '',
    'Instantly share code, notes, and snippets.', '@greinacker',
    'greinacker/', 'pythonista-install-boto.py',
    'forked from najibninaba/pythonista-install-boto.py',
    'Created 5 years ago', '', '4', '', '    0', '', 'Code', 'Revisions 4',
    'Stars 4', 'Pythonista script for installing boto',
    'pythonista-install-boto.py',
    '# Source: https://gist.github.com/najibninaba/5062153', '# ',
    '# This script installs Boto in Pythonista. Run this script in your root folder and it will download and install Boto along with its'
    ,
    '# dependencies. To use Boto, be sure to add boto-module in your sys.path before importing boto like so:'
    , "# import sys; sys.path.append('boto-module')", '# import boto.ec2',
    '#', '# Credits:',
    "# This script is inspired by omz's Evernote Installer script: https://gist.github.com/omz/5048588"
    , '#', '', '',
    "packages = ['https://pypi.python.org/packages/source/b/boto/boto-2.8.0.tar.gz',"
    ,
    "    'https://pypi.python.org/packages/source/m/mock/mock-1.0.1.tar.gz',",
    "    'https://pypi.python.org/packages/source/r/rsa/rsa-3.1.1.tar.gz',",
    "    'https://pypi.python.org/packages/source/t/tox/tox-1.4.zip',",
    "    'https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.1.3.tar.gz',"
    ,
    "    'https://pypi.python.org/packages/source/s/simplejson/simplejson-2.5.2.tar.gz',"
    , "    'http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz',",
    "    'https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gz'"
    , ']', '',
    "configparser_src = 'http://hg.python.org/cpython/raw-file/70274d53c1dd/Lib/ConfigParser.py'"
    , '', 'import shutil', 'import urllib', 'from urlparse import urlparse',
    'import tarfile', 'import zipfile', 'import os', '', '',
    'def create_module_dir():', '    try:',
    "        os.mkdir('boto-module')", '    except:', '        pass', '',
    '', 'def get_filename_from_url(url):', '    parsed_url = urlparse(url)',
    "    return parsed_url.path.rpartition('/')[-1]", '',
    'def is_zipfile(f):', "    return f.endswith('.zip')", '',
    'def is_targzfile(f):', "    return f.endswith('.tar.gz')", '',
    'def download_packages():', '    for f in packages:',
    "        print('Downloading %s' % f)",
    '        filepath, headers = urllib.urlretrieve(f)',
    "        print('Extracting %s' % filepath)",
    '        filename = get_filename_from_url(f)',
    '        if is_targzfile(filename):',
    "            t = tarfile.open(filepath, 'r')",
    '            t.extractall()', '            t.close()',
    '        elif is_zipfile(filename):',
    "            z = zipfile.ZipFile(filepath, 'r')",
    '            z.extractall()', '            z.close()', '',
    'def install_configparser_src():',
    "    print('Installing ConfigParser...')",
    '    filepath, headers = urllib.urlretrieve(configparser_src)',
    "    shutil.move(filepath, 'boto-module/ConfigParser.py')", '',
    'def install_packages():', "    print('Installing boto...')",
    "    shutil.move('boto-2.8.0/boto', 'boto-module/boto')",
    "    shutil.rmtree('boto-2.8.0')", '',
    "    print('Installing mock...')",
    "    shutil.move('mock-1.0.1/mock.py', 'boto-module/mock.py')",
    "    shutil.rmtree('mock-1.0.1')", '', "    print('Installing rsa...')",
    "    shutil.move('rsa-3.1.1/rsa', 'boto-module/rsa')",
    "    shutil.rmtree('rsa-3.1.1')", '', "    print('Installing tox...')",
    "    shutil.move('tox-1.4/tox', 'boto-module/tox')",
    "    shutil.rmtree('tox-1.4')", '', "    print('Installing Sphinx...')",
    "    shutil.move('Sphinx-1.1.3/sphinx', 'boto-module/sphinx')",
    "    shutil.rmtree('Sphinx-1.1.3')", '',
    "    print('Installing simplejson...')",
    "    shutil.move('simplejson-2.5.2/simplejson', 'boto-module/simplejson')",
    "    shutil.rmtree('simplejson-2.5.2')", '',
    "    print('Installing argparse...')",
    "    shutil.move('argparse-1.2.1/argparse.py', 'boto-module/argparse.py')",
    "    shutil.rmtree('argparse-1.2.1')", '',
    "    print('Installing unittest2...')",
    "    shutil.move('unittest2-0.5.1/unittest2', 'boto-module/unittest2')",
    "    shutil.rmtree('unittest2-0.5.1')", '',
    'def reload_pythonista_editor():',
    "    print('Reloading Pythonista editor')", '    import editor',
    '    editor.reload_files()', '', '', "if __name__ == '__main__':",
    '    create_module_dir()', '    download_packages()',
    '    install_packages()', '    install_configparser_src()',
    '    reload_pythonista_editor()', "    print('All done!')", '    ', '',
    'to join this conversation on GitHub. Already have an account? Sign in to comment'
    , '', '    © 2020 GitHub, Inc.', '    Terms', '    Privacy',
    '    Security', '    Status', '    Help', '', '    Contact GitHub',
    '    Pricing', '    API', '    Training', '    Blog', '    About', '',
    ''], 'id': 2}], [{'start': {'row': 0, 'column': 0}, 'end': {'row': 118,
    'column': 0}, 'action': 'insert', 'lines': [
    '# Source: https://gist.github.com/najibninaba/5062153', '# ',
    '# This script installs Boto in Pythonista. Run this script in your root folder and it will download and install Boto along with its'
    ,
    '# dependencies. To use Boto, be sure to add boto-module in your sys.path before importing boto like so:'
    , "# import sys; sys.path.append('boto-module')", '# import boto.ec2',
    '#', '# Credits:',
    "# This script is inspired by omz's Evernote Installer script: https://gist.github.com/omz/5048588"
    , '#', '', '',
    "packages = ['https://pypi.python.org/packages/source/b/boto/boto-2.8.0.tar.gz',"
    ,
    "    'https://pypi.python.org/packages/source/m/mock/mock-1.0.1.tar.gz',",
    "    'https://pypi.python.org/packages/source/r/rsa/rsa-3.1.1.tar.gz',",
    "    'https://pypi.python.org/packages/source/t/tox/tox-1.4.zip',",
    "    'https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.1.3.tar.gz',"
    ,
    "    'https://pypi.python.org/packages/source/s/simplejson/simplejson-2.5.2.tar.gz',"
    , "    'http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz',",
    "    'https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gz'"
    , ']', '',
    "configparser_src = 'http://hg.python.org/cpython/raw-file/70274d53c1dd/Lib/ConfigParser.py'"
    , '', 'import shutil', 'import urllib', 'from urlparse import urlparse',
    'import tarfile', 'import zipfile', 'import os', '', '',
    'def create_module_dir():', '    try:',
    "        os.mkdir('boto-module')", '    except:', '        pass', '',
    '', 'def get_filename_from_url(url):', '    parsed_url = urlparse(url)',
    "    return parsed_url.path.rpartition('/')[-1]", '',
    'def is_zipfile(f):', "    return f.endswith('.zip')", '',
    'def is_targzfile(f):', "    return f.endswith('.tar.gz')", '',
    'def download_packages():', '    for f in packages:',
    "        print('Downloading %s' % f)",
    '        filepath, headers = urllib.urlretrieve(f)',
    "        print('Extracting %s' % filepath)",
    '        filename = get_filename_from_url(f)',
    '        if is_targzfile(filename):',
    "            t = tarfile.open(filepath, 'r')",
    '            t.extractall()', '            t.close()',
    '        elif is_zipfile(filename):',
    "            z = zipfile.ZipFile(filepath, 'r')",
    '            z.extractall()', '            z.close()', '',
    'def install_configparser_src():',
    "    print('Installing ConfigParser...')",
    '    filepath, headers = urllib.urlretrieve(configparser_src)',
    "    shutil.move(filepath, 'boto-module/ConfigParser.py')", '',
    'def install_packages():', "    print('Installing boto...')",
    "    shutil.move('boto-2.8.0/boto', 'boto-module/boto')",
    "    shutil.rmtree('boto-2.8.0')", '',
    "    print('Installing mock...')",
    "    shutil.move('mock-1.0.1/mock.py', 'boto-module/mock.py')",
    "    shutil.rmtree('mock-1.0.1')", '', "    print('Installing rsa...')",
    "    shutil.move('rsa-3.1.1/rsa', 'boto-module/rsa')",
    "    shutil.rmtree('rsa-3.1.1')", '', "    print('Installing tox...')",
    "    shutil.move('tox-1.4/tox', 'boto-module/tox')",
    "    shutil.rmtree('tox-1.4')", '', "    print('Installing Sphinx...')",
    "    shutil.move('Sphinx-1.1.3/sphinx', 'boto-module/sphinx')",
    "    shutil.rmtree('Sphinx-1.1.3')", '',
    "    print('Installing simplejson...')",
    "    shutil.move('simplejson-2.5.2/simplejson', 'boto-module/simplejson')",
    "    shutil.rmtree('simplejson-2.5.2')", '',
    "    print('Installing argparse...')",
    "    shutil.move('argparse-1.2.1/argparse.py', 'boto-module/argparse.py')",
    "    shutil.rmtree('argparse-1.2.1')", '',
    "    print('Installing unittest2...')",
    "    shutil.move('unittest2-0.5.1/unittest2', 'boto-module/unittest2')",
    "    shutil.rmtree('unittest2-0.5.1')", '',
    'def reload_pythonista_editor():',
    "    print('Reloading Pythonista editor')", '    import editor',
    '    editor.reload_files()', '', '', "if __name__ == '__main__':",
    '    create_module_dir()', '    download_packages()',
    '    install_packages()', '    install_configparser_src()',
    '    reload_pythonista_editor()', "    print('All done!')", '    ', '',
    '', ''], 'id': 3}], [{'start': {'row': 117, 'column': 0}, 'end': {'row':
    118, 'column': 0}, 'action': 'remove', 'lines': ['', ''], 'id': 4}, {
    'start': {'row': 116, 'column': 0}, 'end': {'row': 117, 'column': 0},
    'action': 'remove', 'lines': ['', '']}, {'start': {'row': 115, 'column':
    4}, 'end': {'row': 116, 'column': 0}, 'action': 'remove', 'lines': ['',
    '']}, {'start': {'row': 115, 'column': 0}, 'end': {'row': 115, 'column':
    4}, 'action': 'remove', 'lines': ['    ']}], [{'start': {'row': 0,
    'column': 0}, 'end': {'row': 0, 'column': 53}, 'action': 'remove',
    'lines': ['# Source: https://gist.github.com/najibninaba/5062153'],
    'id': 5}], [{'start': {'row': 0, 'column': 0}, 'end': {'row': 1,
    'column': 0}, 'action': 'remove', 'lines': ['', ''], 'id': 6}], [{
    'start': {'row': 0, 'column': 0}, 'end': {'row': 0, 'column': 2},
    'action': 'remove', 'lines': ['# '], 'id': 7}, {'start': {'row': 0,
    'column': 0}, 'end': {'row': 1, 'column': 0}, 'action': 'remove',
    'lines': ['', '']}], [{'start': {'row': 0, 'column': 78}, 'end': {'row':
    0, 'column': 79}, 'action': 'remove', 'lines': [' '], 'id': 8}], [{
    'start': {'row': 0, 'column': 78}, 'end': {'row': 1, 'column': 0},
    'action': 'insert', 'lines': ['', ''], 'id': 9}], [{'start': {'row': 1,
    'column': 0}, 'end': {'row': 1, 'column': 1}, 'action': 'insert',
    'lines': ['#'], 'id': 10}], [{'start': {'row': 1, 'column': 1}, 'end':
    {'row': 1, 'column': 2}, 'action': 'insert', 'lines': [' '], 'id': 11}],
    [{'start': {'row': 1, 'column': 54}, 'end': {'row': 1, 'column': 55},
    'action': 'insert', 'lines': [' '], 'id': 12}], [{'start': {'row': 1,
    'column': 55}, 'end': {'row': 2, 'column': 2}, 'action': 'remove',
    'lines': ['', '# '], 'id': 13}], [{'start': {'row': 1, 'column': 75},
    'end': {'row': 1, 'column': 76}, 'action': 'remove', 'lines': [' '],
    'id': 14}], [{'start': {'row': 1, 'column': 75}, 'end': {'row': 2,
    'column': 0}, 'action': 'insert', 'lines': ['', ''], 'id': 15}, {
    'start': {'row': 2, 'column': 0}, 'end': {'row': 2, 'column': 1},
    'action': 'insert', 'lines': ['#']}], [{'start': {'row': 2, 'column': 1
    }, 'end': {'row': 2, 'column': 2}, 'action': 'insert', 'lines': [' '],
    'id': 16}], [{'start': {'row': 2, 'column': 78}, 'end': {'row': 2,
    'column': 79}, 'action': 'remove', 'lines': [' '], 'id': 17}], [{
    'start': {'row': 2, 'column': 78}, 'end': {'row': 3, 'column': 0},
    'action': 'insert', 'lines': ['', ''], 'id': 18}, {'start': {'row': 3,
    'column': 0}, 'end': {'row': 3, 'column': 1}, 'action': 'insert',
    'lines': ['#']}], [{'start': {'row': 3, 'column': 1}, 'end': {'row': 3,
    'column': 2}, 'action': 'insert', 'lines': [' '], 'id': 19}], [{'start':
    {'row': 3, 'column': 5}, 'end': {'row': 4, 'column': 0}, 'action':
    'insert', 'lines': ['', ''], 'id': 20}, {'start': {'row': 4, 'column': 
    0}, 'end': {'row': 4, 'column': 1}, 'action': 'insert', 'lines': ['#']}
    ], [{'start': {'row': 5, 'column': 2}, 'end': {'row': 5, 'column': 4},
    'action': 'insert', 'lines': ['  '], 'id': 21}], [{'start': {'row': 6,
    'column': 2}, 'end': {'row': 6, 'column': 4}, 'action': 'insert',
    'lines': ['  '], 'id': 22}], [{'start': {'row': 9, 'column': 17}, 'end':
    {'row': 9, 'column': 43}, 'action': 'remove', 'lines': [
    "inspired by omz's Evernote"], 'id': 23}, {'start': {'row': 9, 'column':
    17}, 'end': {'row': 9, 'column': 18}, 'action': 'insert', 'lines': ['b'
    ]}, {'start': {'row': 9, 'column': 18}, 'end': {'row': 9, 'column': 19},
    'action': 'insert', 'lines': ['a']}, {'start': {'row': 9, 'column': 19},
    'end': {'row': 9, 'column': 20}, 'action': 'insert', 'lines': ['s']}, {
    'start': {'row': 9, 'column': 20}, 'end': {'row': 9, 'column': 21},
    'action': 'insert', 'lines': ['e']}, {'start': {'row': 9, 'column': 21},
    'end': {'row': 9, 'column': 22}, 'action': 'insert', 'lines': ['d']}],
    [{'start': {'row': 9, 'column': 22}, 'end': {'row': 9, 'column': 23},
    'action': 'insert', 'lines': [' '], 'id': 24}, {'start': {'row': 9,
    'column': 23}, 'end': {'row': 9, 'column': 24}, 'action': 'insert',
    'lines': ['o']}, {'start': {'row': 9, 'column': 24}, 'end': {'row': 9,
    'column': 25}, 'action': 'insert', 'lines': ['n']}], [{'start': {'row':
    9, 'column': 25}, 'end': {'row': 9, 'column': 26}, 'action': 'insert',
    'lines': [' '], 'id': 25}], [{'start': {'row': 9, 'column': 26}, 'end':
    {'row': 10, 'column': 26}, 'action': 'insert', 'lines': ['greinacker/',
    'pythonista-install-boto.py'], 'id': 26}], [{'start': {'row': 9,
    'column': 37}, 'end': {'row': 10, 'column': 0}, 'action': 'remove',
    'lines': ['', ''], 'id': 27}], [{'start': {'row': 9, 'column': 64},
    'end': {'row': 9, 'column': 80}, 'action': 'remove', 'lines': [
    'Installer script'], 'id': 28}], [{'start': {'row': 9, 'column': 65},
    'end': {'row': 9, 'column': 66}, 'action': 'remove', 'lines': [' '],
    'id': 29}], [{'start': {'row': 9, 'column': 65}, 'end': {'row': 10,
    'column': 0}, 'action': 'insert', 'lines': ['', ''], 'id': 30}, {
    'start': {'row': 10, 'column': 0}, 'end': {'row': 10, 'column': 1},
    'action': 'insert', 'lines': ['#']}], [{'start': {'row': 10, 'column': 
    1}, 'end': {'row': 10, 'column': 2}, 'action': 'insert', 'lines': [' '],
    'id': 31}], [{'start': {'row': 10, 'column': 2}, 'end': {'row': 10,
    'column': 37}, 'action': 'remove', 'lines': [
    'https://gist.github.com/omz/5048588'], 'id': 32}, {'start': {'row': 10,
    'column': 2}, 'end': {'row': 10, 'column': 57}, 'action': 'insert',
    'lines': ['https://gist.github.com/greinacker/5a61309be34490a63aa6']}],
    [{'start': {'row': 23, 'column': 0}, 'end': {'row': 24, 'column': 0},
    'action': 'insert', 'lines': ['', ''], 'id': 33}, {'start': {'row': 24,
    'column': 0}, 'end': {'row': 25, 'column': 0}, 'action': 'insert',
    'lines': ['', '']}, {'start': {'row': 25, 'column': 0}, 'end': {'row': 
    26, 'column': 0}, 'action': 'insert', 'lines': ['', '']}], [{'start': {
    'row': 25, 'column': 0}, 'end': {'row': 27, 'column': 13}, 'action':
    'insert', 'lines': ['nose==1.3.3', 'mock==1.3.0', 'wheel==0.24.0'],
    'id': 34}], [{'start': {'row': 14, 'column': 12}, 'end': {'row': 15,
    'column': 0}, 'action': 'insert', 'lines': ['', ''], 'id': 35}, {
    'start': {'row': 15, 'column': 0}, 'end': {'row': 15, 'column': 4},
    'action': 'insert', 'lines': ['    ']}], [{'start': {'row': 17,
    'column': 0}, 'end': {'row': 23, 'column': 0}, 'action': 'remove',
    'lines': [
    "    'https://pypi.python.org/packages/source/r/rsa/rsa-3.1.1.tar.gz',",
    "    'https://pypi.python.org/packages/source/t/tox/tox-1.4.zip',",
    "    'https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.1.3.tar.gz',"
    ,
    "    'https://pypi.python.org/packages/source/s/simplejson/simplejson-2.5.2.tar.gz',"
    , "    'http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz',",
    "    'https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gz'"
    , ''], 'id': 36}], [{'start': {'row': 15, 'column': 51}, 'end': {'row':
    15, 'column': 52}, 'action': 'insert', 'lines': ['3'], 'id': 37}], [{
    'start': {'row': 15, 'column': 53}, 'end': {'row': 15, 'column': 70},
    'action': 'remove', 'lines': ['boto-2.8.0.tar.gz'], 'id': 38}, {'start':
    {'row': 15, 'column': 53}, 'end': {'row': 15, 'column': 73}, 'action':
    'insert', 'lines': ['boto3-1.14.47.tar.gz']}], [{'start': {'row': 16,
    'column': 52}, 'end': {'row': 16, 'column': 69}, 'action': 'remove',
    'lines': ['mock-1.0.1.tar.gz'], 'id': 39}, {'start': {'row': 16,
    'column': 52}, 'end': {'row': 16, 'column': 70}, 'action': 'insert',
    'lines': ['mock-4.0.2.tar.gz ']}], [{'start': {'row': 16, 'column': 69},
    'end': {'row': 16, 'column': 70}, 'action': 'remove', 'lines': [' '],
    'id': 40}], [{'start': {'row': 117, 'column': 0}, 'end': {'row': 118,
    'column': 0}, 'action': 'insert', 'lines': ['', ''], 'id': 41}, {
    'start': {'row': 118, 'column': 0}, 'end': {'row': 119, 'column': 0},
    'action': 'insert', 'lines': ['', '']}, {'start': {'row': 119, 'column':
    0}, 'end': {'row': 120, 'column': 0}, 'action': 'insert', 'lines': ['',
    '']}, {'start': {'row': 120, 'column': 0}, 'end': {'row': 121, 'column':
    0}, 'action': 'insert', 'lines': ['', '']}, {'start': {'row': 121,
    'column': 0}, 'end': {'row': 122, 'column': 0}, 'action': 'insert',
    'lines': ['', '']}], [{'start': {'row': 122, 'column': 0}, 'end': {
    'row': 122, 'column': 31}, 'action': 'insert', 'lines': [
    'pip install -r requirements.txt'], 'id': 42}], [{'start': {'row': 122,
    'column': 0}, 'end': {'row': 122, 'column': 31}, 'action': 'remove',
    'lines': ['pip install -r requirements.txt'], 'id': 43}], [{'start': {
    'row': 122, 'column': 0}, 'end': {'row': 166, 'column': 39}, 'action':
    'insert', 'lines': [
    '(venv) admin:~/boto3/boto3 (develop) $ pip install -r requirements.txt',
    'Obtaining botocore from git+git://github.com/boto/botocore.git@develop#egg=botocore (from -r requirements.txt (line 1))'
    ,
    '  Cloning git://github.com/boto/botocore.git (to revision develop) to ./venv/src/botocore'
    ,
    'Obtaining jmespath from git+git://github.com/boto/jmespath.git@develop#egg=jmespath (from -r requirements.txt (line 2))'
    ,
    '  Cloning git://github.com/boto/jmespath.git (to revision develop) to ./venv/src/jmespath'
    ,
    'Obtaining s3transfer from git+git://github.com/boto/s3transfer.git@develop#egg=s3transfer (from -r requirements.txt (line 3))'
    ,
    '  Cloning git://github.com/boto/s3transfer.git (to revision develop) to ./venv/src/s3transfer'
    , 'Collecting nose==1.3.3', '  Downloading nose-1.3.3.tar.gz (274 kB)',
    '     |████████████████████████████████| 274 kB 648 kB/s ',
    'Collecting mock==1.3.0',
    '  Downloading mock-1.3.0-py2.py3-none-any.whl (56 kB)',
    '     |████████████████████████████████| 56 kB 2.5 MB/s ',
    'Collecting wheel==0.24.0',
    '  Downloading wheel-0.24.0-py2.py3-none-any.whl (63 kB)',
    '     |████████████████████████████████| 63 kB 1.7 MB/s ',
    'Collecting docutils<0.16,>=0.10',
    '  Downloading docutils-0.15.2-py3-none-any.whl (547 kB)',
    '     |████████████████████████████████| 547 kB 2.0 MB/s ',
    'Collecting python-dateutil<3.0.0,>=2.1',
    '  Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)',
    '     |████████████████████████████████| 227 kB 3.2 MB/s ',
    'Collecting urllib3<1.26,>=1.20',
    '  Downloading urllib3-1.25.10-py2.py3-none-any.whl (127 kB)',
    '     |████████████████████████████████| 127 kB 3.3 MB/s ',
    'Collecting six>=1.7',
    '  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)',
    'Collecting pbr>=0.11',
    '  Downloading pbr-5.4.5-py2.py3-none-any.whl (110 kB)',
    '     |████████████████████████████████| 110 kB 3.6 MB/s ',
    'Building wheels for collected packages: nose',
    '  Building wheel for nose (setup.py) ... done',
    '  Created wheel for nose: filename=nose-1.3.3-py3-none-any.whl size=153083 sha256=92beb5bd88fbc4021a3b0ba80612ddc209782e1344791c771a7392a54ff8701f'
    ,
    '  Stored in directory: /home/ec2-user/.cache/pip/wheels/0f/1e/f7/27e4abff8fcdfdf42c96b88fabbb03359acc9ec78b2d743812'
    , 'Successfully built nose',
    'Installing collected packages: jmespath, docutils, six, python-dateutil, urllib3, botocore, s3transfer, nose, pbr, mock, wheel'
    , '  Running setup.py develop for jmespath',
    '  Running setup.py develop for botocore',
    '  Running setup.py develop for s3transfer',
    '  Attempting uninstall: wheel',
    '    Found existing installation: wheel 0.35.1',
    '    Uninstalling wheel-0.35.1:',
    '      Successfully uninstalled wheel-0.35.1',
    'Successfully installed botocore docutils-0.15.2 jmespath mock-1.3.0 nose-1.3.3 pbr-5.4.5 python-dateutil-2.8.1 s3transfer six-1.15.0 urllib3-1.25.10 wheel-0.24.0'
    , '(venv) admin:~/boto3/boto3 (develop) $ '], 'id': 44}], [{'start': {
    'row': 120, 'column': 0}, 'end': {'row': 166, 'column': 39}, 'action':
    'remove', 'lines': ['', '',
    '(venv) admin:~/boto3/boto3 (develop) $ pip install -r requirements.txt',
    'Obtaining botocore from git+git://github.com/boto/botocore.git@develop#egg=botocore (from -r requirements.txt (line 1))'
    ,
    '  Cloning git://github.com/boto/botocore.git (to revision develop) to ./venv/src/botocore'
    ,
    'Obtaining jmespath from git+git://github.com/boto/jmespath.git@develop#egg=jmespath (from -r requirements.txt (line 2))'
    ,
    '  Cloning git://github.com/boto/jmespath.git (to revision develop) to ./venv/src/jmespath'
    ,
    'Obtaining s3transfer from git+git://github.com/boto/s3transfer.git@develop#egg=s3transfer (from -r requirements.txt (line 3))'
    ,
    '  Cloning git://github.com/boto/s3transfer.git (to revision develop) to ./venv/src/s3transfer'
    , 'Collecting nose==1.3.3', '  Downloading nose-1.3.3.tar.gz (274 kB)',
    '     |████████████████████████████████| 274 kB 648 kB/s ',
    'Collecting mock==1.3.0',
    '  Downloading mock-1.3.0-py2.py3-none-any.whl (56 kB)',
    '     |████████████████████████████████| 56 kB 2.5 MB/s ',
    'Collecting wheel==0.24.0',
    '  Downloading wheel-0.24.0-py2.py3-none-any.whl (63 kB)',
    '     |████████████████████████████████| 63 kB 1.7 MB/s ',
    'Collecting docutils<0.16,>=0.10',
    '  Downloading docutils-0.15.2-py3-none-any.whl (547 kB)',
    '     |████████████████████████████████| 547 kB 2.0 MB/s ',
    'Collecting python-dateutil<3.0.0,>=2.1',
    '  Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)',
    '     |████████████████████████████████| 227 kB 3.2 MB/s ',
    'Collecting urllib3<1.26,>=1.20',
    '  Downloading urllib3-1.25.10-py2.py3-none-any.whl (127 kB)',
    '     |████████████████████████████████| 127 kB 3.3 MB/s ',
    'Collecting six>=1.7',
    '  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)',
    'Collecting pbr>=0.11',
    '  Downloading pbr-5.4.5-py2.py3-none-any.whl (110 kB)',
    '     |████████████████████████████████| 110 kB 3.6 MB/s ',
    'Building wheels for collected packages: nose',
    '  Building wheel for nose (setup.py) ... done',
    '  Created wheel for nose: filename=nose-1.3.3-py3-none-any.whl size=153083 sha256=92beb5bd88fbc4021a3b0ba80612ddc209782e1344791c771a7392a54ff8701f'
    ,
    '  Stored in directory: /home/ec2-user/.cache/pip/wheels/0f/1e/f7/27e4abff8fcdfdf42c96b88fabbb03359acc9ec78b2d743812'
    , 'Successfully built nose',
    'Installing collected packages: jmespath, docutils, six, python-dateutil, urllib3, botocore, s3transfer, nose, pbr, mock, wheel'
    , '  Running setup.py develop for jmespath',
    '  Running setup.py develop for botocore',
    '  Running setup.py develop for s3transfer',
    '  Attempting uninstall: wheel',
    '    Found existing installation: wheel 0.35.1',
    '    Uninstalling wheel-0.35.1:',
    '      Successfully uninstalled wheel-0.35.1',
    'Successfully installed botocore docutils-0.15.2 jmespath mock-1.3.0 nose-1.3.3 pbr-5.4.5 python-dateutil-2.8.1 s3transfer six-1.15.0 urllib3-1.25.10 wheel-0.24.0'
    , '(venv) admin:~/boto3/boto3 (develop) $ '], 'id': 45}], [{'start': {
    'row': 0, 'column': 2}, 'end': {'row': 11, 'column': 1}, 'action':
    'remove', 'lines': [
    'This script installs Boto in Pythonista. Run this script in your root folder'
    ,
    '# and it will download and install Boto along with its dependencies. To use'
    ,
    '# Boto, be sure to add boto-module in your sys.path before importing boto like'
    , '# so:', '#', "#   import sys; sys.path.append('boto-module')",
    '#   import boto.ec2', '#', '# Credits:',
    '# This script is based on greinacker/pythonista-install-boto.py :',
    '# https://gist.github.com/greinacker/5a61309be34490a63aa6', '#'], 'id':
    46}], [{'start': {'row': 0, 'column': 2}, 'end': {'row': 0, 'column': 
    44}, 'action': 'insert', 'lines': [
    'StaSh - Shell Like an Expert in Pythonista'], 'id': 47}], [{'start': {
    'row': 0, 'column': 44}, 'end': {'row': 1, 'column': 0}, 'action':
    'insert', 'lines': ['', ''], 'id': 48}, {'start': {'row': 1, 'column': 
    0}, 'end': {'row': 1, 'column': 1}, 'action': 'insert', 'lines': ['#']}
    ], [{'start': {'row': 1, 'column': 1}, 'end': {'row': 2, 'column': 0},
    'action': 'insert', 'lines': ['', ''], 'id': 49}, {'start': {'row': 2,
    'column': 0}, 'end': {'row': 2, 'column': 1}, 'action': 'insert',
    'lines': ['#']}], [{'start': {'row': 2, 'column': 1}, 'end': {'row': 2,
    'column': 2}, 'action': 'insert', 'lines': [' '], 'id': 50}, {'start':
    {'row': 2, 'column': 2}, 'end': {'row': 2, 'column': 3}, 'action':
    'insert', 'lines': ['s']}, {'start': {'row': 2, 'column': 3}, 'end': {
    'row': 2, 'column': 4}, 'action': 'insert', 'lines': ['o']}, {'start':
    {'row': 2, 'column': 4}, 'end': {'row': 2, 'column': 5}, 'action':
    'insert', 'lines': ['u']}, {'start': {'row': 2, 'column': 5}, 'end': {
    'row': 2, 'column': 6}, 'action': 'insert', 'lines': ['r']}, {'start':
    {'row': 2, 'column': 6}, 'end': {'row': 2, 'column': 7}, 'action':
    'insert', 'lines': ['c']}, {'start': {'row': 2, 'column': 7}, 'end': {
    'row': 2, 'column': 8}, 'action': 'insert', 'lines': ['e']}], [{'start':
    {'row': 2, 'column': 8}, 'end': {'row': 2, 'column': 9}, 'action':
    'insert', 'lines': [':'], 'id': 51}], [{'start': {'row': 2, 'column': 9
    }, 'end': {'row': 2, 'column': 10}, 'action': 'insert', 'lines': [' '],
    'id': 52}], [{'start': {'row': 2, 'column': 10}, 'end': {'row': 2,
    'column': 41}, 'action': 'insert', 'lines': [
    'https://github.com/ywangd/stash'], 'id': 53}], [{'start': {'row': 2,
    'column': 41}, 'end': {'row': 3, 'column': 0}, 'action': 'insert',
    'lines': ['', ''], 'id': 54}, {'start': {'row': 3, 'column': 0}, 'end':
    {'row': 3, 'column': 1}, 'action': 'insert', 'lines': ['#']}], [{
    'start': {'row': 3, 'column': 1}, 'end': {'row': 3, 'column': 2},
    'action': 'insert', 'lines': [' '], 'id': 55}], [{'start': {'row': 3,
    'column': 1}, 'end': {'row': 3, 'column': 2}, 'action': 'remove',
    'lines': [' '], 'id': 56}], [{'start': {'row': 3, 'column': 1}, 'end':
    {'row': 4, 'column': 0}, 'action': 'insert', 'lines': ['', ''], 'id': 
    57}, {'start': {'row': 4, 'column': 0}, 'end': {'row': 4, 'column': 1},
    'action': 'insert', 'lines': ['#']}], [{'start': {'row': 4, 'column': 1
    }, 'end': {'row': 4, 'column': 2}, 'action': 'insert', 'lines': [' '],
    'id': 58}, {'start': {'row': 4, 'column': 2}, 'end': {'row': 4,
    'column': 3}, 'action': 'insert', 'lines': ['r']}, {'start': {'row': 4,
    'column': 3}, 'end': {'row': 4, 'column': 4}, 'action': 'insert',
    'lines': ['e']}, {'start': {'row': 4, 'column': 4}, 'end': {'row': 4,
    'column': 5}, 'action': 'insert', 'lines': ['q']}, {'start': {'row': 4,
    'column': 5}, 'end': {'row': 4, 'column': 6}, 'action': 'insert',
    'lines': ['u']}, {'start': {'row': 4, 'column': 6}, 'end': {'row': 4,
    'column': 7}, 'action': 'insert', 'lines': ['i']}, {'start': {'row': 4,
    'column': 7}, 'end': {'row': 4, 'column': 8}, 'action': 'insert',
    'lines': ['r']}, {'start': {'row': 4, 'column': 8}, 'end': {'row': 4,
    'column': 9}, 'action': 'insert', 'lines': ['e']}, {'start': {'row': 4,
    'column': 9}, 'end': {'row': 4, 'column': 10}, 'action': 'insert',
    'lines': ['d']}], [{'start': {'row': 4, 'column': 10}, 'end': {'row': 4,
    'column': 11}, 'action': 'insert', 'lines': [' '], 'id': 59}, {'start':
    {'row': 4, 'column': 11}, 'end': {'row': 4, 'column': 12}, 'action':
    'insert', 'lines': ['t']}, {'start': {'row': 4, 'column': 12}, 'end': {
    'row': 4, 'column': 13}, 'action': 'insert', 'lines': ['o']}], [{
    'start': {'row': 4, 'column': 13}, 'end': {'row': 4, 'column': 14},
    'action': 'insert', 'lines': [' '], 'id': 60}, {'start': {'row': 4,
    'column': 14}, 'end': {'row': 4, 'column': 15}, 'action': 'insert',
    'lines': ['i']}, {'start': {'row': 4, 'column': 15}, 'end': {'row': 4,
    'column': 16}, 'action': 'insert', 'lines': ['n']}, {'start': {'row': 4,
    'column': 16}, 'end': {'row': 4, 'column': 17}, 'action': 'insert',
    'lines': ['s']}, {'start': {'row': 4, 'column': 17}, 'end': {'row': 4,
    'column': 18}, 'action': 'insert', 'lines': ['t']}, {'start': {'row': 4,
    'column': 18}, 'end': {'row': 4, 'column': 19}, 'action': 'insert',
    'lines': ['a']}, {'start': {'row': 4, 'column': 19}, 'end': {'row': 4,
    'column': 20}, 'action': 'insert', 'lines': ['l']}, {'start': {'row': 4,
    'column': 20}, 'end': {'row': 4, 'column': 21}, 'action': 'insert',
    'lines': ['l']}], [{'start': {'row': 4, 'column': 21}, 'end': {'row': 4,
    'column': 22}, 'action': 'insert', 'lines': [' '], 'id': 61}, {'start':
    {'row': 4, 'column': 22}, 'end': {'row': 4, 'column': 23}, 'action':
    'insert', 'lines': ['b']}, {'start': {'row': 4, 'column': 23}, 'end': {
    'row': 4, 'column': 24}, 'action': 'insert', 'lines': ['o']}, {'start':
    {'row': 4, 'column': 24}, 'end': {'row': 4, 'column': 25}, 'action':
    'insert', 'lines': ['t']}, {'start': {'row': 4, 'column': 25}, 'end': {
    'row': 4, 'column': 26}, 'action': 'insert', 'lines': ['o']}], [{
    'start': {'row': 4, 'column': 26}, 'end': {'row': 4, 'column': 27},
    'action': 'insert', 'lines': ['3'], 'id': 62}], [{'start': {'row': 4,
    'column': 22}, 'end': {'row': 4, 'column': 23}, 'action': 'insert',
    'lines': ['t'], 'id': 63}, {'start': {'row': 4, 'column': 23}, 'end': {
    'row': 4, 'column': 24}, 'action': 'insert', 'lines': ['h']}, {'start':
    {'row': 4, 'column': 24}, 'end': {'row': 4, 'column': 25}, 'action':
    'insert', 'lines': ['e']}], [{'start': {'row': 4, 'column': 25}, 'end':
    {'row': 4, 'column': 26}, 'action': 'insert', 'lines': [' '], 'id': 64}
    ], [{'start': {'row': 4, 'column': 31}, 'end': {'row': 4, 'column': 32},
    'action': 'insert', 'lines': [' '], 'id': 65}, {'start': {'row': 4,
    'column': 32}, 'end': {'row': 4, 'column': 33}, 'action': 'insert',
    'lines': ['l']}, {'start': {'row': 4, 'column': 33}, 'end': {'row': 4,
    'column': 34}, 'action': 'insert', 'lines': ['i']}, {'start': {'row': 4,
    'column': 34}, 'end': {'row': 4, 'column': 35}, 'action': 'insert',
    'lines': ['b']}, {'start': {'row': 4, 'column': 35}, 'end': {'row': 4,
    'column': 36}, 'action': 'insert', 'lines': ['r']}, {'start': {'row': 4,
    'column': 36}, 'end': {'row': 4, 'column': 37}, 'action': 'insert',
    'lines': ['a']}, {'start': {'row': 4, 'column': 37}, 'end': {'row': 4,
    'column': 38}, 'action': 'insert', 'lines': ['r']}, {'start': {'row': 4,
    'column': 38}, 'end': {'row': 4, 'column': 39}, 'action': 'insert',
    'lines': ['y']}], [{'start': {'row': 4, 'column': 39}, 'end': {'row': 5,
    'column': 0}, 'action': 'insert', 'lines': ['', ''], 'id': 66}], [{
    'start': {'row': 5, 'column': 0}, 'end': {'row': 6, 'column': 0},
    'action': 'remove', 'lines': ['', ''], 'id': 67}], [{'start': {'row': 6,
    'column': 0}, 'end': {'row': 113, 'column': 0}, 'action': 'remove',
    'lines': ['', 'packages = [',
    "    'https://pypi.python.org/packages/source/b/boto3/boto3-1.14.47.tar.gz',"
    ,
    "    'https://pypi.python.org/packages/source/m/mock/mock-4.0.2.tar.gz',",
    ']', '', '', 'nose==1.3.3', 'mock==1.3.0', 'wheel==0.24.0', '',
    "configparser_src = 'http://hg.python.org/cpython/raw-file/70274d53c1dd/Lib/ConfigParser.py'"
    , '', 'import shutil', 'import urllib', 'from urlparse import urlparse',
    'import tarfile', 'import zipfile', 'import os', '', '',
    'def create_module_dir():', '    try:',
    "        os.mkdir('boto-module')", '    except:', '        pass', '',
    '', 'def get_filename_from_url(url):', '    parsed_url = urlparse(url)',
    "    return parsed_url.path.rpartition('/')[-1]", '',
    'def is_zipfile(f):', "    return f.endswith('.zip')", '',
    'def is_targzfile(f):', "    return f.endswith('.tar.gz')", '',
    'def download_packages():', '    for f in packages:',
    "        print('Downloading %s' % f)",
    '        filepath, headers = urllib.urlretrieve(f)',
    "        print('Extracting %s' % filepath)",
    '        filename = get_filename_from_url(f)',
    '        if is_targzfile(filename):',
    "            t = tarfile.open(filepath, 'r')",
    '            t.extractall()', '            t.close()',
    '        elif is_zipfile(filename):',
    "            z = zipfile.ZipFile(filepath, 'r')",
    '            z.extractall()', '            z.close()', '',
    'def install_configparser_src():',
    "    print('Installing ConfigParser...')",
    '    filepath, headers = urllib.urlretrieve(configparser_src)',
    "    shutil.move(filepath, 'boto-module/ConfigParser.py')", '',
    'def install_packages():', "    print('Installing boto...')",
    "    shutil.move('boto-2.8.0/boto', 'boto-module/boto')",
    "    shutil.rmtree('boto-2.8.0')", '',
    "    print('Installing mock...')",
    "    shutil.move('mock-1.0.1/mock.py', 'boto-module/mock.py')",
    "    shutil.rmtree('mock-1.0.1')", '', "    print('Installing rsa...')",
    "    shutil.move('rsa-3.1.1/rsa', 'boto-module/rsa')",
    "    shutil.rmtree('rsa-3.1.1')", '', "    print('Installing tox...')",
    "    shutil.move('tox-1.4/tox', 'boto-module/tox')",
    "    shutil.rmtree('tox-1.4')", '', "    print('Installing Sphinx...')",
    "    shutil.move('Sphinx-1.1.3/sphinx', 'boto-module/sphinx')",
    "    shutil.rmtree('Sphinx-1.1.3')", '',
    "    print('Installing simplejson...')",
    "    shutil.move('simplejson-2.5.2/simplejson', 'boto-module/simplejson')",
    "    shutil.rmtree('simplejson-2.5.2')", '',
    "    print('Installing argparse...')",
    "    shutil.move('argparse-1.2.1/argparse.py', 'boto-module/argparse.py')",
    "    shutil.rmtree('argparse-1.2.1')", '',
    "    print('Installing unittest2...')",
    "    shutil.move('unittest2-0.5.1/unittest2', 'boto-module/unittest2')",
    "    shutil.rmtree('unittest2-0.5.1')", '',
    'def reload_pythonista_editor():',
    "    print('Reloading Pythonista editor')", '    import editor',
    '    editor.reload_files()', '', '', "if __name__ == '__main__':",
    '    create_module_dir()', '    download_packages()',
    '    install_packages()', '    install_configparser_src()',
    '    reload_pythonista_editor()', "    print('All done!')", '', '', '',
    ''], 'id': 68}], [{'start': {'row': 6, 'column': 0}, 'end': {'row': 6,
    'column': 69}, 'action': 'insert', 'lines': [
    "import requests as r; exec(r.get('https://bit.ly/get-stash').content)"
    ], 'id': 69}], [{'start': {'row': 6, 'column': 69}, 'end': {'row': 7,
    'column': 0}, 'action': 'insert', 'lines': ['', ''], 'id': 70}]]},
    'ace': {'folds': [], 'scrolltop': 0, 'scrollleft': 0, 'selection': {
    'start': {'row': 7, 'column': 0}, 'end': {'row': 7, 'column': 0},
    'isBackwards': false}, 'options': {'guessTabSize': true, 'useWrapMode':
    false, 'wrapToView': true}, 'firstLineState': 0}, 'timestamp': 
    1598330159797, 'hash': '3c9864acfcd25b79e78cfb7e67cbb54fb5ca8f20'}

{"filter":false,"title":"install_stash.py","tooltip":"/Pythonista/install_stash.py","undoManager":{"mark":69,"position":69,"stack":[[{"start":{"row":0,"column":0},"end":{"row":156,"column":0},"action":"insert","lines":["","Skip to content","All gists","Back to GitHub","Sign in","Sign up","","Instantly share code, notes, and snippets.","@greinacker","greinacker/","pythonista-install-boto.py","forked from najibninaba/pythonista-install-boto.py","Created 5 years ago","","4","","    0","","Code","Revisions 4","Stars 4","Pythonista script for installing boto","pythonista-install-boto.py","# Source: https://gist.github.com/najibninaba/5062153","# ","# This script installs Boto in Pythonista. Run this script in your root folder and it will download and install Boto along with its","# dependencies. To use Boto, be sure to add boto-module in your sys.path before importing boto like so:","# import sys; sys.path.append('boto-module')","# import boto.ec2","#","# Credits:","# This script is inspired by omz's Evernote Installer script: https://gist.github.com/omz/5048588","#","","","packages = ['https://pypi.python.org/packages/source/b/boto/boto-2.8.0.tar.gz',","    'https://pypi.python.org/packages/source/m/mock/mock-1.0.1.tar.gz',","    'https://pypi.python.org/packages/source/r/rsa/rsa-3.1.1.tar.gz',","    'https://pypi.python.org/packages/source/t/tox/tox-1.4.zip',","    'https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.1.3.tar.gz',","    'https://pypi.python.org/packages/source/s/simplejson/simplejson-2.5.2.tar.gz',","    'http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz',","    'https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gz'","]","","configparser_src = 'http://hg.python.org/cpython/raw-file/70274d53c1dd/Lib/ConfigParser.py'","","import shutil","import urllib","from urlparse import urlparse","import tarfile","import zipfile","import os","","","def create_module_dir():","    try:","        os.mkdir('boto-module')","    except:","        pass","","","def get_filename_from_url(url):","    parsed_url = urlparse(url)","    return parsed_url.path.rpartition('/')[-1]","","def is_zipfile(f):","    return f.endswith('.zip')","","def is_targzfile(f):","    return f.endswith('.tar.gz')","","def download_packages():","    for f in packages:","        print('Downloading %s' % f)","        filepath, headers = urllib.urlretrieve(f)","        print('Extracting %s' % filepath)","        filename = get_filename_from_url(f)","        if is_targzfile(filename):","            t = tarfile.open(filepath, 'r')","            t.extractall()","            t.close()","        elif is_zipfile(filename):","            z = zipfile.ZipFile(filepath, 'r')","            z.extractall()","            z.close()","","def install_configparser_src():","    print('Installing ConfigParser...')","    filepath, headers = urllib.urlretrieve(configparser_src)","    shutil.move(filepath, 'boto-module/ConfigParser.py')","","def install_packages():","    print('Installing boto...')","    shutil.move('boto-2.8.0/boto', 'boto-module/boto')","    shutil.rmtree('boto-2.8.0')","","    print('Installing mock...')","    shutil.move('mock-1.0.1/mock.py', 'boto-module/mock.py')","    shutil.rmtree('mock-1.0.1')","","    print('Installing rsa...')","    shutil.move('rsa-3.1.1/rsa', 'boto-module/rsa')","    shutil.rmtree('rsa-3.1.1')","","    print('Installing tox...')","    shutil.move('tox-1.4/tox', 'boto-module/tox')","    shutil.rmtree('tox-1.4')","","    print('Installing Sphinx...')","    shutil.move('Sphinx-1.1.3/sphinx', 'boto-module/sphinx')","    shutil.rmtree('Sphinx-1.1.3')","","    print('Installing simplejson...')","    shutil.move('simplejson-2.5.2/simplejson', 'boto-module/simplejson')","    shutil.rmtree('simplejson-2.5.2')","","    print('Installing argparse...')","    shutil.move('argparse-1.2.1/argparse.py', 'boto-module/argparse.py')","    shutil.rmtree('argparse-1.2.1')","","    print('Installing unittest2...')","    shutil.move('unittest2-0.5.1/unittest2', 'boto-module/unittest2')","    shutil.rmtree('unittest2-0.5.1')","","def reload_pythonista_editor():","    print('Reloading Pythonista editor')","    import editor","    editor.reload_files()","","","if __name__ == '__main__':","    create_module_dir()","    download_packages()","    install_packages()","    install_configparser_src()","    reload_pythonista_editor()","    print('All done!')","    ","","to join this conversation on GitHub. Already have an account? Sign in to comment","","    © 2020 GitHub, Inc.","    Terms","    Privacy","    Security","    Status","    Help","","    Contact GitHub","    Pricing","    API","    Training","    Blog","    About","",""],"id":1}],[{"start":{"row":0,"column":0},"end":{"row":156,"column":0},"action":"remove","lines":["","Skip to content","All gists","Back to GitHub","Sign in","Sign up","","Instantly share code, notes, and snippets.","@greinacker","greinacker/","pythonista-install-boto.py","forked from najibninaba/pythonista-install-boto.py","Created 5 years ago","","4","","    0","","Code","Revisions 4","Stars 4","Pythonista script for installing boto","pythonista-install-boto.py","# Source: https://gist.github.com/najibninaba/5062153","# ","# This script installs Boto in Pythonista. Run this script in your root folder and it will download and install Boto along with its","# dependencies. To use Boto, be sure to add boto-module in your sys.path before importing boto like so:","# import sys; sys.path.append('boto-module')","# import boto.ec2","#","# Credits:","# This script is inspired by omz's Evernote Installer script: https://gist.github.com/omz/5048588","#","","","packages = ['https://pypi.python.org/packages/source/b/boto/boto-2.8.0.tar.gz',","    'https://pypi.python.org/packages/source/m/mock/mock-1.0.1.tar.gz',","    'https://pypi.python.org/packages/source/r/rsa/rsa-3.1.1.tar.gz',","    'https://pypi.python.org/packages/source/t/tox/tox-1.4.zip',","    'https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.1.3.tar.gz',","    'https://pypi.python.org/packages/source/s/simplejson/simplejson-2.5.2.tar.gz',","    'http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz',","    'https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gz'","]","","configparser_src = 'http://hg.python.org/cpython/raw-file/70274d53c1dd/Lib/ConfigParser.py'","","import shutil","import urllib","from urlparse import urlparse","import tarfile","import zipfile","import os","","","def create_module_dir():","    try:","        os.mkdir('boto-module')","    except:","        pass","","","def get_filename_from_url(url):","    parsed_url = urlparse(url)","    return parsed_url.path.rpartition('/')[-1]","","def is_zipfile(f):","    return f.endswith('.zip')","","def is_targzfile(f):","    return f.endswith('.tar.gz')","","def download_packages():","    for f in packages:","        print('Downloading %s' % f)","        filepath, headers = urllib.urlretrieve(f)","        print('Extracting %s' % filepath)","        filename = get_filename_from_url(f)","        if is_targzfile(filename):","            t = tarfile.open(filepath, 'r')","            t.extractall()","            t.close()","        elif is_zipfile(filename):","            z = zipfile.ZipFile(filepath, 'r')","            z.extractall()","            z.close()","","def install_configparser_src():","    print('Installing ConfigParser...')","    filepath, headers = urllib.urlretrieve(configparser_src)","    shutil.move(filepath, 'boto-module/ConfigParser.py')","","def install_packages():","    print('Installing boto...')","    shutil.move('boto-2.8.0/boto', 'boto-module/boto')","    shutil.rmtree('boto-2.8.0')","","    print('Installing mock...')","    shutil.move('mock-1.0.1/mock.py', 'boto-module/mock.py')","    shutil.rmtree('mock-1.0.1')","","    print('Installing rsa...')","    shutil.move('rsa-3.1.1/rsa', 'boto-module/rsa')","    shutil.rmtree('rsa-3.1.1')","","    print('Installing tox...')","    shutil.move('tox-1.4/tox', 'boto-module/tox')","    shutil.rmtree('tox-1.4')","","    print('Installing Sphinx...')","    shutil.move('Sphinx-1.1.3/sphinx', 'boto-module/sphinx')","    shutil.rmtree('Sphinx-1.1.3')","","    print('Installing simplejson...')","    shutil.move('simplejson-2.5.2/simplejson', 'boto-module/simplejson')","    shutil.rmtree('simplejson-2.5.2')","","    print('Installing argparse...')","    shutil.move('argparse-1.2.1/argparse.py', 'boto-module/argparse.py')","    shutil.rmtree('argparse-1.2.1')","","    print('Installing unittest2...')","    shutil.move('unittest2-0.5.1/unittest2', 'boto-module/unittest2')","    shutil.rmtree('unittest2-0.5.1')","","def reload_pythonista_editor():","    print('Reloading Pythonista editor')","    import editor","    editor.reload_files()","","","if __name__ == '__main__':","    create_module_dir()","    download_packages()","    install_packages()","    install_configparser_src()","    reload_pythonista_editor()","    print('All done!')","    ","","to join this conversation on GitHub. Already have an account? Sign in to comment","","    © 2020 GitHub, Inc.","    Terms","    Privacy","    Security","    Status","    Help","","    Contact GitHub","    Pricing","    API","    Training","    Blog","    About","",""],"id":2}],[{"start":{"row":0,"column":0},"end":{"row":118,"column":0},"action":"insert","lines":["# Source: https://gist.github.com/najibninaba/5062153","# ","# This script installs Boto in Pythonista. Run this script in your root folder and it will download and install Boto along with its","# dependencies. To use Boto, be sure to add boto-module in your sys.path before importing boto like so:","# import sys; sys.path.append('boto-module')","# import boto.ec2","#","# Credits:","# This script is inspired by omz's Evernote Installer script: https://gist.github.com/omz/5048588","#","","","packages = ['https://pypi.python.org/packages/source/b/boto/boto-2.8.0.tar.gz',","    'https://pypi.python.org/packages/source/m/mock/mock-1.0.1.tar.gz',","    'https://pypi.python.org/packages/source/r/rsa/rsa-3.1.1.tar.gz',","    'https://pypi.python.org/packages/source/t/tox/tox-1.4.zip',","    'https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.1.3.tar.gz',","    'https://pypi.python.org/packages/source/s/simplejson/simplejson-2.5.2.tar.gz',","    'http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz',","    'https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gz'","]","","configparser_src = 'http://hg.python.org/cpython/raw-file/70274d53c1dd/Lib/ConfigParser.py'","","import shutil","import urllib","from urlparse import urlparse","import tarfile","import zipfile","import os","","","def create_module_dir():","    try:","        os.mkdir('boto-module')","    except:","        pass","","","def get_filename_from_url(url):","    parsed_url = urlparse(url)","    return parsed_url.path.rpartition('/')[-1]","","def is_zipfile(f):","    return f.endswith('.zip')","","def is_targzfile(f):","    return f.endswith('.tar.gz')","","def download_packages():","    for f in packages:","        print('Downloading %s' % f)","        filepath, headers = urllib.urlretrieve(f)","        print('Extracting %s' % filepath)","        filename = get_filename_from_url(f)","        if is_targzfile(filename):","            t = tarfile.open(filepath, 'r')","            t.extractall()","            t.close()","        elif is_zipfile(filename):","            z = zipfile.ZipFile(filepath, 'r')","            z.extractall()","            z.close()","","def install_configparser_src():","    print('Installing ConfigParser...')","    filepath, headers = urllib.urlretrieve(configparser_src)","    shutil.move(filepath, 'boto-module/ConfigParser.py')","","def install_packages():","    print('Installing boto...')","    shutil.move('boto-2.8.0/boto', 'boto-module/boto')","    shutil.rmtree('boto-2.8.0')","","    print('Installing mock...')","    shutil.move('mock-1.0.1/mock.py', 'boto-module/mock.py')","    shutil.rmtree('mock-1.0.1')","","    print('Installing rsa...')","    shutil.move('rsa-3.1.1/rsa', 'boto-module/rsa')","    shutil.rmtree('rsa-3.1.1')","","    print('Installing tox...')","    shutil.move('tox-1.4/tox', 'boto-module/tox')","    shutil.rmtree('tox-1.4')","","    print('Installing Sphinx...')","    shutil.move('Sphinx-1.1.3/sphinx', 'boto-module/sphinx')","    shutil.rmtree('Sphinx-1.1.3')","","    print('Installing simplejson...')","    shutil.move('simplejson-2.5.2/simplejson', 'boto-module/simplejson')","    shutil.rmtree('simplejson-2.5.2')","","    print('Installing argparse...')","    shutil.move('argparse-1.2.1/argparse.py', 'boto-module/argparse.py')","    shutil.rmtree('argparse-1.2.1')","","    print('Installing unittest2...')","    shutil.move('unittest2-0.5.1/unittest2', 'boto-module/unittest2')","    shutil.rmtree('unittest2-0.5.1')","","def reload_pythonista_editor():","    print('Reloading Pythonista editor')","    import editor","    editor.reload_files()","","","if __name__ == '__main__':","    create_module_dir()","    download_packages()","    install_packages()","    install_configparser_src()","    reload_pythonista_editor()","    print('All done!')","    ","","",""],"id":3}],[{"start":{"row":117,"column":0},"end":{"row":118,"column":0},"action":"remove","lines":["",""],"id":4},{"start":{"row":116,"column":0},"end":{"row":117,"column":0},"action":"remove","lines":["",""]},{"start":{"row":115,"column":4},"end":{"row":116,"column":0},"action":"remove","lines":["",""]},{"start":{"row":115,"column":0},"end":{"row":115,"column":4},"action":"remove","lines":["    "]}],[{"start":{"row":0,"column":0},"end":{"row":0,"column":53},"action":"remove","lines":["# Source: https://gist.github.com/najibninaba/5062153"],"id":5}],[{"start":{"row":0,"column":0},"end":{"row":1,"column":0},"action":"remove","lines":["",""],"id":6}],[{"start":{"row":0,"column":0},"end":{"row":0,"column":2},"action":"remove","lines":["# "],"id":7},{"start":{"row":0,"column":0},"end":{"row":1,"column":0},"action":"remove","lines":["",""]}],[{"start":{"row":0,"column":78},"end":{"row":0,"column":79},"action":"remove","lines":[" "],"id":8}],[{"start":{"row":0,"column":78},"end":{"row":1,"column":0},"action":"insert","lines":["",""],"id":9}],[{"start":{"row":1,"column":0},"end":{"row":1,"column":1},"action":"insert","lines":["#"],"id":10}],[{"start":{"row":1,"column":1},"end":{"row":1,"column":2},"action":"insert","lines":[" "],"id":11}],[{"start":{"row":1,"column":54},"end":{"row":1,"column":55},"action":"insert","lines":[" "],"id":12}],[{"start":{"row":1,"column":55},"end":{"row":2,"column":2},"action":"remove","lines":["","# "],"id":13}],[{"start":{"row":1,"column":75},"end":{"row":1,"column":76},"action":"remove","lines":[" "],"id":14}],[{"start":{"row":1,"column":75},"end":{"row":2,"column":0},"action":"insert","lines":["",""],"id":15},{"start":{"row":2,"column":0},"end":{"row":2,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":2,"column":1},"end":{"row":2,"column":2},"action":"insert","lines":[" "],"id":16}],[{"start":{"row":2,"column":78},"end":{"row":2,"column":79},"action":"remove","lines":[" "],"id":17}],[{"start":{"row":2,"column":78},"end":{"row":3,"column":0},"action":"insert","lines":["",""],"id":18},{"start":{"row":3,"column":0},"end":{"row":3,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":3,"column":1},"end":{"row":3,"column":2},"action":"insert","lines":[" "],"id":19}],[{"start":{"row":3,"column":5},"end":{"row":4,"column":0},"action":"insert","lines":["",""],"id":20},{"start":{"row":4,"column":0},"end":{"row":4,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":5,"column":2},"end":{"row":5,"column":4},"action":"insert","lines":["  "],"id":21}],[{"start":{"row":6,"column":2},"end":{"row":6,"column":4},"action":"insert","lines":["  "],"id":22}],[{"start":{"row":9,"column":17},"end":{"row":9,"column":43},"action":"remove","lines":["inspired by omz's Evernote"],"id":23},{"start":{"row":9,"column":17},"end":{"row":9,"column":18},"action":"insert","lines":["b"]},{"start":{"row":9,"column":18},"end":{"row":9,"column":19},"action":"insert","lines":["a"]},{"start":{"row":9,"column":19},"end":{"row":9,"column":20},"action":"insert","lines":["s"]},{"start":{"row":9,"column":20},"end":{"row":9,"column":21},"action":"insert","lines":["e"]},{"start":{"row":9,"column":21},"end":{"row":9,"column":22},"action":"insert","lines":["d"]}],[{"start":{"row":9,"column":22},"end":{"row":9,"column":23},"action":"insert","lines":[" "],"id":24},{"start":{"row":9,"column":23},"end":{"row":9,"column":24},"action":"insert","lines":["o"]},{"start":{"row":9,"column":24},"end":{"row":9,"column":25},"action":"insert","lines":["n"]}],[{"start":{"row":9,"column":25},"end":{"row":9,"column":26},"action":"insert","lines":[" "],"id":25}],[{"start":{"row":9,"column":26},"end":{"row":10,"column":26},"action":"insert","lines":["greinacker/","pythonista-install-boto.py"],"id":26}],[{"start":{"row":9,"column":37},"end":{"row":10,"column":0},"action":"remove","lines":["",""],"id":27}],[{"start":{"row":9,"column":64},"end":{"row":9,"column":80},"action":"remove","lines":["Installer script"],"id":28}],[{"start":{"row":9,"column":65},"end":{"row":9,"column":66},"action":"remove","lines":[" "],"id":29}],[{"start":{"row":9,"column":65},"end":{"row":10,"column":0},"action":"insert","lines":["",""],"id":30},{"start":{"row":10,"column":0},"end":{"row":10,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":10,"column":1},"end":{"row":10,"column":2},"action":"insert","lines":[" "],"id":31}],[{"start":{"row":10,"column":2},"end":{"row":10,"column":37},"action":"remove","lines":["https://gist.github.com/omz/5048588"],"id":32},{"start":{"row":10,"column":2},"end":{"row":10,"column":57},"action":"insert","lines":["https://gist.github.com/greinacker/5a61309be34490a63aa6"]}],[{"start":{"row":23,"column":0},"end":{"row":24,"column":0},"action":"insert","lines":["",""],"id":33},{"start":{"row":24,"column":0},"end":{"row":25,"column":0},"action":"insert","lines":["",""]},{"start":{"row":25,"column":0},"end":{"row":26,"column":0},"action":"insert","lines":["",""]}],[{"start":{"row":25,"column":0},"end":{"row":27,"column":13},"action":"insert","lines":["nose==1.3.3","mock==1.3.0","wheel==0.24.0"],"id":34}],[{"start":{"row":14,"column":12},"end":{"row":15,"column":0},"action":"insert","lines":["",""],"id":35},{"start":{"row":15,"column":0},"end":{"row":15,"column":4},"action":"insert","lines":["    "]}],[{"start":{"row":17,"column":0},"end":{"row":23,"column":0},"action":"remove","lines":["    'https://pypi.python.org/packages/source/r/rsa/rsa-3.1.1.tar.gz',","    'https://pypi.python.org/packages/source/t/tox/tox-1.4.zip',","    'https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.1.3.tar.gz',","    'https://pypi.python.org/packages/source/s/simplejson/simplejson-2.5.2.tar.gz',","    'http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz',","    'https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gz'",""],"id":36}],[{"start":{"row":15,"column":51},"end":{"row":15,"column":52},"action":"insert","lines":["3"],"id":37}],[{"start":{"row":15,"column":53},"end":{"row":15,"column":70},"action":"remove","lines":["boto-2.8.0.tar.gz"],"id":38},{"start":{"row":15,"column":53},"end":{"row":15,"column":73},"action":"insert","lines":["boto3-1.14.47.tar.gz"]}],[{"start":{"row":16,"column":52},"end":{"row":16,"column":69},"action":"remove","lines":["mock-1.0.1.tar.gz"],"id":39},{"start":{"row":16,"column":52},"end":{"row":16,"column":70},"action":"insert","lines":["mock-4.0.2.tar.gz "]}],[{"start":{"row":16,"column":69},"end":{"row":16,"column":70},"action":"remove","lines":[" "],"id":40}],[{"start":{"row":117,"column":0},"end":{"row":118,"column":0},"action":"insert","lines":["",""],"id":41},{"start":{"row":118,"column":0},"end":{"row":119,"column":0},"action":"insert","lines":["",""]},{"start":{"row":119,"column":0},"end":{"row":120,"column":0},"action":"insert","lines":["",""]},{"start":{"row":120,"column":0},"end":{"row":121,"column":0},"action":"insert","lines":["",""]},{"start":{"row":121,"column":0},"end":{"row":122,"column":0},"action":"insert","lines":["",""]}],[{"start":{"row":122,"column":0},"end":{"row":122,"column":31},"action":"insert","lines":["pip install -r requirements.txt"],"id":42}],[{"start":{"row":122,"column":0},"end":{"row":122,"column":31},"action":"remove","lines":["pip install -r requirements.txt"],"id":43}],[{"start":{"row":122,"column":0},"end":{"row":166,"column":39},"action":"insert","lines":["(venv) admin:~/boto3/boto3 (develop) $ pip install -r requirements.txt","Obtaining botocore from git+git://github.com/boto/botocore.git@develop#egg=botocore (from -r requirements.txt (line 1))","  Cloning git://github.com/boto/botocore.git (to revision develop) to ./venv/src/botocore","Obtaining jmespath from git+git://github.com/boto/jmespath.git@develop#egg=jmespath (from -r requirements.txt (line 2))","  Cloning git://github.com/boto/jmespath.git (to revision develop) to ./venv/src/jmespath","Obtaining s3transfer from git+git://github.com/boto/s3transfer.git@develop#egg=s3transfer (from -r requirements.txt (line 3))","  Cloning git://github.com/boto/s3transfer.git (to revision develop) to ./venv/src/s3transfer","Collecting nose==1.3.3","  Downloading nose-1.3.3.tar.gz (274 kB)","     |████████████████████████████████| 274 kB 648 kB/s ","Collecting mock==1.3.0","  Downloading mock-1.3.0-py2.py3-none-any.whl (56 kB)","     |████████████████████████████████| 56 kB 2.5 MB/s ","Collecting wheel==0.24.0","  Downloading wheel-0.24.0-py2.py3-none-any.whl (63 kB)","     |████████████████████████████████| 63 kB 1.7 MB/s ","Collecting docutils<0.16,>=0.10","  Downloading docutils-0.15.2-py3-none-any.whl (547 kB)","     |████████████████████████████████| 547 kB 2.0 MB/s ","Collecting python-dateutil<3.0.0,>=2.1","  Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)","     |████████████████████████████████| 227 kB 3.2 MB/s ","Collecting urllib3<1.26,>=1.20","  Downloading urllib3-1.25.10-py2.py3-none-any.whl (127 kB)","     |████████████████████████████████| 127 kB 3.3 MB/s ","Collecting six>=1.7","  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)","Collecting pbr>=0.11","  Downloading pbr-5.4.5-py2.py3-none-any.whl (110 kB)","     |████████████████████████████████| 110 kB 3.6 MB/s ","Building wheels for collected packages: nose","  Building wheel for nose (setup.py) ... done","  Created wheel for nose: filename=nose-1.3.3-py3-none-any.whl size=153083 sha256=92beb5bd88fbc4021a3b0ba80612ddc209782e1344791c771a7392a54ff8701f","  Stored in directory: /home/ec2-user/.cache/pip/wheels/0f/1e/f7/27e4abff8fcdfdf42c96b88fabbb03359acc9ec78b2d743812","Successfully built nose","Installing collected packages: jmespath, docutils, six, python-dateutil, urllib3, botocore, s3transfer, nose, pbr, mock, wheel","  Running setup.py develop for jmespath","  Running setup.py develop for botocore","  Running setup.py develop for s3transfer","  Attempting uninstall: wheel","    Found existing installation: wheel 0.35.1","    Uninstalling wheel-0.35.1:","      Successfully uninstalled wheel-0.35.1","Successfully installed botocore docutils-0.15.2 jmespath mock-1.3.0 nose-1.3.3 pbr-5.4.5 python-dateutil-2.8.1 s3transfer six-1.15.0 urllib3-1.25.10 wheel-0.24.0","(venv) admin:~/boto3/boto3 (develop) $ "],"id":44}],[{"start":{"row":120,"column":0},"end":{"row":166,"column":39},"action":"remove","lines":["","","(venv) admin:~/boto3/boto3 (develop) $ pip install -r requirements.txt","Obtaining botocore from git+git://github.com/boto/botocore.git@develop#egg=botocore (from -r requirements.txt (line 1))","  Cloning git://github.com/boto/botocore.git (to revision develop) to ./venv/src/botocore","Obtaining jmespath from git+git://github.com/boto/jmespath.git@develop#egg=jmespath (from -r requirements.txt (line 2))","  Cloning git://github.com/boto/jmespath.git (to revision develop) to ./venv/src/jmespath","Obtaining s3transfer from git+git://github.com/boto/s3transfer.git@develop#egg=s3transfer (from -r requirements.txt (line 3))","  Cloning git://github.com/boto/s3transfer.git (to revision develop) to ./venv/src/s3transfer","Collecting nose==1.3.3","  Downloading nose-1.3.3.tar.gz (274 kB)","     |████████████████████████████████| 274 kB 648 kB/s ","Collecting mock==1.3.0","  Downloading mock-1.3.0-py2.py3-none-any.whl (56 kB)","     |████████████████████████████████| 56 kB 2.5 MB/s ","Collecting wheel==0.24.0","  Downloading wheel-0.24.0-py2.py3-none-any.whl (63 kB)","     |████████████████████████████████| 63 kB 1.7 MB/s ","Collecting docutils<0.16,>=0.10","  Downloading docutils-0.15.2-py3-none-any.whl (547 kB)","     |████████████████████████████████| 547 kB 2.0 MB/s ","Collecting python-dateutil<3.0.0,>=2.1","  Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)","     |████████████████████████████████| 227 kB 3.2 MB/s ","Collecting urllib3<1.26,>=1.20","  Downloading urllib3-1.25.10-py2.py3-none-any.whl (127 kB)","     |████████████████████████████████| 127 kB 3.3 MB/s ","Collecting six>=1.7","  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)","Collecting pbr>=0.11","  Downloading pbr-5.4.5-py2.py3-none-any.whl (110 kB)","     |████████████████████████████████| 110 kB 3.6 MB/s ","Building wheels for collected packages: nose","  Building wheel for nose (setup.py) ... done","  Created wheel for nose: filename=nose-1.3.3-py3-none-any.whl size=153083 sha256=92beb5bd88fbc4021a3b0ba80612ddc209782e1344791c771a7392a54ff8701f","  Stored in directory: /home/ec2-user/.cache/pip/wheels/0f/1e/f7/27e4abff8fcdfdf42c96b88fabbb03359acc9ec78b2d743812","Successfully built nose","Installing collected packages: jmespath, docutils, six, python-dateutil, urllib3, botocore, s3transfer, nose, pbr, mock, wheel","  Running setup.py develop for jmespath","  Running setup.py develop for botocore","  Running setup.py develop for s3transfer","  Attempting uninstall: wheel","    Found existing installation: wheel 0.35.1","    Uninstalling wheel-0.35.1:","      Successfully uninstalled wheel-0.35.1","Successfully installed botocore docutils-0.15.2 jmespath mock-1.3.0 nose-1.3.3 pbr-5.4.5 python-dateutil-2.8.1 s3transfer six-1.15.0 urllib3-1.25.10 wheel-0.24.0","(venv) admin:~/boto3/boto3 (develop) $ "],"id":45}],[{"start":{"row":0,"column":2},"end":{"row":11,"column":1},"action":"remove","lines":["This script installs Boto in Pythonista. Run this script in your root folder","# and it will download and install Boto along with its dependencies. To use","# Boto, be sure to add boto-module in your sys.path before importing boto like","# so:","#","#   import sys; sys.path.append('boto-module')","#   import boto.ec2","#","# Credits:","# This script is based on greinacker/pythonista-install-boto.py :","# https://gist.github.com/greinacker/5a61309be34490a63aa6","#"],"id":46}],[{"start":{"row":0,"column":2},"end":{"row":0,"column":44},"action":"insert","lines":["StaSh - Shell Like an Expert in Pythonista"],"id":47}],[{"start":{"row":0,"column":44},"end":{"row":1,"column":0},"action":"insert","lines":["",""],"id":48},{"start":{"row":1,"column":0},"end":{"row":1,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":1,"column":1},"end":{"row":2,"column":0},"action":"insert","lines":["",""],"id":49},{"start":{"row":2,"column":0},"end":{"row":2,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":2,"column":1},"end":{"row":2,"column":2},"action":"insert","lines":[" "],"id":50},{"start":{"row":2,"column":2},"end":{"row":2,"column":3},"action":"insert","lines":["s"]},{"start":{"row":2,"column":3},"end":{"row":2,"column":4},"action":"insert","lines":["o"]},{"start":{"row":2,"column":4},"end":{"row":2,"column":5},"action":"insert","lines":["u"]},{"start":{"row":2,"column":5},"end":{"row":2,"column":6},"action":"insert","lines":["r"]},{"start":{"row":2,"column":6},"end":{"row":2,"column":7},"action":"insert","lines":["c"]},{"start":{"row":2,"column":7},"end":{"row":2,"column":8},"action":"insert","lines":["e"]}],[{"start":{"row":2,"column":8},"end":{"row":2,"column":9},"action":"insert","lines":[":"],"id":51}],[{"start":{"row":2,"column":9},"end":{"row":2,"column":10},"action":"insert","lines":[" "],"id":52}],[{"start":{"row":2,"column":10},"end":{"row":2,"column":41},"action":"insert","lines":["https://github.com/ywangd/stash"],"id":53}],[{"start":{"row":2,"column":41},"end":{"row":3,"column":0},"action":"insert","lines":["",""],"id":54},{"start":{"row":3,"column":0},"end":{"row":3,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":3,"column":1},"end":{"row":3,"column":2},"action":"insert","lines":[" "],"id":55}],[{"start":{"row":3,"column":1},"end":{"row":3,"column":2},"action":"remove","lines":[" "],"id":56}],[{"start":{"row":3,"column":1},"end":{"row":4,"column":0},"action":"insert","lines":["",""],"id":57},{"start":{"row":4,"column":0},"end":{"row":4,"column":1},"action":"insert","lines":["#"]}],[{"start":{"row":4,"column":1},"end":{"row":4,"column":2},"action":"insert","lines":[" "],"id":58},{"start":{"row":4,"column":2},"end":{"row":4,"column":3},"action":"insert","lines":["r"]},{"start":{"row":4,"column":3},"end":{"row":4,"column":4},"action":"insert","lines":["e"]},{"start":{"row":4,"column":4},"end":{"row":4,"column":5},"action":"insert","lines":["q"]},{"start":{"row":4,"column":5},"end":{"row":4,"column":6},"action":"insert","lines":["u"]},{"start":{"row":4,"column":6},"end":{"row":4,"column":7},"action":"insert","lines":["i"]},{"start":{"row":4,"column":7},"end":{"row":4,"column":8},"action":"insert","lines":["r"]},{"start":{"row":4,"column":8},"end":{"row":4,"column":9},"action":"insert","lines":["e"]},{"start":{"row":4,"column":9},"end":{"row":4,"column":10},"action":"insert","lines":["d"]}],[{"start":{"row":4,"column":10},"end":{"row":4,"column":11},"action":"insert","lines":[" "],"id":59},{"start":{"row":4,"column":11},"end":{"row":4,"column":12},"action":"insert","lines":["t"]},{"start":{"row":4,"column":12},"end":{"row":4,"column":13},"action":"insert","lines":["o"]}],[{"start":{"row":4,"column":13},"end":{"row":4,"column":14},"action":"insert","lines":[" "],"id":60},{"start":{"row":4,"column":14},"end":{"row":4,"column":15},"action":"insert","lines":["i"]},{"start":{"row":4,"column":15},"end":{"row":4,"column":16},"action":"insert","lines":["n"]},{"start":{"row":4,"column":16},"end":{"row":4,"column":17},"action":"insert","lines":["s"]},{"start":{"row":4,"column":17},"end":{"row":4,"column":18},"action":"insert","lines":["t"]},{"start":{"row":4,"column":18},"end":{"row":4,"column":19},"action":"insert","lines":["a"]},{"start":{"row":4,"column":19},"end":{"row":4,"column":20},"action":"insert","lines":["l"]},{"start":{"row":4,"column":20},"end":{"row":4,"column":21},"action":"insert","lines":["l"]}],[{"start":{"row":4,"column":21},"end":{"row":4,"column":22},"action":"insert","lines":[" "],"id":61},{"start":{"row":4,"column":22},"end":{"row":4,"column":23},"action":"insert","lines":["b"]},{"start":{"row":4,"column":23},"end":{"row":4,"column":24},"action":"insert","lines":["o"]},{"start":{"row":4,"column":24},"end":{"row":4,"column":25},"action":"insert","lines":["t"]},{"start":{"row":4,"column":25},"end":{"row":4,"column":26},"action":"insert","lines":["o"]}],[{"start":{"row":4,"column":26},"end":{"row":4,"column":27},"action":"insert","lines":["3"],"id":62}],[{"start":{"row":4,"column":22},"end":{"row":4,"column":23},"action":"insert","lines":["t"],"id":63},{"start":{"row":4,"column":23},"end":{"row":4,"column":24},"action":"insert","lines":["h"]},{"start":{"row":4,"column":24},"end":{"row":4,"column":25},"action":"insert","lines":["e"]}],[{"start":{"row":4,"column":25},"end":{"row":4,"column":26},"action":"insert","lines":[" "],"id":64}],[{"start":{"row":4,"column":31},"end":{"row":4,"column":32},"action":"insert","lines":[" "],"id":65},{"start":{"row":4,"column":32},"end":{"row":4,"column":33},"action":"insert","lines":["l"]},{"start":{"row":4,"column":33},"end":{"row":4,"column":34},"action":"insert","lines":["i"]},{"start":{"row":4,"column":34},"end":{"row":4,"column":35},"action":"insert","lines":["b"]},{"start":{"row":4,"column":35},"end":{"row":4,"column":36},"action":"insert","lines":["r"]},{"start":{"row":4,"column":36},"end":{"row":4,"column":37},"action":"insert","lines":["a"]},{"start":{"row":4,"column":37},"end":{"row":4,"column":38},"action":"insert","lines":["r"]},{"start":{"row":4,"column":38},"end":{"row":4,"column":39},"action":"insert","lines":["y"]}],[{"start":{"row":4,"column":39},"end":{"row":5,"column":0},"action":"insert","lines":["",""],"id":66}],[{"start":{"row":5,"column":0},"end":{"row":6,"column":0},"action":"remove","lines":["",""],"id":67}],[{"start":{"row":6,"column":0},"end":{"row":113,"column":0},"action":"remove","lines":["","packages = [","    'https://pypi.python.org/packages/source/b/boto3/boto3-1.14.47.tar.gz',","    'https://pypi.python.org/packages/source/m/mock/mock-4.0.2.tar.gz',","]","","","nose==1.3.3","mock==1.3.0","wheel==0.24.0","","configparser_src = 'http://hg.python.org/cpython/raw-file/70274d53c1dd/Lib/ConfigParser.py'","","import shutil","import urllib","from urlparse import urlparse","import tarfile","import zipfile","import os","","","def create_module_dir():","    try:","        os.mkdir('boto-module')","    except:","        pass","","","def get_filename_from_url(url):","    parsed_url = urlparse(url)","    return parsed_url.path.rpartition('/')[-1]","","def is_zipfile(f):","    return f.endswith('.zip')","","def is_targzfile(f):","    return f.endswith('.tar.gz')","","def download_packages():","    for f in packages:","        print('Downloading %s' % f)","        filepath, headers = urllib.urlretrieve(f)","        print('Extracting %s' % filepath)","        filename = get_filename_from_url(f)","        if is_targzfile(filename):","            t = tarfile.open(filepath, 'r')","            t.extractall()","            t.close()","        elif is_zipfile(filename):","            z = zipfile.ZipFile(filepath, 'r')","            z.extractall()","            z.close()","","def install_configparser_src():","    print('Installing ConfigParser...')","    filepath, headers = urllib.urlretrieve(configparser_src)","    shutil.move(filepath, 'boto-module/ConfigParser.py')","","def install_packages():","    print('Installing boto...')","    shutil.move('boto-2.8.0/boto', 'boto-module/boto')","    shutil.rmtree('boto-2.8.0')","","    print('Installing mock...')","    shutil.move('mock-1.0.1/mock.py', 'boto-module/mock.py')","    shutil.rmtree('mock-1.0.1')","","    print('Installing rsa...')","    shutil.move('rsa-3.1.1/rsa', 'boto-module/rsa')","    shutil.rmtree('rsa-3.1.1')","","    print('Installing tox...')","    shutil.move('tox-1.4/tox', 'boto-module/tox')","    shutil.rmtree('tox-1.4')","","    print('Installing Sphinx...')","    shutil.move('Sphinx-1.1.3/sphinx', 'boto-module/sphinx')","    shutil.rmtree('Sphinx-1.1.3')","","    print('Installing simplejson...')","    shutil.move('simplejson-2.5.2/simplejson', 'boto-module/simplejson')","    shutil.rmtree('simplejson-2.5.2')","","    print('Installing argparse...')","    shutil.move('argparse-1.2.1/argparse.py', 'boto-module/argparse.py')","    shutil.rmtree('argparse-1.2.1')","","    print('Installing unittest2...')","    shutil.move('unittest2-0.5.1/unittest2', 'boto-module/unittest2')","    shutil.rmtree('unittest2-0.5.1')","","def reload_pythonista_editor():","    print('Reloading Pythonista editor')","    import editor","    editor.reload_files()","","","if __name__ == '__main__':","    create_module_dir()","    download_packages()","    install_packages()","    install_configparser_src()","    reload_pythonista_editor()","    print('All done!')","","","",""],"id":68}],[{"start":{"row":6,"column":0},"end":{"row":6,"column":69},"action":"insert","lines":["import requests as r; exec(r.get('https://bit.ly/get-stash').content)"],"id":69}],[{"start":{"row":6,"column":69},"end":{"row":7,"column":0},"action":"insert","lines":["",""],"id":70}]]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":7,"column":0},"end":{"row":7,"column":0},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1598330159797,"hash":"3c9864acfcd25b79e78cfb7e67cbb54fb5ca8f20"}