python kinterbasdb - check default charset of db or table

2012-04-18 Thread miamia
Hello,
I am using python 2.7 and kinterbasdb. How could I find out default
charset used by database? I need to check it and then according to
used charset decode returned strings. thank you


-- 
http://mail.python.org/mailman/listinfo/python-list


multilanguage application - step by step

2011-07-28 Thread miamia
Hello guys,

I would like to translate all strings in my application for several
languages (eng, es, de, etc) and user should be able to switch app
from one language to another. I am still newbie with python so is
there any step-by-step tutorial how to to this? thanks for help
-- 
http://mail.python.org/mailman/listinfo/python-list


gettext localize strings with variables

2011-07-28 Thread miamia
Hello,
I have
variable OUHH and
print _('This is %(OUHH)s a translatable string.' % locals())

how can I translate this ?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The following modules appear to be missing - py2exe

2011-07-20 Thread miamia
hello, thanks for your answer.

  From the stuff below, you appear to be compiling for Windows.
yes


  The following modules appear to be missing
  ['Carbon', 'Carbon.Files',
 This is Mac gui stuff which you neither need nor want in a Windows
 binary. I suspect mis-specification somewhere.

ok so this is not necessary.


   '_scproxy', 'fixedpoint', 'gdk', 'mx', 'unix', 'glib.

 compiling with gcc? You appear to be missing its glib.

I compile with py2exe and have no idea how to retrieve missing libs. I
tried to ask at
http://sourceforge.net/mailarchive/forum.php?thread_name=CABFuWSwv76-Hz-fNrqN_2__%2Bb7ZpPuBb%3DT%2B-i0-MF%2BJvjj8Fqg%40mail.gmail.comforum_name=py2exe-users
as well and Dieter responded it is py2exe troubles with gdk and glib
packages.
-- 
http://mail.python.org/mailman/listinfo/python-list


The following modules appear to be missing - py2exe

2011-07-19 Thread miamia
Hello, please I have problem with The following modules appear to be
missing message during compiling my app exe file with py2exe. What
should I do with this? Many thanks in advance.


The following modules appear to be missing
['Carbon', 'Carbon.Files', '_scproxy', 'fixedpoint', 'gdk', 'mx',
'unix', 'glib.
GError', 'glib.IOChannel', 'glib.IO_ERR', 'glib.IO_FLAG_APPEND',
'glib.IO_FLAG_G
ET_MASK', 'glib.IO_FLAG_IS_READABLE', 'glib.IO_FLAG_IS_SEEKABLE',
'glib.IO_FLAG_
IS_WRITEABLE', 'glib.IO_FLAG_MASK', 'glib.IO_FLAG_NONBLOCK',
'glib.IO_FLAG_SET_M
ASK', 'glib.IO_HUP', 'glib.IO_IN', 'glib.IO_NVAL', 'glib.IO_OUT',
'glib.IO_PRI',
 'glib.IO_STATUS_AGAIN', 'glib.IO_STATUS_EOF', 'glib.IO_STATUS_ERROR',
'glib.IO_
STATUS_NORMAL', 'glib.Idle', 'glib.MainContext', 'glib.MainLoop',
'glib.OPTION_E
RROR', 'glib.OPTION_ERROR_BAD_VALUE', 'glib.OPTION_ERROR_FAILED',
'glib.OPTION_E
RROR_UNKNOWN_OPTION', 'glib.OPTION_FLAG_FILENAME',
'glib.OPTION_FLAG_HIDDEN', 'g
lib.OPTION_FLAG_IN_MAIN', 'glib.OPTION_FLAG_NOALIAS',
'glib.OPTION_FLAG_NO_ARG',
 'glib.OPTION_FLAG_OPTIONAL_ARG', 'glib.OPTION_FLAG_REVERSE',
'glib.OPTION_REMAI
NING', 'glib.OptionContext', 'glib.OptionGroup',
'glib.PRIORITY_DEFAULT', 'glib.
PRIORITY_DEFAULT_IDLE', 'glib.PRIORITY_HIGH',
'glib.PRIORITY_HIGH_IDLE', 'glib.P
RIORITY_LOW', 'glib.Pid', 'glib.PollFD',
'glib.SPAWN_CHILD_INHERITS_STDIN', 'gli
b.SPAWN_DO_NOT_REAP_CHILD', 'glib.SPAWN_FILE_AND_ARGV_ZERO',
'glib.SPAWN_LEAVE_D
ESCRIPTORS_OPEN', 'glib.SPAWN_SEARCH_PATH',
'glib.SPAWN_STDERR_TO_DEV_NULL', 'gl
ib.SPAWN_STDOUT_TO_DEV_NULL', 'glib.Source', 'glib.Timeout',
'glib.child_watch_a
dd', 'glib.filename_display_basename', 'glib.filename_display_name',
'glib.filen
ame_from_utf8', 'glib.get_application_name', 'glib.get_current_time',
'glib.get_
prgname', 'glib.glib_version', 'glib.idle_add', 'glib.io_add_watch',
'glib.main_
context_default', 'glib.main_depth', 'glib.markup_escape_text',
'glib.set_applic
ation_name', 'glib.set_prgname', 'glib.source_remove',
'glib.spawn_async', 'glib
.timeout_add', 'glib.timeout_add_seconds',
'glib.uri_list_extract_uris']

*** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.

Make sure you have the license if you distribute any of them, and
make sure you don't distribute files belonging to the operating
system.

   USP10.DLL - C:\WINDOWS\system32\USP10.DLL
   OLEAUT32.dll - C:\WINDOWS\system32\OLEAUT32.dll
   USER32.dll - C:\WINDOWS\system32\USER32.dll
   POWRPROF.dll - C:\WINDOWS\system32\POWRPROF.dll
   SHELL32.dll - C:\WINDOWS\system32\SHELL32.dll
   ole32.dll - C:\WINDOWS\system32\ole32.dll
   SHLWAPI.DLL - C:\WINDOWS\system32\SHLWAPI.DLL
   COMDLG32.DLL - C:\WINDOWS\system32\COMDLG32.DLL
   ADVAPI32.DLL - C:\WINDOWS\system32\ADVAPI32.DLL
   msvcrt.dll - C:\WINDOWS\system32\msvcrt.dll
   WS2_32.dll - C:\WINDOWS\system32\WS2_32.dll
   WINSPOOL.DRV - C:\WINDOWS\system32\WINSPOOL.DRV
   GDI32.dll - C:\WINDOWS\system32\GDI32.dll
   DNSAPI.DLL - C:\WINDOWS\system32\DNSAPI.DLL
   VERSION.dll - C:\WINDOWS\system32\VERSION.dll
   KERNEL32.dll - C:\WINDOWS\system32\KERNEL32.dll
   IMM32.DLL - C:\WINDOWS\system32\IMM32.DLL
   COMCTL32.DLL - C:\WINDOWS\system32\COMCTL32.DLL
   MSIMG32.DLL - C:\WINDOWS\system32\MSIMG32.DLL
   MPR.dll - C:\WINDOWS\system32\MPR.dll
   gdiplus.dll - C:\WINDOWS\system32\gdiplus.dll
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The following modules appear to be missing - py2exe

2011-07-19 Thread miamia
On Jul 19, 1:13 pm, Noon Silk noonsli...@gmail.com wrote:
 On Tue, Jul 19, 2011 at 7:47 PM, Peter Irbizon peterirbi...@gmail.com wrote:
  Hello, please I have problem with The following modules appear to be
  missing message during compiling my app exe file with py2exe. What should I
  do with this? Many thanks in advance.

  The following modules appear to be missing

  [...]

 What does your setup.py look like? I was able to solve this my
 including the relevant libs in the following:

 setup(windows=[{'script': 'foo.py'}],
     options={
         'py2exe':
         {
             'includes': ['gzip', 'other libs here'],
         }
     }
 )

 Given from here: http://stackoverflow.com/questions/5308760/py2exe-lxml-woes

 --
 Noon Silk |http://dnoondt.wordpress.com/

 Fancy a quantum lunch?http://groups.google.com/group/quantum-lunch?hl=en

 Every morning when I wake up, I experience an exquisite joy — the joy
 of being this signature.

my setup.py looks like this:
# -*- coding: utf-8 -*-
from distutils.core import setup
import py2exe
import sys

class Target:
   def __init__(self, **kw):
   self.__dict__.update(kw)
   self.version = 0.9.0.002
target = Target(
   script = app.py,
   icon_resources=[(1, 'ico.ico')],
   )


setup(
name = 'xx',
author='abc',

windows = [target],

options = {
  'py2exe': {
  'packages':'encodings, kinterbasdb',
  'includes': 'cairo, pango, pangocairo, atk,
gobject, gio',
  }
  },

data_files=[],
)


there must be something missing. I will try to find it out what is it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: module problem on windows 64bit

2011-07-07 Thread miamia
On Jul 5, 5:05 pm, Thomas Jollans t...@jollybox.de wrote:
 On 06/27/2011 06:59 PM, miamia wrote:

  Hello,

  on 32-bit windows everything works ok but on 64-bit win I am getting
  this error:
  Traceback (most recent call last):
    File app.py, line 1040, in do_this_now
    File kinterbasdb\__init__.pyc, line 119, in module
    File kinterbasdb\_kinterbasdb.pyc, line 12, in module
    File kinterbasdb\_kinterbasdb.pyc, line 10, in __load
  ImportError: DLL load failed: This application has failed to start
  because the application configuration is incorrect. Reinstalling the
  application may fix this problem.

  How to get it work on 64bit windows as well? many thanks

 A process can only link to a shared library compiled for the same
 architecture as the process. In layman's terms: A 32-bit DLL won't work
 with a 64-bit program. It looks like this package is attempting to load
 a 32-bit DLL. That's not going to work. Either procure a 64-bit version
 of the DLL, or use a 32-bit version of Python.

hello, it looks lite I solved it with files msvcp80.dll,
Microsoft.VC80.CRT.manifest. I forgot to extract these files from
firebird embedded pachage to my app folder. now it seems to be ok on
both systems 32 and 64bit (so It wasn't 64bit issue as I thought).
thank you
-- 
http://mail.python.org/mailman/listinfo/python-list


module problem on windows 64bit

2011-06-27 Thread miamia
Hello,

on 32-bit windows everything works ok but on 64-bit win I am getting
this error:
Traceback (most recent call last):
  File app.py, line 1040, in do_this_now
  File kinterbasdb\__init__.pyc, line 119, in module
  File kinterbasdb\_kinterbasdb.pyc, line 12, in module
  File kinterbasdb\_kinterbasdb.pyc, line 10, in __load
ImportError: DLL load failed: This application has failed to start
because the application configuration is incorrect. Reinstalling the
application may fix this problem.

How to get it work on 64bit windows as well? many thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


can I distribute Microsoft.VC90.CRT files?

2011-06-27 Thread miamia
hello,

I find out that my program needs
Microsoft.VC90.CRT.manifest,msvcm90.dll,msvcp90.dll,msvcr90.dll files
when I want to run it on  win 64bit systems. I find these files in
some other software.
Can I simply take it from another software then include it to my
program folder and distribute it this way? Is it violation or not?
-- 
http://mail.python.org/mailman/listinfo/python-list


how to write to registry without admin rights on win vista/7

2011-06-24 Thread miamia
Hello,

In my program I can set to run after system startup (it writes path to
Software\Microsoft\Windows\CurrentVersion\Run) but when normal user is
logged in my application crashes. I must right click on app an choose
Run As Admin and then everything works.

How can I do it to write to registry without Run As Admin ?
-- 
http://mail.python.org/mailman/listinfo/python-list


compile 32bit application in python for use on 64bit win machine

2011-06-23 Thread miamia
Hello,
I am using 32bit win xp pro and compiling my python scripts as exe
with py2exe. Everything works ok on 32bit windows platforms. But how
can I compile my program for use on 64bit Windows?

On 64bit windows this error occures in event log:
Activation context generation failed for C:\Program Files\app
\app.exe. Dependent Assembly
Microsoft.VC90.CRT,processorArchitecture=x86,publicKeyToken=1fc8b3b9a1e18e3b,type=win32,version=9.0.21022.8
could not be found. Please use sxstrace.exe for detailed diagnosis.

how can I run this program on 64 bit? thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python + php encrypt/decrypt

2011-06-06 Thread miamia
On Jun 6, 7:41 pm, geremy condra debat...@gmail.com wrote:
 On Sun, Jun 5, 2011 at 3:34 AM, Peter Irbizon peterirbi...@gmail.com wrote:
  Hello, thanks, Unfortunatelly I don't understand how xml should resolve my
  issue. My problem is:
  I am trying to use aes256 cbc on python and php to decrypt textstring. But
  results are not the same in php and python. Any idea why? password and iv is
  the same so I don't know where is the problem. I am trying do decrypt data
  in python then store it as base64 and read and decrypt it in php.

  2011/6/4 hid...@gmail.com

  Use xml to pass the encrypt text.

  On , Peter Irbizon peterirbi...@gmail.com wrote:

Hello,

php I am trying to use is here:
http://code.google.com/p/antares4pymes/source/browse/trunk/library/System/Crypt/AES.php?r=20

and python code:
# -*- coding: utf-8 -*-
from Crypto.Cipher import AES
import base64
import os

BLOCK_SIZE = 32
PADDING = '{'
pad = lambda s: s + (BLOCK_SIZE - len(s) % BLOCK_SIZE) * PADDING
EncodeAES = lambda c, s: base64.b64encode(c.encrypt(pad(s)))
DecodeAES = lambda c, e:
c.decrypt(base64.b64decode(e)).rstrip(PADDING)
secret = passkeypasskeyaa #os.urandom(BLOCK_SIZE)
iv='1234567890123456'
cipher = AES.new(secret, AES.MODE_CBC, iv)
# encode a string
tajnytext ='Alice has a cat'
encoded = EncodeAES(cipher, tajnytext)
print encoded

# decode the encoded string
decoded = DecodeAES(cipher, encoded)
print 'Decrypted string:', decoded


Thank you for your help in advance

   Hello,

   I would like to encrypt text in python and decrypt it in my PHP script.
   I tried to use pycrypto and some aes php scripts but the results are not 
   the
   same. Please, is there any example (the best way source codes) how to do
   this in python and PHP?

 Please provide links to the AES implementation you're trying to use
 from PHP and the Python and PHP code you're using.

 Geremy Condra- Hide quoted text -

 - Show quoted text -

-- 
http://mail.python.org/mailman/listinfo/python-list


ugly exe icon in win7/vista

2011-06-06 Thread miamia
Hello, I am trying to make nice icons for my program. I compiled it
with py2exe but problem is that exe icon in Win 7/vista is not very
nice (it looks like win7 takes 32x32 instead of 248x248icon)

I used png2ico to pack icon file: png2ico icon.ico png248x248.png
png32x32.png png16x16.png

Any idea why win7 is showing 16x16(or 32x32) as exe icon?
-- 
http://mail.python.org/mailman/listinfo/python-list


python + php encrypt/decrypt

2011-06-04 Thread miamia
Hello,
I would like to encrypt text in python and decrypt it in my PHP
script. I tried to use pycrypto and some aes php scripts but the
results are not the same. Please, is there any example (the best way
source codes) how to do this in python and PHP?
many thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


hide gtk warning

2011-05-31 Thread miamia
I am getting gtkwarning: gdk_property_change: assertion window !
=Null failed
gtk.main()

it is gdk bug but not fixed yet.How could I simply not show/hide
this error warning? so user should never see it. thank you
-- 
http://mail.python.org/mailman/listinfo/python-list


python urllib2 data post over https

2011-05-26 Thread miamia
hello, I am using this code to send data over https with post method:

params='tieto data idu na sevrer\n'
kamodoslat = https://domena.tld/script.php;
req = urllib2.Request(kamodoslat)
req.add_header('User-Agent', 'agent')
resp = urllib2.urlopen(req, params)

how can I make sure that data were really sent over secured protocol
https and all communcation went through https?
-- 
http://mail.python.org/mailman/listinfo/python-list