Jump to content


Photo

Enigma2 python documentation


  • Please log in to reply
7 replies to this topic

#1 pablocool

  • Senior Member
  • 72 posts

+1
Neutral

Posted 20 August 2018 - 09:42

Hello Guys,

 

I am looking for some documentation for python in E2. Currently I am writing script to turn on/off remote server via WoL with some monitoring actions.

I get to know what functions do via reverse engineering of existing E2 python scripts. For example sth like this:

self.session.openWithCallback(self.consoleClosed,Console,text,[cmd])

Is there some kind of documentation of python in E2? How script developers know what subfunctions are available for for example self.session?

I know there is old tutorial for python in E2 but this is rather for begginers.

 

br

Paweł



Re: Enigma2 python documentation #2 Pr2

  • PLi® Contributor
  • 6,166 posts

+261
Excellent

Posted 20 August 2018 - 09:51

Hi,

 

Not sure if you will find what you are looking at but there is some documentation here:

 

https://github.com/O...ree/develop/doc

 

Pr2


NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 


Re: Enigma2 python documentation #3 pablocool

  • Senior Member
  • 72 posts

+1
Neutral

Posted 20 August 2018 - 10:20

Thank you. This is good for start, but unfortunately very limited. How do developers know what can they "import" in python script? How do they know what functions for example "os" provides? Do all really use reverse engineering and base on other scripts?



Re: Enigma2 python documentation #4 WanWizard

  • PLi® Core member
  • 70,247 posts

+1,798
Excellent

Posted 20 August 2018 - 10:21

That is all standard python, you need to be able to code in python first... 


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Enigma2 python documentation #5 pablocool

  • Senior Member
  • 72 posts

+1
Neutral

Posted 20 August 2018 - 11:30

I agree. However I am not asking for fish, just for fishing rod ;)

 

 

For example I am able to check all function in os module from python commandline:

>>> import os
>>> dir(os)
['EX_CANTCREAT', 'EX_CONFIG', 'EX_DATAERR', 'EX_IOERR', 'EX_NOHOST', 'EX_NOINPUT', 'EX_NOPERM', 'EX_NOUSER', 'EX_OK', 'EX_OSERR', 'EX_OSFILE', 'EX_PROTOCOL', 'EX_SOFTWARE', 'EX_TEMPFAIL', 'EX_UNAVAILABLE', 'EX_USAGE', 'F_OK', 'NGROUPS_MAX', 'O_APPEND', 'O_ASYNC', 'O_CREAT', 'O_DIRECT', 'O_DIRECTORY', 'O_DSYNC', 'O_EXCL', 'O_LARGEFILE', 'O_NDELAY', 'O_NOATIME', 'O_NOCTTY', 'O_NOFOLLOW', 'O_NONBLOCK', 'O_RDONLY', 'O_RDWR', 'O_RSYNC', 'O_SYNC', 'O_TRUNC', 'O_WRONLY', 'P_NOWAIT', 'P_NOWAITO', 'P_WAIT', 'R_OK', 'SEEK_CUR', 'SEEK_END', 'SEEK_SET', 'TMP_MAX', 'UserDict', 'WCONTINUED', 'WCOREDUMP', 'WEXITSTATUS', 'WIFCONTINUED', 'WIFEXITED', 'WIFSIGNALED', 'WIFSTOPPED', 'WNOHANG', 'WSTOPSIG', 'WTERMSIG', 'WUNTRACED', 'W_OK', 'X_OK', '_Environ', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '_copy_reg', '_execvpe', '_exists', '_exit', '_get_exports_list', '_make_stat_result', '_make_statvfs_result', '_pickle_stat_result', '_pickle_statvfs_result', '_spawnvef', 'abort', 'access', 'altsep', 'chdir', 'chmod', 'chown', 'chroot', 'close', 'closerange', 'confstr', 'confstr_names', 'ctermid', 'curdir', 'defpath', 'devnull', 'dup', 'dup2', 'environ', 'errno', 'error', 'execl', 'execle', 'execlp', 'execlpe', 'execv', 'execve', 'execvp', 'execvpe', 'extsep', 'fchdir', 'fchmod', 'fchown', 'fdatasync', 'fdopen', 'fork', 'forkpty', 'fpathconf', 'fstat', 'fstatvfs', 'fsync', 'ftruncate', 'getcwd', 'getcwdu', 'getegid', 'getenv', 'geteuid', 'getgid', 'getgroups', 'getloadavg', 'getlogin', 'getpgid', 'getpgrp', 'getpid', 'getppid', 'getresgid', 'getresuid', 'getsid', 'getuid', 'initgroups', 'isatty', 'kill', 'killpg', 'lchown', 'linesep', 'link', 'listdir', 'lseek', 'lstat', 'major', 'makedev', 'makedirs', 'minor', 'mkdir', 'mkfifo', 'mknod', 'name', 'nice', 'open', 'openpty', 'pardir', 'path', 'pathconf', 'pathconf_names', 'pathsep', 'pipe', 'popen', 'popen2', 'popen3', 'popen4', 'putenv', 'read', 'readlink', 'remove', 'removedirs', 'rename', 'renames', 'rmdir', 'sep', 'setegid', 'seteuid', 'setgid', 'setgroups', 'setpgid', 'setpgrp', 'setregid', 'setresgid', 'setresuid', 'setreuid', 'setsid', 'setuid', 'spawnl', 'spawnle', 'spawnlp', 'spawnlpe', 'spawnv', 'spawnve', 'spawnvp', 'spawnvpe', 'stat', 'stat_float_times', 'stat_result', 'statvfs', 'statvfs_result', 'strerror', 'symlink', 'sys', 'sysconf', 'sysconf_names', 'system', 'tcgetpgrp', 'tcsetpgrp', 'tempnam', 'times', 'tmpfile', 'tmpnam', 'ttyname', 'umask', 'uname', 'unlink', 'unsetenv', 'urandom', 'utime', 'wait', 'wait3', 'wait4', 'waitpid', 'walk', 'write']

How to perform the same for enigma modules? For example Components ?

 

I cannot import it in cli:

>>> import Components
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named Components


Re: Enigma2 python documentation #6 WanWizard

  • PLi® Core member
  • 70,247 posts

+1,798
Excellent

Posted 20 August 2018 - 12:22

Because the cli doesn't have the correct environment setup. I'm not a Python developer, so many others can share the way they develop for E2.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Enigma2 python documentation #7 mrvica

  • Senior Member
  • 1,258 posts

+86
Good

Posted 20 August 2018 - 12:53

from another board
http://www.mediafire...openATV61Doc.7z
just open index.html in a browser

Re: Enigma2 python documentation #8 pablocool

  • Senior Member
  • 72 posts

+1
Neutral

Posted 20 August 2018 - 13:29

@mrvica Thank you! That was I've been looking for. I have to learn german a bit :)




6 user(s) are reading this topic

0 members, 6 guests, 0 anonymous users