mod-script-pipe

Audio software developers forum.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
batfinger
Posts: 4
Joined: Wed Mar 20, 2019 11:51 am
Operating System: OS X 10.9 Mavericks

mod-script-pipe

Post by batfinger » Fri Mar 22, 2019 4:16 am

Hello,

I'm testing the mod-script-pipe functionality re: writing an addon for blender.

With the build environment I have set up for blender on ubuntu 18 both audacity and mod-script-pipe built with no hassle.

However when running the test scripts in piped-work under python3

Code: Select all

tofile = open( toname, 'wt+' )
Always produces the error
io.UnsupportedOperation: File or stream is not seekable.
can be worked around by replacing

Code: Select all

wt+
with

Code: Select all

wt
Is there likely to be any implications doing this?

steve
Site Admin
Posts: 81378
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: mod-script-pipe

Post by steve » Fri Mar 22, 2019 9:15 am

I presume that you are referring to "pipe_test.py" ? https://github.com/audacity/audacity/bl ... pe_test.py
batfinger wrote:
Fri Mar 22, 2019 4:16 am
Is there likely to be any implications doing this?
"pipe_test.py" is only intended as a test to check that scripting is working. Does the test work with your modification?


For practical scripting, I'd recommend using "pipeclient.py" as a starting point. https://github.com/audacity/audacity/bl ... eclient.py
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81378
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: mod-script-pipe

Post by steve » Fri Mar 22, 2019 9:55 am

I think 'wt+' is a programming error. I recall that the original developer was initially having some difficulty getting the pipes to open correctly on Linux.

This works for me with Python 2.7 and Python 3.4:

Code: Select all

tofile = open( toname, 'w' )
Note also that at line 54, the line is indented with a tab character - strictly speaking, that should be replaced with spaces.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81378
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: mod-script-pipe

Post by steve » Sat Mar 23, 2019 4:43 pm

pipe_test.py has been updated. The new version is available here: https://raw.githubusercontent.com/audac ... pe_test.py
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

batfinger
Posts: 4
Joined: Wed Mar 20, 2019 11:51 am
Operating System: OS X 10.9 Mavericks

Re: mod-script-pipe

Post by batfinger » Tue Apr 02, 2019 12:09 pm

Thankyou. Will look into pipe_client.py.

steve
Site Admin
Posts: 81378
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: mod-script-pipe

Post by steve » Tue Apr 02, 2019 12:36 pm

batfinger wrote:
Tue Apr 02, 2019 12:09 pm
Thankyou. Will look into pipe_client.py.
I've just posted an example script that uses pipe_client.py: viewtopic.php?p=367052#p367052
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Gibbz
Posts: 40
Joined: Tue Jul 11, 2017 8:36 am
Operating System: Linux Debian

Re: mod-script-pipe

Post by Gibbz » Fri May 17, 2019 1:02 am

When I run pipe client on my windows 10 machine I get the error

Code: Select all

FileNotFoundError: [Errno 2] No such file or directory: '\\\\.\\pipe\\ToSrvPipe'
This comes from line 160.

Code: Select all

self._write_pipe = open(WRITE_NAME, 'w')
When I run pipe test I get the following output:

Code: Select all

pipe-test.py, running on windows
Write to  "\\.\pipe\ToSrvPipe"
Read from "\\.\pipe\FromSrvPipe"
-- Both pipes exist.  Good.
Traceback (most recent call last):
  File "./pipe.py", line 44, in <module>
    TOFILE = open(TONAME, 'w')
FileNotFoundError: [Errno 2] No such file or directory: '\\\\.\\pipe\\ToSrvPipe'
Any ideas how to fix this?

steve
Site Admin
Posts: 81378
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: mod-script-pipe

Post by steve » Fri May 17, 2019 11:42 am

You need to enable mod-script-pipe in Audacity, and then restart Audacity. See: https://manual.audacityteam.org/man/scr ... cript-pipe
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Gibbz
Posts: 40
Joined: Tue Jul 11, 2017 8:36 am
Operating System: Linux Debian

Re: mod-script-pipe

Post by Gibbz » Mon May 20, 2019 12:06 am

I already have it enabled. I'm still getting that error.

steve
Site Admin
Posts: 81378
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: mod-script-pipe

Post by steve » Mon May 20, 2019 1:44 am

The only way I can get that error is by disabling the module. Are you absolutely sure that mod-script-pipe is still enabled (AND you restarted Audacity after enabling it)?

Which version of Python are you using?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply