atbswp icon indicating copy to clipboard operation
atbswp copied to clipboard

Creates .pyc files - but has no documentation to explain what they are or how to use them

Open readnotify opened this issue 4 years ago • 3 comments

Checklist

  • [x] I use the latest release of atbswp
  • [x] The issue is not existing yet

Verbose log

n/a

Miscellaneous information

Operating System

Ubuntu LTS

Desktop Environment/Window Manager

default

Python version

default

Description

Records and plays back perfectly, and has an undocumented option "Compile to exe" - which writes-out a binary file with .pyc on the end of the name, however, this doesn't execute and there's no explanation for how we use it.

[cnd@uvm ~]$ chmod ugo+x clicky.pyc [cnd@uvm ~]$ ./clicky.pyc ./clicky.pyc: line 1: $'B\r\r': command not found ./clicky.pyc: line 2: $'\331p~a\203\a\343\005@s\026\003dd\001lZdd\001l\001Z\001d\002e_\002e\001\240\003d\003\241\001\001e\240\004d\004d\005\241\002\001e\240\004d\006d\a\241\002\001e\240\004d\bd': command not found ./clicky.pyc: line 3: unexpected EOF while looking for matching ``' ./clicky.pyc: line 7: syntax error: unexpected end of file

It also does not auto-play if I try this:-

[cnd@uvm ~]$ ./atbswpv0.3.0-linux clicky.pyc

Please...

a) Document what "Compile to exe" actually is/does b) Make it work so that I can save something and then run a command to play it back :-)

( I assume (b) exists, but it's not documented on the project homepage... )

readnotify avatar Oct 31 '21 10:10 readnotify

Also tried this:-

 [cnd@uvm ~]$ python3 clicky.pyc 
 RuntimeError: Bad magic number in .pyc file

readnotify avatar Oct 31 '21 10:10 readnotify

I noticed this find nothing:-

grep -r sys.arg .

so it looks like this tool does not have any way to read commandline arguments?

I guess this is now a feature-request:-

Please allow us to run this code as follows:-

  ./atbswpv0.3.0-linux  saved_capture_file

and for the code to open, automatically play that capture, and then end and exit.

Think about this: right now, there's no way to automate the mouse, without using the mouse...

This simple extra addition allows us to script mouse things from the command line.

readnotify avatar Oct 31 '21 10:10 readnotify

a) Document what "Compile to exe" actually is/does b) Make it work so that I can save something and then run a command to play it back :-)

( I assume (b) exists, but it's not documented on the project homepage... )

The .pyc is a python bytecode file, you can read more about that here. I am not against a PR to explain a bit what it is to people that might be confused. I just don't find it that much relevant to add to the project page as it's not something specific to atbswp, but to the whole Python ecosystem. I will probably never do that myself.

Also tried this:-

 [cnd@uvm ~]$ python3 clicky.pyc 
 RuntimeError: Bad magic number in .pyc file

This is actually interesting to me, can you try to decompile the file and post the content here?

uncompyle6 -o . your_filename.pyc

You might need to install uncompyle6 first

I noticed this find nothing:-

grep -r sys.arg .

so it looks like this tool does not have any way to read commandline arguments?

I guess this is now a feature-request:-

Please allow us to run this code as follows:-

  ./atbswpv0.3.0-linux  saved_capture_file

and for the code to open, automatically play that capture, and then end and exit.

Think about this: right now, there's no way to automate the mouse, without using the mouse...

This simple extra addition allows us to script mouse things from the command line.

Yes, it's a GUI-only program (for now). Playing a capture from atbswp seems like an useful addition for people that don't have Python installed on their OS. Feel free to open a new issue with that specific inquiry and I will certainly have a look when I have more time.

RMPR avatar Nov 01 '21 13:11 RMPR