Package: propyte
propyteintroductionThis is a template Python program and utilities associated.setupsudopipinstallpropyteSet upFestival,eSpeak, Pico TTS anddeep_throatfor speech
capabilities.sudoaptinstall\festival\espeak\libttspico0\libttspico-utils\libttspico-datasudopipinstalldeep_throatSet up Telegram and Telegram messenger CLI for Telegram messaging
capabilities.sudosu-aptinstall\libreadline-dev\libconfig-dev\libssl-dev\lua5.2\liblua5.2-dev\libevent-dev\libjansson-dev\libpython-dev\makecd/usr/sharegitclone--recursivehttps://github.com/vysheng/tg.gitcdtg./configuremakecd..chmod-R755tg/Set up Pylint and Graphviz for UML representationssudoaptinstallgraphvizlibgraphviz-devpython-devsudopipinstallpylintpygraphvizsetup LXPLUS with Pushbullet messagingSet up a Pushbullet account, create an access token and store a
Pushbullet token in the file~/.pushbullet. Install Pushbullet on a
mobile device.Pushbullet
settingsPushbullet
AndroidMiniconda2 is used as an environment. By default, Miniconda is installed
at~/miniconda2and the Miniconda2 install path is prepended to PATH
in~/.bashrc.wgethttps://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.shchmod755Miniconda2-latest-Linux-x86_64.sh./Miniconda2-latest-Linux-x86_64.shexportPATH=""${HOME}"/miniconda2/bin:$PATH"pipinstallpropytepropyte_alert.py--text="hello world"propyte_loop_alert_on_new_users.pyThis script loop monitors for new user connections (usingpsutil.users()) and sends an alert (using Pushbullet) is any are
detected.smuggleWeb modules can be imported using the functionsmuggle. Use this
functionality with due regard to security.shijian_test=propyte.smuggle(URL="https://raw.githubusercontent.com/wdbm/shijian/master/shijian.py")sys_test=propyte.smuggle(module_name="sys")import_ganzfeld, silenceThe context manager functionimport_ganzfeldcan be used to import a
module such that the module is isolated from command line options and
arguments. This can be useful for ROOT.withpropyte.import_ganzfeld():fromROOTimport*The context manager functionsilencecan be used to silence some
code.user interactionsThere are various functions useful for user interactions:get_keystroke,get_y_or_n,get_input,get_input_time_limited,pauseandinterrogate.commandsThe functionengage_commandis available for running Bash commands
in the foreground or in the background using subprocess.speechThe functionsayis available for generating speech using a number
of different speech programs, including Festival, eSpeak, Pico TTS and
deep_throat.notificationsTelegramThis module provides Telegram messaging capabilities. It can send and
receive Telegram messages. It does this using Telegram, Telegram CLI and
pytg.In order to use Telegram functionality, ensure that both Telegram and
Telegram CLI are running. The functionstart_messaging_Telegramattempts to launch Telegram CLI if it does not detect it running./usr/share/tg/bin/telegram-cli\-R\-W\-P4458\-k/usr/share/tg/tg-server.pub\--json\--permanent-peer-ids\--permanent-peer-ids\--disable-output\--daemonizeMessages can be sent in a way like the following:importpropytepropyte.start_messaging_Telegram()propyte.send_message_Telegram(recipient="@wbreadenmadden",text="hi")Messages receiving can be engaged in the following way:importpropytepropyte.start_messaging_Telegram()propyte.start_receiving_messages_Telegram()Messages received can be accessed in a number of ways using various
function arguments.propyte.get_messages_received_Telegram()propyte.get_last_message_received_Telegram()propyte.get_text_last_message_received_Telegram()PushbulletMessages can be sent in ways like the following:importpropytepropyte.start_messaging_Pushbullet()propyte.send_message_Pushbullet(recipient="alice@neutronmail.ch",title="alert",text="This is an alert.")propyte.send_message_Pushbullet(recipients=["alice@neutronmail.ch"],title="alert",text="This is an alert.")propyte.send_message_Pushbullet(recipient="alice@neutronmail.ch",title="price alert",filepath="prices.png")propyte_loop_alert_on_new_users.pyThis script sends Pushbullet alerts on detection of new users or users
changes.UMLUML diagrams of a Python project can be generated using Pylint and
Graphviz. This can be done by executing the Bash scriptUML.shin
the working directory of the project. This executes the following
commands:project_name="${PWD##*/}"pyreverse-my-A-opng-p${project_name}**.pyThis should generate two images,classes_propyte.pngandpackages_propyte.png. The classes image is a representation of the
classes of the project, their respective data attributes (with types),
their respective methods and their inheritances. The packages image is a
representation of the module dependencies of the project.