diff --git a/enso/commands/dd_wrt.py b/enso/commands/dd_wrt.py index 8b0ecada..9118fda3 100644 --- a/enso/commands/dd_wrt.py +++ b/enso/commands/dd_wrt.py @@ -64,3 +64,16 @@ def cmd_wan_reconnect(ensoapi): tn.write(b"killall -HUP pppd\n") tn.write(b"exit\n") tn.read_all() + + +def cmd_restart_router(ensoapi): + """Reboot dd-wrt""" + tn = Telnet(HOST, 23) + tn.read_until(b"login: ") + tn.write(USER + b"\n") + tn.read_until(b"Password: ") + tn.write(PASSWORD + b"\n") + + tn.write(b"reboot\n") + tn.write(b"exit\n") + tn.read_all() \ No newline at end of file diff --git a/enso/debug.bat b/enso/debug.bat index 9dff9911..356a32e6 100644 --- a/enso/debug.bat +++ b/enso/debug.bat @@ -1,3 +1,3 @@ set PYTHONPATH=%~dp0 -.\python\python .\scripts\run_enso.py %* \ No newline at end of file +.\python\python .\scripts\run_enso.py %* --debug \ No newline at end of file diff --git a/enso/enso/config.py b/enso/enso/config.py index 47942d2a..590c1fa2 100644 --- a/enso/enso/config.py +++ b/enso/enso/config.py @@ -20,6 +20,8 @@ # Web UI can be disabled as a security option ENABLE_WEB_UI = True +# Enable CSRF protection +ENABLE_WEB_UI_CSRF = False # Whether the Quasimode is actually modal ("sticky"). IS_QUASIMODE_MODAL = True @@ -48,9 +50,12 @@ # auto-completion mechanism engages. QUASIMODE_MIN_AUTOCOMPLETE_CHARS = 1 -# Enso color theme +# Enso color themes COLOR_THEME = "green" +# Enso display font +UI_FONT = "Arial" + # List of default platforms supported by Enso; platforms are specific # types of providers that provide a suite of platform-specific # functionality. @@ -75,6 +80,12 @@ # If set to False, no locale is forced.dddasdfasdf PLUGIN_GOOGLE_USE_DEFAULT_LOCALE = True +RETREAT_DISABLE = False + +RETREAT_SHOW_ICON = True + +DEBUG = False + import os ENSO_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) @@ -100,10 +111,6 @@ CONFIG_FILE = os.path.join(ENSO_USER_DIR, "enso.cfg") -RETREAT_DISABLE = False - -RETREAT_SHOW_ICON = True - DISABLED_COMMANDS = [] COMMAND_STATE_CHANGED = False diff --git a/enso/enso/graphics/font.py b/enso/enso/graphics/font.py index 2c73f6ec..639a6846 100644 --- a/enso/enso/graphics/font.py +++ b/enso/enso/graphics/font.py @@ -130,24 +130,11 @@ def loadInto( self, cairoContext ): """ Sets the cairo context's current font to this font. """ - - - # TODO THE WINDOWS SPECIAL CASE WITH THE HARD-CODED PATH TO ARIAL - # IS A HORRIBLE HACK AND MUST BE FIXED ASAP (besides, Arial is - # ugly). - import sys - if sys.platform.startswith( "win" ): - cairoContext.select_font_face( - "c:/WINDOWS/Fonts/arial.ttf", - self.slant, - cairo.FONT_WEIGHT_NORMAL - ) - else: - cairoContext.select_font_face( - self.name, - self.slant, - cairo.FONT_WEIGHT_NORMAL - ) + cairoContext.select_font_face( + self.name, + self.slant, + cairo.FONT_WEIGHT_NORMAL + ) cairoContext.set_font_size( self.size ) diff --git a/enso/enso/messages/primarywindow.py b/enso/enso/messages/primarywindow.py index 60a3b432..e24c2d28 100644 --- a/enso/enso/messages/primarywindow.py +++ b/enso/enso/messages/primarywindow.py @@ -42,6 +42,7 @@ import logging +from enso import config from enso import graphics from enso.graphics import xmltextlayout from enso.graphics.measurement import inchesToPoints @@ -430,7 +431,7 @@ def __onAnimationFinished( self ): "document", margin_top = "0.0pt", margin_bottom = "0.0pt", - font_family = "Gentium", + font_family = config.UI_FONT, font_style = "normal", max_lines = "0", ellipsify = "false", diff --git a/enso/enso/quasimode/__init__.py b/enso/enso/quasimode/__init__.py index ab960844..07b7cbbb 100644 --- a/enso/enso/quasimode/__init__.py +++ b/enso/enso/quasimode/__init__.py @@ -454,11 +454,14 @@ def __commandSuggestionCaption( self, userText ): def __canEnterQuasimode(self): result = True - if self.__contextUtils: - if config.QUASIMODE_BYPASS_TO_RDP: - foregroundClass = self.__contextUtils.getForegroundClassNameUnicode() - - if foregroundClass == "TscShellContainerClass": - result = False + try: + if self.__contextUtils: + if config.QUASIMODE_BYPASS_TO_RDP: + foregroundClass = self.__contextUtils.getForegroundClassNameUnicode() + + if foregroundClass == "TscShellContainerClass": + result = False + except: + pass return result diff --git a/enso/enso/quasimode/layout.py b/enso/enso/quasimode/layout.py index 7cabac5d..737a7a81 100644 --- a/enso/enso/quasimode/layout.py +++ b/enso/enso/quasimode/layout.py @@ -40,6 +40,7 @@ # Imports # ---------------------------------------------------------------------------- +from enso import config from enso import graphics from enso.graphics import xmltextlayout from enso.utils.xml_tools import escape_xml @@ -126,7 +127,7 @@ def _newLineStyleRegistry(): styles = xmltextlayout.StyleRegistry() styles.add( "document", - font_family = "Gentium", + font_family = config.UI_FONT, font_style = "normal", max_lines = "1", ) diff --git a/enso/enso/strings.py b/enso/enso/strings.py index 3f9fefa5..e1548d72 100644 --- a/enso/enso/strings.py +++ b/enso/enso/strings.py @@ -1,5 +1,5 @@ # Enso version for use in UI -ENSO_VERSION = "1.1" +ENSO_VERSION = "1.1.1" # The message displayed when the user types some text that is not a command. BAD_COMMAND_MSG = "
Closing Enso...
Closing
The
Messages displayed with ensoapi.display_message() can contain only one line.
+ If you need to display more than one line in your message, use the
displayMessage
function:
+ from enso.messages import displayMessage
+
+ MESSAGE_TEXT_XML = "<p><command>Colored text</command> white text.</p>" \
+ "<p>Another line entirely in white.</p>" \
+ "<caption>Small right-aligned caption</caption>"
+
+ displayMessage(MESSAGE_TEXT_XML)
+
+ Some commands may need to do processing while not being executed; for
instance, an open
command that allows the user to open an
@@ -216,7 +232,8 @@
import
statement can be used from command
scripts. But the disadvantage of doing this with evolving
diff --git a/enso/scripts/run_enso.py b/enso/scripts/run_enso.py
index 47291e37..cf00f537 100644
--- a/enso/scripts/run_enso.py
+++ b/enso/scripts/run_enso.py
@@ -143,6 +143,8 @@ def process_options(argv):
default=True, help="Hide tray icon")
parser.add_option("-q", "--quiet", action="store_true", dest="quiet", default=False,
help="No information windows are shown on startup/shutdown")
+ parser.add_option("-d", "--debug", action="store_true", dest="debug", default=False,
+ help="Debug mode")
opts, args = parser.parse_args(argv)
return opts, args
@@ -198,17 +200,18 @@ def configure_logging(args, opts):
'DEBUG': logging.DEBUG
}[opts.loglevel]
+ user_log = os.path.join(config.ENSO_USER_DIR, "enso.log")
+
if opts.show_console:
print("Logging to console")
logging.basicConfig(level=loglevel, force=True)
else:
- user_log = os.path.join(config.ENSO_USER_DIR, "enso.log")
print("Redirecting log output to: " + user_log)
logging.basicConfig(filename=user_log, level=loglevel, force=True)
logging.debug("test")
- if opts.redirect_stdout:
+ if not opts.debug or opts.redirect_stdout:
print("Redirecting stdout output to: " + user_log)
user_log_file = open(user_log + ".stdout", "wb", 0)
@@ -230,6 +233,7 @@ def __getattr__(self, attr):
def main(argv = None):
opts, args = process_options(argv)
config.ENSO_IS_QUIET = opts.quiet
+ config.DEBUG = opts.debug
configure_logging(args, opts)
diff --git a/index.html b/index.html
index 9cb7ff90..791f3bb9 100644
--- a/index.html
+++ b/index.html
@@ -101,8 +101,5 @@