• ihf

    Found the problem. The script assumes /home/user is the path.

    posted in Pythonista read more
  • ihf

    I am trying to run the sftp client <https://github.com/humberry/sftp-client.git. It gives this error when I attempt to connect.

    Traceback (most recent call last):
    File "/private/var/mobile/Containers/Shared/AppGroup/B86CEE4E-E4A9-4BB4-9CA7-6E13BDA2C2A4/Pythonista3/Documents/sftp-clien/SFTPclient.py", line 181, in bt_connect
    attr = self.sftp.listdir_attr(self.remotePath)
    File "/private/var/mobile/Containers/Shared/AppGroup/B86CEE4E-E4A9-4BB4-9CA7-6E13BDA2C2A4/Pythonista3/Documents/site-packages/paramiko/sftp_client.py", line 193, in listdir_attr
    t, msg = self._request(CMD_OPENDIR, path)
    File "/private/var/mobile/Containers/Shared/AppGroup/B86CEE4E-E4A9-4BB4-9CA7-6E13BDA2C2A4/Pythonista3/Documents/site-packages/paramiko/sftp_client.py", line 730, in _request
    return self._read_response(num)
    File "/private/var/mobile/Containers/Shared/AppGroup/B86CEE4E-E4A9-4BB4-9CA7-6E13BDA2C2A4/Pythonista3/Documents/site-packages/paramiko/sftp_client.py", line 777, in _read_response
    self._convert_status(msg)
    File "/private/var/mobile/Containers/Shared/AppGroup/B86CEE4E-E4A9-4BB4-9CA7-6E13BDA2C2A4/Pythonista3/Documents/site-packages/paramiko/sftp_client.py", line 803, in _convert_status
    raise IOError(errno.ENOENT, text)
    IOError: [Errno 2] No such file

    I've tested the server and it is working but I can't seem to connect using this client.

    posted in Pythonista read more
  • ihf

    Ok, I modified File_Picker and the script now runs except that the shortcut url that is generated results in file not found. I think the problem may be this line:

    shortcut_url = 'pythonista3://' + script + '?run'

    If I change that to:

    shortcut_url = 'pythonista3://' + script + '?action=run'

    , it seems to work. Not sure how this worked for you without that.
    Thanks for your help and a very nice script. I don’t suppose there is a way to automate the Add to Screen interaction using objc?

    posted in Pythonista read more
  • ihf

    @cvp You are quite right. I deleted that module and downloaded the file-picker module. The script runs but when I begin editing the script field in the dialog I get:

    Traceback (most recent call last):
    File "/private/var/mobile/Containers/Shared/AppGroup/B86CEE4E-E4A9-4BB4-9CA7-6E13BDA2C2A4/Pythonista3/Documents/home_screen.py", line 191, in textfield_should_begin_editing
    py_file = file_picker_dialog('Select script', multiple=False, select_dirs=False,file_pattern=r'^.*.py$',from_dialog=[c,textfield], icloud=icloud)
    TypeError: file_picker_dialog() got an unexpected keyword argument 'from_dialog'

    posted in Pythonista read more
  • ihf

    Look very useful. When I run it, I get:

    Traceback (most recent call last):
    File "/private/var/mobile/Containers/Shared/AppGroup/B86CEE4E-E4A9-4BB4-9CA7-6E13BDA2C2A4/Pythonista3/Documents/home_screen.py", line 4, in <module>
    import http.server
    File "/var/containers/Bundle/Application/C1B2B29C-77ED-496F-8E3F-47352515D93C/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/http/server.py", line 101, in <module>
    import socketserver
    File "/private/var/mobile/Containers/Shared/AppGroup/B86CEE4E-E4A9-4BB4-9CA7-6E13BDA2C2A4/Pythonista3/Documents/site-packages/socketserver/init.py", line 7, in <module>
    raise ImportError('This package should not be accessible on Python 3. '
    ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted

    posted in Pythonista read more
  • ihf

    @jonb That works. Thank you!

    posted in Pythonista read more
  • ihf

    @cvp Thanks very much. I will try to get it working with scp.

    posted in Pythonista read more
  • ihf

    I have a script which runs without error when I am using Wifi but will not run when on cellular. I am thinking that it may be a problem with ipv6 addreses (which Tmobile uses) vs. IPv4 on wifi. I can post the script but the traceback may be more informative.

    Traceback (most recent call last):
    File "/private/var/mobile/Containers/Shared/AppGroup/8B976447-D3F3-4F2C-B635-B6CF6D3BA464/Pythonista3/Documents/nw-chg.copy.py", line 16, in <module>
    today, meta_data = ts.get_daily(t)
    File "/private/var/mobile/Containers/Shared/AppGroup/8B976447-D3F3-4F2C-B635-B6CF6D3BA464/Pythonista3/Documents/site-packages/alpha_vantage/alphavantage.py", line 173, in _format_wrapper
    self, *args, **kwargs)
    File "/private/var/mobile/Containers/Shared/AppGroup/8B976447-D3F3-4F2C-B635-B6CF6D3BA464/Pythonista3/Documents/site-packages/alpha_vantage/alphavantage.py", line 158, in _call_wrapper
    return self._handle_api_call(url), data_key, meta_data_key
    File "/private/var/mobile/Containers/Shared/AppGroup/8B976447-D3F3-4F2C-B635-B6CF6D3BA464/Pythonista3/Documents/site-packages/alpha_vantage/alphavantage.py", line 74, in _retry_wrapper
    return func(self, *args, **kwargs)
    File "/private/var/mobile/Containers/Shared/AppGroup/8B976447-D3F3-4F2C-B635-B6CF6D3BA464/Pythonista3/Documents/site-packages/alpha_vantage/alphavantage.py", line 257, in _handle_api_call
    response = requests.get(url)
    File "/var/containers/Bundle/Application/BB712C81-EEE8-41D9-9A7D-279ABEFAE679/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/site-packages/requests/api.py", line 65, in get
    return request('get', url, **kwargs)
    File "/var/containers/Bundle/Application/BB712C81-EEE8-41D9-9A7D-279ABEFAE679/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/site-packages/requests/api.py", line 49, in request
    response = session.request(method=method, url=url, **kwargs)
    File "/var/containers/Bundle/Application/BB712C81-EEE8-41D9-9A7D-279ABEFAE679/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/site-packages/requests/sessions.py", line 462, in request
    resp = self.send(prep, **send_kwargs)
    File "/var/containers/Bundle/Application/BB712C81-EEE8-41D9-9A7D-279ABEFAE679/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/site-packages/requests/sessions.py", line 574, in send
    r = adapter.send(request, **kwargs)
    File "/var/containers/Bundle/Application/BB712C81-EEE8-41D9-9A7D-279ABEFAE679/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/site-packages/requests/adapters.py", line 416, in send
    raise ConnectionError(err, request=request)
    ConnectionError: ('Connection aborted.', error('getsockaddrarg: bad family',))

    posted in Pythonista read more
  • ihf

    Thanks for the replies. I have tested moving a video file to the Files app and then sharing it with a Pythonista script that does an SCP using Paramiko to a server. It all works. Of course I would rather not go through the extra step of moving the file to another application first but there doesn’t seem to be any other way to get around this. Perhaps this will be fixed in a future release

    posted in Pythonista read more
  • ihf

    Could someone please verify that .mp4 and .mov files cannot be shared using the sharing sheet (Pythonista disappears as an option when they are selected). Is there a workaround? Thanks.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!