From 891e3c62280e82ef86361bbb0358f614961cb387 Mon Sep 17 00:00:00 2001
From: GChristensen settings page allows to specify any
Python code needed to initialize Enso. By using it, you may override variables from config.py or provide
values required by some commands. You can access variables declared at this block in your own commands through
- the 'config' module. For example, you can obtain the following variable:
+ the 'config' module. For example, you can obtain
MY_VARIABLE
defined at the configuration block:
MY_VARIABLE = "my value"
with the following code in your command:
+in the following way at your command code:
from enso import config
my_value = config.MY_VARIABLE
Python's standard import
statement can be used from command
- scripts, of course. But the disadvantage of doing this with evolving
- code is that imported modules won't be reloaded
- if their contents change.
- It is possible to install or uninstall Python libraries from PyPi
+
It is possible to install or uninstall Python libraries from PyPi
using 'enso install' and 'enso uninstall' commands respectively.
If you need to import some code that is not installable as a Python module,
- place it under the 'lib' folder at your Enso configuration directory (available at the Enso settings page).
import
statement can be used from command
+ scripts. But the disadvantage of doing this with evolving
+ code is that imported modules won't be reloaded
+ if their contents change.
Mediaprobes allow to create commands that automatically pass items found in filesystem (or listed @@ -235,12 +236,12 @@
what_to_watch = {"formula 1": "<a link to my favorite formula 1 stream>", "formula e": "<a link to my favorite formula e stream>"} cmd_watch = mediaprobe.dictionary_probe("stream", what_to_watch, "<absolute path to my network player>")-
If player does not accept directories (as, for example, ACD See does), it is possible to pass a first file in the directory specified at - a dictionary:
+If player does not accept directories (as, for example, ACD See does), use mediaprobe.findfirst_probe
to pass a first file in a directory (one of the specified at
+ a dictionary):
what_to_stare_at = {'nature': 'd:/images/nature',
'cosmos': 'd:/images/cosmos'}
diff --git a/enso/scripts/run_enso.py b/enso/scripts/run_enso.py
index 5325df90..f5fb3f0c 100644
--- a/enso/scripts/run_enso.py
+++ b/enso/scripts/run_enso.py
@@ -171,14 +171,25 @@ def main(argv = None):
print("Showing console")
logging.basicConfig( level = loglevel )
else:
- print("Hiding console")
user_log = os.path.join(config.ENSO_USER_DIR, "enso.log")
- print("Logging into '%s'" % user_log)
- sys.stdout = open(user_log, "w") #NullDevice()
- sys.stderr = open(user_log, "w") #NullDevice()
- logging.basicConfig(
- filename = user_log,
- level = loglevel )
+ print("Redirection output to: " + user_log)
+
+ logging.basicConfig(filename=user_log, level=loglevel)
+ user_log_file = open(user_log, "wb", 0)
+
+ class log():
+ def __init__(self):
+ self.file = user_log_file
+
+ def write(self, what):
+ self.file.write(what.encode())
+ self.file.flush()
+
+ def __getattr__(self, attr):
+ return getattr(self.file, attr)
+
+ sys.stdout = log()
+ sys.stderr = log()
if loglevel == logging.DEBUG:
print(opts)
@@ -207,7 +218,7 @@ def main(argv = None):
load_rc_config(default_enso_rc)
# legacy ensorc, currently undocumented
- load_rc_config(os.path.expanduser("~/.ensorc"))
+ load_rc_config(os.path.join(config.HOME_DIR, ".ensorc"))
if opts.show_tray_icon:
# Execute tray-icon code in a separate thread
diff --git a/platform/win32/Graphics/cairo/SConscript b/platform/win32/Graphics/cairo/SConscript
index 76020843..368c660d 100644
--- a/platform/win32/Graphics/cairo/SConscript
+++ b/platform/win32/Graphics/cairo/SConscript
@@ -41,13 +41,3 @@ Import( "env" )
# ----------------------------------------------------------------------------
env = env.Copy()
-
-#from subprocess import call
-#call("sh build.sh")
-
-#bld = Builder(action = "sh build.sh", chdir=1)
-#env.Append(BUILDERS = {'BuildCairo' : bld})
-#env.BuildCairo(env.makeRootRelativePath( "done"), None)
-
-#cairo = env.Command(env.makeRootRelativePath( "cairo/src/release/cairo.dll"), None, "sh build.sh")
-#AlwaysBuild(cairo)
\ No newline at end of file
diff --git a/readme.md b/readme.md
index 8c395fe3..4b592461 100644
--- a/readme.md
+++ b/readme.md
@@ -79,8 +79,10 @@ Of course, you may construct dictionaries in various ways.
#### Change log
[full changelog](changelog.md)
-##### 11.10.2019 (v.0.4.6)
-* Fixed command editor undo history.
+##### xx.10.2019 (v.0.5.0)
+* Migrated to Python 3.8
+* Updated Cairo graphics library to the recent version (1.16.0)
+* Dropped support of "~/.ensocommands" file
#### Contributors