Bearsampp 2026.3.26
API documentation
Loading...
Searching...
No Matches
class.tpl.app.python.php
Go to the documentation of this file.
1<?php
2/*
3 *
4 * * Copyright (c) 2021-2024 Bearsampp
5 * * License: GNU General Public License version 3 or later; see LICENSE.txt
6 * * Website: https://bearsampp.com
7 * * Github: https://github.com/Bearsampp
8 *
9 */
10
19{
20 // Constant for the Python menu identifier
21 const MENU = 'python';
22
30 public static function process()
31 {
32 global $bearsamppLang;
33
34 return TplApp::getMenu($bearsamppLang->getValue(Lang::PYTHON), self::MENU, get_called_class());
35 }
36
45 public static function getMenuPython()
46 {
47 global $bearsamppLang, $bearsamppTools;
48
49 // Generate menu item for Python console
50 $resultItems = TplAestan::getItemPowerShell(
53 null,
54 $bearsamppTools->getPowerShell()->getTabTitlePython(),
55 $bearsamppTools->getPython()->getSymlinkPath(),
56 null
57 ) . PHP_EOL;
58
59 // Generate menu item for Python IDLE
60 $resultItems .= TplAestan::getItemExe(
61 $bearsamppLang->getValue(Lang::PYTHON) . ' IDLE',
62 $bearsamppTools->getPython()->getIdleExe(),
64 ) . PHP_EOL;
65
66 return $resultItems;
67 }
68}
global $bearsamppLang
const PYTHON_CONSOLE
const PYTHON
static getItemPowerShell($caption, $glyph, $id=null, $title=null, $initDir=null, $command=null)
static getItemExe($caption, $exe, $glyph, $params=null)
static getMenu($caption, $menu, $class)