Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

many fixing to make it work on my computer (Win7 + LO4.4) #1

Open
wants to merge 1 commit into
base: python3
Choose a base branch
from

Conversation

znbn
Copy link

@znbn znbn commented Feb 24, 2015

import winreg instead _winreg (for Python3)
fixed save_as() method (ods format is default)
added save() method
removed spaces after the print function (just programming style)

notes for Fernando:

  • on my computer, the statement "import _winreg" doesn't work
  • the "save_as()" method doesn't function, without a second parameter, for the format to use.
  • please, activate the issue service, or let me know your email addres, if you want more feedback (you can find me on google plus. my address is giacomail at gmail.com )

import winreg instead _winreg (for Python3)
fixed save_as() method (ods format is default)
added save() method
removed spaces after the print function
@Governa
Copy link
Owner

Governa commented Feb 24, 2015

Thank you for helping 👍

I've activated the issue service, so feel free to add issues there. But I can't promise I'll do anything with it for now... sorry.

1 ) What I'm trying to do here is to put this code base in a state where it can be run both in python 2.7 and python 3.x. In python 2.7 the module is called _winreg and in 3.x winreg but, fortunately, there is an automatic conversion tool distributed with python called 2to3 that knows that(and a lot more) and convert 2.7 code directly to 3.x code.

So what I want to do is to find out every change that the 2to3 tool cannot do by itself, and add to this branch so that running this lib under python3.x is only a matter of running 2to3 on it.

  1. Are those white spaces causing problems to execute the code? If not, I would like to avoid those kind of cosmetic changes for now. The fewest changes, the greater the chances of the original author merging it back.

  2. The save_as function change seems ok. Could you remove those other parts from your commit so that I merge your changes?

Sorry for my english, but I expect that it was at least understandable...

@Governa
Copy link
Owner

Governa commented Feb 24, 2015

Oh, if you could make an better commit message with more descriptive title and add some description of why you changed the "_file_url" method(even splitting it in another commit if it is not related to the save_as change) it would be greatly appreciated.

@znbn
Copy link
Author

znbn commented Mar 2, 2015

thank for your reply.

Oggetto: Re: [oosheet] many fixing to make it work on my computer (Win7 +

LO4.4) (#1)
Data: 24/02/15 16:37

> 

Oh, if you could make an better commit message with more descriptive title
and add some description of why you changed the "_file_url" method(even
splitting it in another commit if it is not related to the save_as change)

I'll try to do my best, but this is the first time I really try using git,
and I'm not so good in writing descriptive title and description.... I'll
try.

Giacomo

--
ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio email.it, per tutti i dettagli
Clicca qui http://posta.email.it/caselle-di-posta-z-email-it/?utm_campaign=email_Zimbra_102014=main_footer/f

Sponsor:
Soluzioni di email hosting per tutte le esigenze: dalle caselle gratuite a quelle professionali su piattaforma Zimbra, da quelle su proprio dominio a quelle certificate PEC. Confronta le soluzioni
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=13325&d=2-3

@znbn
Copy link
Author

znbn commented Mar 2, 2015

--------- Original Message --------
Da: Governa/oosheet

[email protected]
To: Governa/oosheet [email protected]
Oggetto: Re: [oosheet] many fixing to make it work on my computer (Win7 +
LO4.4) (#1)
Data: 24/02/15 16:24

> 

Thank you for helping

I've activated the issue service, so feel free to add issues there.
Good!

1 ) What I'm trying to do here is to put this code base in a state where
it can be run both in python 2.7 and python 3.x.
I never used python 2to3... does it make the code compatible with both 2 and
3 ? Good.
I never thouth to make a program compatible with both versions, (only some
simple scripts) because I think the code is more complex and there are not
so many advantages.
I think 2to3 is a tool for helping to migrate old code to python3, not for
writing new code compatible both with 2 and 3.

In python 2.7 the module is called _winreg and in 3.x winreg but,
fortunately, there is an automatic conversion tool distributed with python
called 2to3 that knows that(and a lot more) and convert 2.7 code directly to
3.x code.
Yes, that is not a real problem. I red many solutions for this, I adopted a
try-except solution. (however my target is writing a code compatible with
python 3 first of all... than I try to make it compatible with Python2, if
it is possible).

I recently discovered another project (I never tryed it but I red its code
and few examples) similar to oosheet. It looks nice (a little different from
oosheet) but it is writtent to be compatible with python2 and python3
without having to run the 2to3 tool. My opinion is that there is a lot of
overload and the code is less easy to read. If you have time, take a look to
https://pypi.python.org/pypi/pyoo/1.0

  1. Are those white spaces causing problems to execute the code?
    Obviously no! It is just a matter of programming style, however, about
    spaces, https://www.python.org/dev/peps/pep-0008/ reports:

Immediately before the open parenthesis that starts the argument list of
a function call:
Yes: spam(1)
No: spam (1)

  1. The save_as function change seems ok. Could you remove those other
    parts from your commit so that I merge your changes?
    I'm fork your project with just that function changed.

Sorry for my english, but I expect that it was at least understandable...
it is perfectly understandable.
My english is not so good, too. My italian is really better :)

Thanks.
Giacomo

--
ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio email.it, per tutti i dettagli
Clicca qui http://posta.email.it/caselle-di-posta-z-email-it/?utm_campaign=email_Zimbra_102014=main_footer/f

Sponsor:
Registra i domini che desideri ed inizia a creare il tuo sito web
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=13323&d=2-3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants