Sourish Basu | 2 Mar 2010 09:43
Picon

Re: Adding to the list of python keywords


On Freitag, 26. Februar 2010, detlev wrote:
On Freitag, 26. Februar 2010, Phil Thompson wrote:
On Fri, 26 Feb 2010 18:28:24 +0100, detlev <detlev-QHuqpxUmdFwc/4THH4D2QrNAH6kLmebB@public.gmane.org> wrote:
On Freitag, 26. Februar 2010, Sourish Basu wrote:
Hi All, Is it possible to the list of python keywords that Eric4 highlights (such as 'def', 'if', 'else', and so on)? For example, I would like to get Eric4 to color 'self', 'True' and 'False' with the same color as, for example, 'def' or 'None'. Is it possible to do that? I used to be able to do that when I used Komodo Edit, but then I quite using Komodo Edit for other reasons.
As far as I know that is not supported by QScintilla.
Just sub-class QsciLexerPython and reimplement keywords(). Phil
Thanks for the hint. I'll add it to the wish list.
This feature has been implemented and will be part of the next eric5 snapshot.
Any idea when this will make it to the Debian/Ubuntu repo's? I installed eric4 from there, and would prefer to update it from the repo.

Also, when you say that the feature has been implemented, do you mean that 'self', 'True' and 'False' now have highlighted colors, or do you mean that there is a new feature enabling users to choose their own keywords?

-Sourish

_______________________________________________
Eric mailing list
Eric@...
http://www.riverbankcomputing.com/mailman/listinfo/eric
drizt | 2 Mar 2010 10:51
Picon

Bug of Eric5

--------------------------------------------------------------------------------
2010-03-02, 17:20:07
--------------------------------------------------------------------------------
<class 'ValueError'>: 
Can only set default encoding to utf-8
--------------------------------------------------------------------------------
  File "C:\Python31\Lib\site-packages\eric5\eric5.py", line 253, in
<module>
    main()
  File "C:\Python31\Lib\site-packages\eric5\eric5.py", line 212, in main
    sys.setappdefaultencoding(Preferences.getSystem("StringEncoding"))

--------------------------------------------------------------------------------
Version Numbers:
  Python 3.1.1
  Qt 4.6.1
  PyQt4 4.7
  sip 4.10
  QScintilla 2.4.2
  eric5 5.0-snapshot-20100206 (r107)

Platform: win32
3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit (Intel)]

After modified the eric5\Preference\__init__.py file, i can now run
eric5, but i am not sure if it is ok.

from 

    # defaults for system settings
    if isWindowsPlatform():
        sysDefaults = {
            "StringEncoding" : "cp1251",
            "IOEncoding"     : "cp1251",
        }
    else:
        sysDefaults = {
            "StringEncoding" : "utf-8",
            "IOEncoding"     : "utf-8",
        }

to
    # defaults for system settings
    if isWindowsPlatform():
        sysDefaults = {
            "StringEncoding" : "utf-8",
            "IOEncoding"     : "utf-8",
        }
    else:
        sysDefaults = {
            "StringEncoding" : "utf-8",
            "IOEncoding"     : "utf-8",
        }

					Regards,
					drizt.ruan
Niklas (br | 2 Mar 2010 11:12
Picon
Favicon

Re: Bug of Eric5

2010/3/2 drizt <drizt.ruan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
--------------------------------------------------------------------------------
2010-03-02, 17:20:07
--------------------------------------------------------------------------------
<class 'ValueError'>:
Can only set default encoding to utf-8
--------------------------------------------------------------------------------
 File "C:\Python31\Lib\site-packages\eric5\eric5.py", line 253, in
<module>
   main()
 File "C:\Python31\Lib\site-packages\eric5\eric5.py", line 212, in main
   sys.setappdefaultencoding(Preferences.getSystem("StringEncoding"))

--------------------------------------------------------------------------------
Version Numbers:
 Python 3.1.1
 Qt 4.6.1
 PyQt4 4.7
 sip 4.10
 QScintilla 2.4.2
 eric5 5.0-snapshot-20100206 (r107)

Platform: win32
3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit (Intel)]



After modified the eric5\Preference\__init__.py file, i can now run
eric5, but i am not sure if it is ok.

from

   # defaults for system settings
   if isWindowsPlatform():
       sysDefaults = {
           "StringEncoding" : "cp1251",
           "IOEncoding"     : "cp1251",
       }
   else:
       sysDefaults = {
           "StringEncoding" : "utf-8",
           "IOEncoding"     : "utf-8",
       }

to
   # defaults for system settings
   if isWindowsPlatform():
       sysDefaults = {
           "StringEncoding" : "utf-8",
           "IOEncoding"     : "utf-8",
       }
   else:
       sysDefaults = {
           "StringEncoding" : "utf-8",
           "IOEncoding"     : "utf-8",
       }



                                       Regards,
                                       drizt.ruan


_______________________________________________
Eric mailing list
Eric-FciSllQnLMw/WjLwX0R+kDKzEDxYleXD@public.gmane.org
http://www.riverbankcomputing.com/mailman/listinfo/eric
I always use utf-8. What utf-8 can't cp1251 can I can understand is an argument. Anything?
dragonflybsd.org/niklas
_______________________________________________
Eric mailing list
Eric@...
http://www.riverbankcomputing.com/mailman/listinfo/eric
drizt | 2 Mar 2010 11:17
Picon

Re: Bug of Eric5

On Tue, 2010-03-02 at 10:12 +0000, Niklas (br) wrote:
> sys.setappdefaultencoding

The problem is that "sys.setappdefaultencoding" can only be set to utf-8
in my computer,  but Eric5 is set to cp1251 when running on windows.
Patrick Sauer | 2 Mar 2010 19:07
Picon
Favicon

Re: eric4 won't launch

Hi,

After successfully installing Qt and building PyQt under Windows XP, I can't get Eric4 to run. Strangely, I don't receive any errors when entering "eric4" at the command prompt, i.e.

>> eric4

>>

it seems as if the program executes, but no window opens.

What am I doing wrong? Any help would be much appreciated.

Kind regards,

Patrick

Hotmail: Trusted email with powerful SPAM protection. Sign up now.
_______________________________________________
Eric mailing list
Eric@...
http://www.riverbankcomputing.com/mailman/listinfo/eric
Patrick Sauer | 3 Mar 2010 15:10
Picon
Favicon

Re: eric4 won't launch

Thanks for the reply! Unfortunately, no *.log file was generated in the _eric4 directory - a bug?. I tracked down the error manually by explicitly running "python eric4.py" from the command line.
It turned out the Qsci dll import failed. Inspection of the PATH variable revealed a superfluous semi-colon, which prevented the /Qt/bin directory from being added properly...

Kind regards,

Patrick

> Subject: Re: [Eric] eric4 won't launch
> From: drizt.ruan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> To: jazzcat81-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org
> Date: Wed, 3 Mar 2010 10:57:18 +0800
>
> Please check your log file in X:\Documents and Settings\user\_eric4,
> file name is something like eric4_error.log.
>
> On Tue, 2010-03-02 at 19:07 +0100, Patrick Sauer wrote:
> > Hi,
> >
> > After successfully installing Qt and building PyQt under Windows XP, I
> > can't get Eric4 to run. Strangely, I don't receive any errors when
> > entering "eric4" at the command prompt, i.e.
> >
> > >> eric4
> >
> > >>
> >
> > it seems as if the program executes, but no window opens.
> >
> > What am I doing wrong? Any help would be much appreciated.
> >
> > Kind regards,
> >
> > Patrick
> >
> >
> > ______________________________________________________________________
> > Hotmail: Trusted email with powerful SPAM protection. Sign up now.
> > _______________________________________________
> > Eric mailing list
> > Eric <at> riverbankcomputing.com
> > http://www.riverbankcomputing.com/mailman/listinfo/eric
>
>

Hotmail: Powerful Free email with security by Microsoft. Get it now.
_______________________________________________
Eric mailing list
Eric@...
http://www.riverbankcomputing.com/mailman/listinfo/eric
Zhu Sha Zang | 3 Mar 2010 15:32
Picon
Favicon

Eric4 vs Python3.1

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hey dudes, i'm trying to run this simple "program" in python (of
course inside eric4).
/
# coding: utf8

import cmath
import math
import sys
import unicodedata
import codecs


def get_float(msg, allow_zero):
    x = None
    while x is None:
        try:
            x = float(input(msg))
            if not allow_zero and abs(x) < sys.float_info.epsilon:
                print("zero is not allowed")
                x = None
        except ValueError as err:
            print (err)
    return x

print ("ax\N{SUPERSCRIPT TWO} + bx + c = 0")
a = get_float("enter a: ", False)
b = get_float("enter b: ", True)
c = get_float("enter c: ", True)

x1 = None
x2 = None

discriminant = (b**2) - (4*a*c)

if discriminant == 0:
    x1 = -(b / (2*a))
else:
    if discriminant > 0:
        root = math.sqrt(discriminant)
    else:
        root = cmath.sqrt(discriminant)
    x1 = (-b + root) / (2*a)
    x2 = (-b - root) / (2*a)

equation = ("{0}x\N{SUPERSCRIPT TWO} + {1}x + {2} = 0" " \N{RIGHTWARDS
ARROW} x = {3}").format(a, b, c, x1)
if x2 is not None:
    equation += " or x = {0}".format(x2)
print(equation)/

But, when i try run scrip receive this message.

The debugged program raised the exception unhandled KeyError
"SUPERSCRIPT TWO"
File: /media/pendrive/PYTHON/quadratic.py, Line: 46


Testing inside a shell with python prompt the error is the same.
Testing with python3 or python3.1 the program works well.

The question?

How i made Eric4 runs scripts using python3.1 instead python2 (2.6.4
in here)??

Att...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuOcwAACgkQ35zeJy7JhCga9ACfeNIDRgMM6iwy7l4ZRoZ8YBfO
THAAoIuUu/o+kSVLDVvZEVvg5O12/WrE
=+z2I
-----END PGP SIGNATURE-----

_______________________________________________
Eric mailing list
Eric@...
http://www.riverbankcomputing.com/mailman/listinfo/eric
detlev | 3 Mar 2010 18:56
Picon
Favicon

Re: Adding to the list of python keywords

On Dienstag, 2. März 2010, Sourish Basu wrote:
> On Freitag, 26. Februar 2010, detlev wrote:
> 
> On Freitag, 26. Februar 2010, Phil Thompson wrote:
> 
> On Fri, 26 Feb 2010 18:28:24 +0100, detlev <detlev <at> die-offenbachs.de>
> 
> wrote:
> 
> On Freitag, 26. Februar 2010, Sourish Basu wrote:
> 
> Hi All,
> 
>     Is it possible to the list of python keywords that Eric4
> highlights (such as 'def', 'if', 'else', and so on)? For example, I
> would like to get Eric4 to color 'self', 'True' and 'False' with the
> same color as, for example, 'def' or 'None'. Is it possible to do
> that?
> 
>     I used to be able to do that when I used Komodo Edit, but then I
> quite using Komodo Edit for other reasons.
> 
> As far as I know that is not supported by QScintilla.
> 
> Just sub-class QsciLexerPython and reimplement keywords().
> 
> Phil
> 
> Thanks for the hint. I'll add it to the wish list.
> 
> 
> This feature has been implemented and will be part of the next eric5
>  snapshot.

I don't know, if they include snapshot releases.

> 
>  Any idea when this will make it to the Debian/Ubuntu repo's? I installed
>  eric4 from there, and would prefer to update it from the repo.
> 
>  Also, when you say that the feature has been implemented, do you mean that
>  'self', 'True' and 'False' now have highlighted colors, or do you mean
>  that there is a new feature enabling users to choose their own keywords?

The default is the keyword list implemented by QScintilla. However, there is a 
configuration dialog, that allows the user to modify this list (add/delete). 

Detlev

> 
>  -Sourish
> 

--

-- 
Detlev Offenbach
detlev <at> die-offenbachs.de
_______________________________________________
Eric mailing list
Eric <at> riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/eric
detlev | 3 Mar 2010 18:57
Picon
Favicon

Re: Bug of Eric5

Hi,

that is a know issue and already fixed in the source repo. The next snapshot 
will include the fix.

Detlev

On Dienstag, 2. März 2010, drizt wrote:
> On Tue, 2010-03-02 at 10:12 +0000, Niklas (br) wrote:
> > sys.setappdefaultencoding
> 
> The problem is that "sys.setappdefaultencoding" can only be set to utf-8
> in my computer,  but Eric5 is set to cp1251 when running on windows.
> 
> 
> 
> _______________________________________________
> Eric mailing list
> Eric@...
> http://www.riverbankcomputing.com/mailman/listinfo/eric
> 

--

-- 
Detlev Offenbach
detlev@...
detlev | 3 Mar 2010 18:59
Picon
Favicon

Re: eric4 won't launch

Hi,

how did you install eric4? The installation script should have caught this 
problem and should reject the installation.

Detlev

On Mittwoch, 3. März 2010, Patrick Sauer wrote:
> Thanks for the reply! Unfortunately, no *.log file was generated in the
> _eric4 directory - a bug?. I tracked down the error manually by explicitly
>  running "python eric4.py" from the command line.
> 
> It turned out the Qsci dll import failed. Inspection of the PATH
> variable revealed a superfluous semi-colon, which prevented the /Qt/bin
> directory from being added properly...
> 
> 
> Kind regards,
> 
> 
> 
> Patrick
> 
> > Subject: Re: [Eric] eric4 won't launch
> > From: drizt.ruan <at> gmail.com
> > To: jazzcat81 <at> hotmail.com
> > Date: Wed, 3 Mar 2010 10:57:18 +0800
> >
> > Please check your log file in X:\Documents and Settings\user\_eric4,
> > file name is something like eric4_error.log.
> >
> > On Tue, 2010-03-02 at 19:07 +0100, Patrick Sauer wrote:
> > > Hi,
> > >
> > > After successfully installing Qt and building PyQt under Windows XP, I
> > > can't get Eric4 to run. Strangely, I don't receive any errors when
> > > entering "eric4" at the command prompt, i.e.
> > >
> > > >> eric4
> > >
> > > it seems as if the program executes, but no window opens.
> > >
> > > What am I doing wrong? Any help would be much appreciated.
> > >
> > > Kind regards,
> > >
> > > Patrick
> > >
> > >
> > > ______________________________________________________________________
> > > Hotmail: Trusted email with powerful SPAM protection. Sign up now.
> > > _______________________________________________
> > > Eric mailing list
> > > Eric <at> riverbankcomputing.com
> > > http://www.riverbankcomputing.com/mailman/listinfo/eric
> 
> _________________________________________________________________
> Hotmail: Powerful Free email with security by Microsoft.
> https://signup.live.com/signup.aspx?id=60969
> 

--

-- 
Detlev Offenbach
detlev <at> die-offenbachs.de
_______________________________________________
Eric mailing list
Eric <at> riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/eric

Gmane