Re: [python-win32] Possible trouble with pywin23-216 on python 3.2

2011-03-03 Thread Tim Golden


Re: [python-win32] Possible trouble with pywin23-216 on python 3.2


Aha! There's your problem: you're trying to install pywin23.
Don't know why you didn't spot it yourself... ;)


TJG
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Possible trouble with pywin23-216 on python 3.2

2011-03-03 Thread Greg Ewing

Tim Golden wrote:


Re: [python-win32] Possible trouble with pywin23-216 on python 3.2


Aha! There's your problem: you're trying to install pywin23.


Unless of course you're using one of those rare machines based
on Intel's little-known 23-bit architecture. (There was a typo
early on in the design phase that wasn't spotted until an
embarrassingly late stage of the development process. They
hijacked the time machine and tried to cover it up, but a few
prototype machines slipped through.)

--
Greg
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] Fonts behaving differently with Py3/216

2011-03-03 Thread Greg Ewing

I recently tried running PyGUI on Python 3 using
pywin32 build 216, and a couple of things are
not working quite the same way as they were with
Python 2 and build 213.

1) The default font used for control labels etc.
is slightly smaller.

2) When I calculate the width of a piece of text
using DC.GetTextExtent() I get a value that is
too small, and doesn't match the actual size of
the text as it is drawn.

Anyone have any idea what might have changed,
and what I can do about it?

--
Greg
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Fonts behaving differently with Py3/216

2011-03-03 Thread Mark Hammond

On 4/03/2011 1:31 PM, Greg Ewing wrote:

I recently tried running PyGUI on Python 3 using
pywin32 build 216, and a couple of things are
not working quite the same way as they were with
Python 2 and build 213.

1) The default font used for control labels etc.
is slightly smaller.

2) When I calculate the width of a piece of text
using DC.GetTextExtent() I get a value that is
too small, and doesn't match the actual size of
the text as it is drawn.

Anyone have any idea what might have changed,
and what I can do about it?


What version of python and how many bits?  I'm guessing you tried 3.2, 
which means you must have used the 64bit version (as the 32 bit version 
of pywin32 appears to have 2.x syntax .py files).  Assuming you've been 
using 32bit builds on 2.x, I guess that could point to a bug in the 
64bit port of pywin32?


The only other thing I can think if is the manifest changes - windows 
uses the manifest of the owning hmodule for some things (notably the 
version of the common controls used), which is why the winxpgui module 
exists.  It seems unlikely, but I wonder if those changes have told 
windows to put things in some kind of compatibility mode.


Cheers,

Mark
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Fonts behaving differently with Py3/216

2011-03-03 Thread Greg Ewing

Mark Hammond wrote:

What version of python and how many bits?  I'm guessing you tried 3.2, 
which means you must have used the 64bit version


No, it's 3.1, and 32 bit. It can't be 64, because the
machine I'm running it on can't handle that. (And it's
definitely not 23 bit either. :-)

The only other thing I can think if is the manifest changes - windows 
uses the manifest of the owning hmodule for some things


I don't really know anything about these manifest things.
Is there some tool I can use to examine them and see
whether anything is different?

--
Greg

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Fonts behaving differently with Py3/216

2011-03-03 Thread Mark Hammond

On 4/03/2011 3:26 PM, Greg Ewing wrote:

Mark Hammond wrote:


What version of python and how many bits? I'm guessing you tried 3.2,
which means you must have used the 64bit version


No, it's 3.1, and 32 bit. It can't be 64, because the
machine I'm running it on can't handle that. (And it's
definitely not 23 bit either. :-)


Interesting - I'm really confused how the 32 bit version for 3.2 failed 
to build correctly!



The only other thing I can think if is the manifest changes - windows
uses the manifest of the owning hmodule for some things


I don't really know anything about these manifest things.
Is there some tool I can use to examine them and see
whether anything is different?


The Windows SDK (and I assume VC - haven't checked) comes with a 
manifest tool - mt.exe.  The syntax is fairly obscure, but it allows 
you to extract, change and add manifests (but not remove them AFAIK). 
Note the manifest ID for DLLs is 2 - so the command to extract would be 
something like:


mt.exe -inputresource:path\to\whatever.pyd;#2 -out:out.txt

HTH,

Mark



___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] Mapping Drives in Python

2011-03-03 Thread Becky Mcquilling
Hi:

Hoping you guys can help out a python noob here.

I have a list of machines that I am backing up flat files from to one
central machine.  I need to:
a)  Map Drives and b) run robocopy

I am iterating through a text file that has the share names and the and
directory that I want to be created:


count = 0
alphabet = 'klmnopqrstuv'
today = datetime.date.today()
backup_servers = {}
f = open('c:/test/backup_shares.txt')
for line in f:
backup_server = line.split(',')
backup_servers[ backup_server[0]]=backup_server[1]
for i, v in backup_servers.items():
backup_shares = i
archive_dir = v.strip()
archive_dir += str(today)
drive_letter = alphabet[count]
count += 1


The above creates a dictionary and I iterate through that.

backup_shares = '\\server_name\c$' for example and archive_dir is the
directory on the local machine that I will create with a timestamp to backup
the files to on the local machine example d:\backup_dir\03-03-2011\files

What I want to do is map a drive, which is why the alphabet string.  I
iterate through that and then get k first backup dir, etc.

I'm not sure what method to call to map a drive or how the best way to call
robocopy is.  I don't have the choice of using IronPython.  I have the win32
modules.
And this works:
 win32net.NetUseAdd(None,1,{'remote':r'\\server_name\c$','local':'K:'})
However, I want to use the variable backup_server and insert the
drive_letter variable in the script snippet, but I haven't been able to make
that work.  Any suggestions?

Also, suggestions and examples on calling robocopy?

Thanks so much!

Becky
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32