Comments (5)
Eh? I started doing this, but then realised that python has a 'webbrowser'
builtin module that does all the hard work for you. When you use
'BROWSER', that triggers use of this module instead... It's not
expanding an env-var. I haven't documented this anywhere yet though,
apologies for that. Is it this behaviour that you think is problematic?
Thx
A
On Saturday, November 2, 2013, Chad Dombrova wrote:
the merge_osx branch tries to solve some problems with regard to which
browser is used to open the help url, but i think ultimately the changes
are lipstick on a pig, as they say in the south (or so i'm lead to believe
by television).i think it is generally a bad idea to attempt to specify the application
that should open the file / url within the package.yaml. using an
environment variable for $BROWSER is at least somewhat portable, but,
even assuming everyone has this variable set, it still only solves the
problem for webpages.i think a better solution is to use the OS-specific command for opening a
file: e.g. open on osx, and xdg-open on linux (gnome, kde, xfce). this
behavior would occur if the help is in the form of an absolute path or url
only (i.e. no proceeding application name).—
Reply to this email directly or view it on GitHubhttps://github.com//issues/39
.
from rez.
Related to this, it might be nice to provide man support at some point too.
On Saturday, November 2, 2013, Allan Johns wrote:
Eh? I started doing this, but then realised that python has a 'webbrowser'
builtin module that does all the hard work for you. When you use
'BROWSER', that triggers use of this module instead... It's not
expanding an env-var. I haven't documented this anywhere yet though,
apologies for that. Is it this behaviour that you think is problematic?Thx
AOn Saturday, November 2, 2013, Chad Dombrova wrote:
the merge_osx branch tries to solve some problems with regard to which
browser is used to open the help url, but i think ultimately the changes
are lipstick on a pig, as they say in the south (or so i'm lead to believe
by television).i think it is generally a bad idea to attempt to specify the application
that should open the file / url within the package.yaml. using an
environment variable for $BROWSER is at least somewhat portable, but,
even assuming everyone has this variable set, it still only solves the
problem for webpages.i think a better solution is to use the OS-specific command for opening a
file: e.g. open on osx, and xdg-open on linux (gnome, kde, xfce). this
behavior would occur if the help is in the form of an absolute path or url
only (i.e. no proceeding application name).—
Reply to this email directly or view it on GitHubhttps://github.com//issues/39
.
from rez.
Hello,
I'm looking to implement the rez help
command based on the Rez 2.0 changes - I can't see it's be done anywhere so thought I'd take a stab as it's a really useful feature. My initial plan is to mimic the functionality provided by rez help
in Rez 1.0
However as part of that I remember this ticket.
Currently our help entries are nearly all of the form:
help:
- ["Documentation", "$BROWSER !ROOT!/doc/index.html"]
However from looking at the resources schema, I think the following is also supported:
help: !ROOT!/doc/index.html
- What is the best approach to handling the expansion of old-style command such as
!ROOT!
. My initial thought is to swap them out withrex
equivalents in the same way asconvert_old_commands
(so in this example we'd get{root}
) and then somehow run them through the rex interpreter to give me the proper values. - How to handle the $BROWSER value and the other comments in this ticket. I'm wondering if I explicitly strip out this token before passing to the underlying
xdg-open
(or whatever is configured for that OS). This has the advantage over using thewebbrowser
module explicitly as I can more easily open other document types - but would this handle man pages, for example?
What do you think?
Mark.
from rez.
On Mon, Jul 7, 2014 at 1:07 AM, Mark Streatfield [email protected]
wrote:
Hello,
I'm looking to implement the rez help command based on the Rez 2.0
changes - I can't see it's be done anywhere so thought I'd take a stab as
it's a really useful feature. My initial plan is to mimic the functionality
provided by rez help in Rez 1.0However as part of that I remember this ticket.
Currently our help entries are nearly all of the form:
help:
- ["Documentation", "$BROWSER !ROOT!/doc/index.html"]
However from looking at the resources schema, I think the following is
also supported:help: !ROOT!/doc/index.html
What is the best approach to handling the expansion of old-style
command such as !ROOT!. My initial thought is to swap them out with rex
equivalents in the same way as convert_old_commands (so in this
example we'd get {root}) and then somehow run them through the rex
interpreter to give me the proper values.Yup, do that. In utils.py there's an ObjectStringFormatter class that
makes this easy... just create a dict containing 'root' and 'base' (all you
need access to in rez-help imo), then instantiate ObjectStringFormatter
with this dict and format the help string.
How to handle the $BROWSER value and the other comments in this
ticket. I'm wondering if I explicitly strip out this token before passing
to the underlying xdg-open (or whatever is configured for that OS).
This has the advantage over using the webbrowser module explicitly as
I can more easily open other document types - but would this handle man
pages, for example?This was already dealt with in the code that's now in
to_delete/cli/help.py I think. BROWSER, if present, is replaced with
whatever config.browser evaluates to. If None (the default), it uses
python's builtin webbrowser module to launch the browser, this is better
than using xdg-open for example, because it's cross platform.
help.py also supports a new format, where you can just provide a url and
nothing else, in that case it assumes this is a url and again uses
webbrowser to launch it.
In summary I think to_delete/cli/help.py does things correctly, it just
needs to be ported wrt resources.
What do you think?
Mark.
—
Reply to this email directly or view it on GitHub
#39 (comment).
from rez.
Yup, do that. In utils.py there's an ObjectStringFormatter class that
makes this easy... just create a dict containing 'root' and 'base' (all you
need access to in rez-help imo), then instantiate ObjectStringFormatter
with this dict and format the help string.
*of course you need to swap !ROOT! to {root} before you do this, just to be
clear.
from rez.
Related Issues (20)
- 'use_variant_shortlinks' config entry ignore by rez-cp HOT 5
- Error caused by weakly referenced package not specifying version range
- Document plugin settings
- Add "why rez" doc page HOT 2
- REZ_USED_IMPLICIT_PACKAGES tilde expansion on windows HOT 2
- rez-bind os requires arch
- TSC Meeting 2024-04-18 HOT 4
- Alias in powershell error HOT 4
- Add future deprecation notice to rez-bind, particularly the --quickstart option (including documentation warnings)
- "process ID out of range" error when using rez-env from within a Docker container with namespaced PIDs HOT 3
- Rez auto delete rxt temp files make subprocess rez-context faild. HOT 1
- Ephemerals should be available in late binding functions HOT 1
- Add attribute in late bindings to detect when it is run under rez-test
- Feature request: "proxy" packages that support direct editing of files without rebuild HOT 3
- Shell type plugin can resolve incorrectly in rez.system on Linux. HOT 1
- rez-pkg-cache the case of pachage'name HOT 2
- TSC Meeting 2024-05-16
- Combined packages (multi packages) fail on windows
- Rez use powershell to render houdini will lost $HIP and $F HOT 8
- build_requires with @late can not run rez env -b to create build env
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rez.