Re: OT: A better way to code, by Mike Bostock

2018-03-16 Thread Edward K. Ream
On Thu, Mar 15, 2018 at 11:44 PM, Matt Wilkie  wrote:

>
> I'm continually in awe of Mike Bostock's work, c.f. Data Driven Documents (
>> d3.org). ...
>>
>
> should have been https://d3js.org/
>

​Yes, d3 is cool.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


New official places to find theme-related data

2018-03-16 Thread Edward K. Ream
Recent revs have created new or renamed methods that search for data in 
various places.  All these methods are in the ssm.Paths outline. Afaik, all 
code in the StyleSheetManager now use these methods.  This is my attempt to 
herd cats.

Here are the actual methods.  At present the "theme" keyword argument is 
always None.  Eventually it will be the name of the desired theme.

def compute_icon_directories(self, theme=None):
'''
Return a list of directories that could contain theme-related icons.
All directories in this list do in fact exist.
'''
join = g.os_path_finalize_join
home = g.app.homeLeoDir
leo = join(g.app.loadDir, '..')
if theme:
table = [
join(home, 'themes', theme, 'Icons'),
join(home, 'themes', theme),
join(home, '.leo', 'themes', theme, 'Icons'),
join(home, '.leo', 'themes', theme),
#
join(leo, 'themes', theme, 'Icons'),
join(leo, 'themes', theme),
join(leo, 'themes', 'Icons'),
join(leo, 'themes'),
join(leo, 'Icons', theme),
join(leo, 'Icons')
]
else:
table = [
join(leo, 'themes', 'Icons'),
join(leo, 'themes'),
join(leo, 'Icons'),
]
return [g.os_path_normslashes(z) for z in table if g.os_path_exists(z)]

def compute_theme_directories(self, theme=None):
'''
Return a list of directories that could contain theme .leo files.
All directories in this list do in fact exist.
'''
join = g.os_path_finalize_join
home = g.app.homeLeoDir
leo = join(g.app.loadDir, '..')
if theme:
table = [
join(home, 'themes', theme),
join(home, '.leo', 'themes', theme),
# 
join(leo, 'themes', theme),
join(leo, 'themes'),
]
else:
table = [join(leo, 'themes')]
return [g.os_path_normslashes(z) for z in table if g.os_path_exists(z)]

Feel free to suggest changes to these lists.  Order matters. The first 
found directory in these lists wins.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: [via] Responses to PyDev of the week questionnaire

2018-03-16 Thread Edward K. Ream
On Fri, Mar 16, 2018 at 8:35 AM, Zoom.Quiet  wrote:

> pyflakes, by far.  Python devs are wasting their time if they don't use
> it.
> > I've studied every line of its code.  It's a work of genius.
>
> but in pyflakes README:
> ...
> If you require more options and more flexibility, you could give a
> look to Flake8 too.
>
> in fact, i try so many Lint tools for Python,
> PEP8/Flake8/Pylint/...
> not got same feeling with EKR,
> could share more, how to right usage pyflakes in develop/debug loop?
>

​pyflakes does require that you eliminate unused names.  Usually that's not
a problem, but if it is you can assert the name that might not be needed.
For example:

from leo.core.leoGlobals import g
assert g

​Other than that, I am not aware of any problems with pyflakes.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


[via] Responses to PyDev of the week questionnaire

2018-03-16 Thread Zoom.Quiet
thanx again, EKR share so many great experiences,
and sone one is need digging:

On Wed, Mar 14, 2018 at 12:16 AM, Edward K. Ream  wrote:
> Mike Driscoll sent me a questionnaire for his PyDev of the Week column.
>
...

>> Which Python libraries are your favorite (core or 3rd party)?
>
>
> pyflakes, by far.  Python devs are wasting their time if they don't use it.
> I've studied every line of its code.  It's a work of genius.
>

but in pyflakes README:
...
If you require more options and more flexibility, you could give a
look to Flake8 too.

in fact, i try so many Lint tools for Python,
PEP8/Flake8/Pylint/...
not got same feeling with EKR,
could share more, how to right usage pyflakes in develop/debug loop?



> pyflakes catches essentially all of my initial blunders.  It's so fast that
> I can configure Leo to run pyflakes whenever I save a .py file.  I configure
> Leo to raise a dialog when pyflakes detects an error ;-)
>


-- 
life is pathetic, go Pythonic! 人生苦短, Python当歌!
俺: http://zoomquiet.io
授: http://creativecommons.org/licenses/by-sa/2.5/cn/
怒: 冗余不做,日子甭过!备份不做,十恶不赦!
KM keep growing environment culture which promoting organization learning!

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: OT: A better way to code, by Mike Bostock

2018-03-16 Thread Xavier G. Domingo (xgid)
Hi Matt, thanks for sharing this! 

It seems that Bostock is a strong follower of Bret Victor, which I've found 
always quite inspiring on better ways of programming. The work at 
observablehq.com  seems strongly focused on 
intensive data manipulation and visualization, but the general idea of 
"live code" it's something I think we all should be after in some way, to 
make someday programming be a real joy for anyone. I'm on this quest also!

Xavier

On Wednesday, March 14, 2018 at 1:02:17 PM UTC-3, Matt Wilkie wrote:
>
> I'm continually in awe of Mike Bostock's work, c.f. Data Driven Documents (
> d3.org). Impressive as that is, it's his power to clearly explain data, 
> visualization and programming in cohesive bundle that transforms my 
> thinking which impresses me most. I've not yet learned to do anything 
> substantive in javascript, but reading Bostock's material has given me 
> insight into own python projects. And a thirst to do more!
>
> https://medium.com/@mbostock/a-better-way-to-code-2b1d2876a3a0
>
> Just, wow.
>
> Matt
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Please consider becoming a Leo dev, even if you aren't a programmer

2018-03-16 Thread Xavier G. Domingo (xgid)
Hi Edward, this is a great idea! I'll take your offer!

I've been trying to get into Leo's code for some time now, so this is an 
opportunity I cannot miss. But what makes it a so great idea for me is that 
I happened to find Leo when I started a personal quest, after about 30 
years of programming, to *learn to program again, from scratch!* So this is 
for me the perfect match for both goals.

I've had very few time lately, but I expect to have some more in the coming 
months, so let's try.

But let me warn you: I always like to understand why things work as they do 
and will try hard to change them for better if I can... so I may be a 
"problematic student" in a sense. ;-) Do you get the challenge?

On Wednesday, March 14, 2018 at 8:16:55 AM UTC-3, Edward K. Ream wrote:
>
> Yesterday I had an Aha. It's time to start training Leo devs 
> (developers)!  Leo's present devs are busy doing great work. We can't ask 
> them to do more.
>
> Leo's to-do list 
> 
>  
> has over 150 items. If you want one of those items, please consider adding 
> it yourself, *even if you aren't a programmer.* I'll teach you python and 
> Leo's internals.
>
> Python is easy to learn. After that, becoming acquainted with Leo's code 
> base will be easier than you might think.
>
> *Summary*
>
> If you have ever wanted to be a programmer, now is a great time ;-) I'll 
> be happy to answer *all *your questions.
>
> Training new devs will pay off handsomely (for me) in the long term.
>
> Edward
>
> P. S. From the fascinating 2018 Stack Overflow Developer Survey: 
> 
>
> "For the sixth year in a row, JavaScript is the most commonly used 
> programming language. Python has risen in the ranks, surpassing C# this 
> year, much like it surpassed PHP last year. Python has a solid claim to 
> being the fastest-growing major programming language 
> ."
>
> EKR
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: A study outline containing eric6 docs

2018-03-16 Thread Xavier G. Domingo (xgid)
Hi all, this is an old post, but there's a related question I had no time 
to ask you all until now:

I'm greatly interested in knowing what process do you folks follow to 
convert PDFs to Leo outlines? 

I've tried it in the past, but with mixed success. All hints will be of 
great help!

On Thursday, February 22, 2018 at 9:56:25 AM UTC-3, Edward K. Ream wrote:
>
> Tonight I got eric6 installed on Ubuntu and wrote a do-nothing plugin for 
> it.
>
> The attached .leo file contains is a rendering of this .pdf file 
> . 
> It's a lot easier for me to see what is going on in a Leo outline, though 
> some of the figures are missing.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.