Git Product home page Git Product logo

Comments (8)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
(forgot) Import statement documentation: http://docs.python.org/ref/import.html

Original comment by [email protected] on 17 Nov 2006 at 1:02

from pyscripter.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024

Original comment by pyscripter on 20 Nov 2006 at 5:29

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from pyscripter.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Implemented (not exactly as described) in 1.7.2.5.  Imported names using the 
"from
import" syntax appear as children of the imported module.

Original comment by pyscripter on 20 Nov 2006 at 9:24

  • Changed state: Fixed

from pyscripter.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Downloaded version 1.7.2.5. Import statement working nice. 
Would like to suggest some more “beautifications”.
Changing the icon for partially imported modules (from <X> import <y>) to show 
in the
tree that it was partially imported. For example by using a white “thingy” 
instead of
pink in the briefcase. Also the tooltip for partially imported modules should
probably read “Imported *from* module <X> at line(s) <N>”.

Is it possible to make a distinction between the partially imported 
“things”? Right
now everything is just  “name”. Could it be distinguished between 
“class”, “function”
and “method”? And if so, add an appropriate icon to each.

Right now two imports:
from math import log10
<some lines>
from math import sqrt
will produce two “math” branches in tree, each with one leaf. Could they be 
collapsed
into one “math” branch with two leafs. The “math” line will then say 
“partially at
lines 1 and 5”, and each leaf “method from module “math” at line 1” 
and “method from
module “math” at line 5”
A third import
from math import log as ln
would make for math branch: “partially at lines 1, 5 and 10”
and for the new leaf: “method “log” from module “math”

Also you might have noticed that I prefer short tooltips. :-) Long version 
would be:
“imported from module “math” at lines 1, 5 and 10”
“imported method “log10” from module “math” at line 1”
“imported method “sqrt” from module “math” at line 1”
“imported method “log” as “ln” from module “math” at line 1”
(As an ultimate :-) customisation option, two versions of tooltips can be 
offered, or
even user definable ones, with PyScripted provided variables, like:
“module $[ModuleName] imported at line $[ModuleImportLine]”
“imported $[ImportedType] $[ImportedName] from module $[ModuleName] at line
$[ModuleImportLine]”)

Original comment by [email protected] on 22 Nov 2006 at 10:02

from pyscripter.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Thanks for the feedback!

a) Different icons for full and partial imports
Partially imported modules (from import) have child nodes in the code explorer. 
Is it
not this sufficient visual differentiation?  I will change the icon for further
differentiation when I have some time, particularly for differentiating
import math
from
from import *
which currently also has no children.  Currently this is only differentiated by 
the hint.

b)Distinguishing the type of imported names
Currently this information is not available in the code explorer.  The code 
explorer
is updated at every change in the editing window by scanning the source code 
and it
would slow things down if PyScripter had to trace the type of every imported 
name. 
Such tracing happens only when in code hints and in "Find definition" 
functionality
(e.g. ctrl+clicking on identifiers).

c) Consolidating imports
A main purpose of the Code Explorer is code navigation.  (Have you noticed it
supports incremental search?).  By double clicking on a node you jump at the
corresponding position in the source code.  This is why when the same import
statement appears twice in the source code it also appears twice in the code
explorer.  I thought that the same should apply for partial imports.  Otherwise 
if
you consolidate the import statements you could not jump to the code by 
clicking on
the consolidated node.  Instead you would have to expand the node and click on 
the
name. What do you think?

d)  Shortening the hints
I will pass on this for now as I do not see cutting a couple of words from the 
hint
as that important and providing for customization seems like an overkill.

Original comment by pyscripter on 22 Nov 2006 at 11:08

  • Changed state: Accepted

from pyscripter.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Reopened for dealing with point a) of the previous comment.

Original comment by pyscripter on 22 Nov 2006 at 11:26

  • Changed state: Reopened

from pyscripter.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Fixed (different icons for full and partial imports).  The fix will be 
available in
the next minor upgrade.

Original comment by pyscripter on 22 Nov 2006 at 11:42

  • Changed state: Fixed

from pyscripter.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
> d)  Shortening the hints
> I will pass on this for now as I do not see cutting a couple of words from 
the hint
> as that important and providing for customization seems like an overkill.
I agree that this is an overkill. It was just a crazy idea :-] Just have a look 
at
the long versions when you will get back to it, I think the one proposed (and I
insists that it is only a suggestion) are more consistent than the current ones.
Since the there is currently no distinction between class/method/function, how 
about
changing the word “name” to slightly better adapted in the context 
“identifier”.
(resulting in something like “imported identifier “log” as “ln” from 
module “math” at
line 1”)

> Otherwise if you consolidate the import statements you could not jump to the 
code
by clicking on the consolidated node. Instead you would have to expand the node 
and
click on the name. What do you think?
I agree with you, it should work this way. The doubleclick on the node will 
jump to
the first occurrence on the import, while leafs brings to the individual 
methods.
This may help the programmer to reorganise the code if he imported things in
different parts, while still saving some space in the resource tree.
And you are right, I have not noticed the incremental search. Perhaps you 
should show
it somehow once you stat typing. May be by appending the typed search 
characters to
the window title? Also The delay before it resets is a bit short (But this is 
just
me. I would start to type some character, look where it brings me and then want 
to
type some more to narrow the search, but too late :-) )

> The code explorer is updated at every change in the editing window by 
scanning the
source code
Yes I noticed that.
> and it would slow things down if PyScripter had to trace the type of every 
imported
name. 
By all means.
> Such tracing happens only when in code hints and in "Find definition" 
functionality
(e.g. ctrl+clicking on identifiers).
How about some “lazy” tracing: keep names for the ones the user clicked in 
the editor
window and have a “forced” lookup on ctrl+clicking in code explorer. You 
may allow to
save this information in the ini file when restoring opened files. (or in future
project files)
Of course the there will be a need to distinguish the icon between 
“lookedup” and
“non-lookedup” identifiers. It can be done by using a discoloured “boxy 
thingy” for
latter, and appropriate icons (as used now for the edited code) for the others.

> Fixed (different icons for full and partial imports).  The fix will be 
available in
the next minor upgrade.
Thank you for this update. You are right, it was really for eye candy. Perhaps I
should have stressed it more in my previous post. Hope I did not took you too 
much
time to do.



Original comment by [email protected] on 23 Nov 2006 at 2:05

from pyscripter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.