SamsungTools — FORKED
-
- Newbie
- Posts: 8
- Joined: 12 Jul 2013, 16:05
- Location: Russia
- Contact:
SamsungTools — FORKED
Hello all, hello developers.
I created a simple fork for SamsungTools program.
First i cleaned code. It was not good and still its.
Next i added support for "battery life time extender" as developers and users wanted.
I hope you enjoy it, and hope, that developers accept me in their "team", because i want to help developing it.
Source code attached here, maybe i'll cheate .deb's.
Best regards, mrDoctorWho.
I created a simple fork for SamsungTools program.
First i cleaned code. It was not good and still its.
Next i added support for "battery life time extender" as developers and users wanted.
I hope you enjoy it, and hope, that developers accept me in their "team", because i want to help developing it.
Source code attached here, maybe i'll cheate .deb's.
Best regards, mrDoctorWho.
-
- Newbie
- Posts: 8
- Joined: 12 Jul 2013, 16:05
- Location: Russia
- Contact:
Re: SamsungTools — FORKED
As i said, i created .deb package.
Get it here: http://simpleapps.ru/samsung-tools_2.2_all.deb (Voria forum doesn't accept .deb)
Get it here: http://simpleapps.ru/samsung-tools_2.2_all.deb (Voria forum doesn't accept .deb)
Re: SamsungTools — FORKED
Hi,
first of all, thanks for your interest in "Samsung Tools" project, which is rather slack at the moment (along with the whole project "Linux On My Samsung"). The main reason is that I've lost interest, I'm starting to dislike Samsung products, and it just does not feel right to waste my time to fix their products.
The "Samsung Tools" code is far from perfect, it was written in a fast way to make it usable in short times. In fact, the first thing in my TODO list was code refactoring (which I never did for the said lack of interest).
That said, I was looking at your changes, they seem good to me except for some "simplifications" you did which in result make the code harder to read, and I prefer readability over the syntesis.
For example, you changed this:with:
I don't like it.
If you provide me with a proper patch that I can apply to the bzr branch, I would be happy to apply it.
Greetings
first of all, thanks for your interest in "Samsung Tools" project, which is rather slack at the moment (along with the whole project "Linux On My Samsung"). The main reason is that I've lost interest, I'm starting to dislike Samsung products, and it just does not feel right to waste my time to fix their products.
The "Samsung Tools" code is far from perfect, it was written in a fast way to make it usable in short times. In fact, the first thing in my TODO list was code refactoring (which I never did for the said lack of interest).
That said, I was looking at your changes, they seem good to me except for some "simplifications" you did which in result make the code harder to read, and I prefer readability over the syntesis.
For example, you changed this:
Code: Select all
with open(SL_PATH_BACKLIGHT, 'r') as file:
status = int(file.read(1))
if status == 0:
return True
else:
return False
Code: Select all
return not bool(int(rFile(SL_PATH_BACKLIGHT)[0]))
If you provide me with a proper patch that I can apply to the bzr branch, I would be happy to apply it.
Greetings

Re: SamsungTools — FORKED
Why did you report this thread as spam?
-
- Newbie
- Posts: 8
- Joined: 12 Jul 2013, 16:05
- Location: Russia
- Contact:
Re: SamsungTools — FORKED
Hello voRia! I just cleaned code. In your code, CPU doing excess operation. Python accepts 0/1 as bool code, why don't use this?voRia wrote: For example, you changed this:with:Code: Select all
with open(SL_PATH_BACKLIGHT, 'r') as file: status = int(file.read(1)) if status == 0: return True else: return False
I don't like it.Code: Select all
return not bool(int(rFile(SL_PATH_BACKLIGHT)[0]))
-
- Newbie
- Posts: 8
- Joined: 12 Jul 2013, 16:05
- Location: Russia
- Contact:
Re: SamsungTools — FORKED
voRia, I just wanted to draw your attention to this post. I tried many times to contact some developers of some python projects. They just ignores any additions.
After all. Can you accept my addition request to your jabberID? We can talk in it about code parts that you don't like and take a solution
After all. Can you accept my addition request to your jabberID? We can talk in it about code parts that you don't like and take a solution
Re: SamsungTools — FORKED
For the sake of clarity.mrDoctorWho wrote: Hello voRia! I just cleaned code. In your code, CPU doing excess operation. Python accepts 0/1 as bool code, why don't use this?
Ok, but I already got your private email and the bug report you filed on Launchpad.mrDoctorWho wrote:voRia, I just wanted to draw your attention to this post. I tried many times to contact some developers of some python projects. They just ignores any additions.

I don't use jabber anymore, I completely moved to my google account (GTalk/Hangouts).mrDoctorWho wrote: After all. Can you accept my addition request to your jabberID? We can talk here about code parts that you don't like and take a solution
You can contact me there or by email.
-
- Newbie
- Posts: 8
- Joined: 12 Jul 2013, 16:05
- Location: Russia
- Contact:
Re: SamsungTools — FORKED
If user look at code, he should know python or basis of programming. Python as original is easy to understand. Making program slower for better reading is a bad tone. Need a average of it. All web-developers doing optimization of their code: they using 1/0 instread of true/false in js. they using obfuscation and something else.voRia wrote: For the sake of clarity.
So, accept GTalk addition. I using both: jabber & gtalk. GTalk is almost jabber, it based on xmpp protocol.voRia wrote: I don't use jabber anymore, I completely moved to my google account (GTalk/Hangouts).
You can contact me there or by email.
Re: SamsungTools — FORKED
[ Aside on programming style ]
As Knuth himself said1:
At the same time - don't make any premature pronouncements on performance without running the code through a profiler! Modern compilers are pretty clever at optimization, and I'm pretty sure that using '1/0' instead of 'true/false' won't result in different machine code.
1Apparently I can't post links - I found that quote here: http://en.wikipedia.org/wiki/Optimizati ... ted268_2-0
[ / Aside ]
While I don't use python myself, I must say that I object to that statement.mrDoctorWho wrote: Making program slower for better reading is a bad tone. Need a average of it. All web-developers doing optimization of their code: they using 1/0 instread of true/false in js.
As Knuth himself said1:
Your code does indeed have the advantage of making the code more compact, which would have been worthwhile in the bad old days of 25-line terminals. Today we can all afford to see 100+lines of code at a time, and compact code is no longer a necessary boon. (And if you have a clever enough editor it can probably be folded away.)Donald Knuth wrote:We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil
At the same time - don't make any premature pronouncements on performance without running the code through a profiler! Modern compilers are pretty clever at optimization, and I'm pretty sure that using '1/0' instead of 'true/false' won't result in different machine code.
1Apparently I can't post links - I found that quote here: http://en.wikipedia.org/wiki/Optimizati ... ted268_2-0
[ / Aside ]
-
- Newbie
- Posts: 8
- Joined: 12 Jul 2013, 16:05
- Location: Russia
- Contact:
Re: SamsungTools — FORKED
It's a part of code, that i replaced in samsung-tools:
That's code is incorrect. Why? Just its extra (not needed) operation. We can do that and it will be correct:
Its not just simple, it's correct. And i'm sure that PEP8 accept it. Did you read "Zen of Python"?
Code: Select all
if os.path.exists(spam):
return True
else:
return False
Code: Select all
return os.path.exists(spam)
Zen of Python #3 wrote: Simple is better than complex.
Re: SamsungTools — FORKED
@mrDoctorWho:
I agree with you on your last example, it's just a banal error from my part, writing code too fast without taking a proper look at it afterward. There was other code in that if-else block which I removed later and I forgot to remove the if-else block itself.
Yet, this example does not prove your point, the previous code snippets posted are not errors, they are good and perfectly readable as they are.
Also, I don't think optimization is that much important here: samsung-tools does a very simple job and it's not crucial to be as fast as possible. On the other hand, code readability allows me (and you
) to easily work on the code.
I agree with you on your last example, it's just a banal error from my part, writing code too fast without taking a proper look at it afterward. There was other code in that if-else block which I removed later and I forgot to remove the if-else block itself.

Yet, this example does not prove your point, the previous code snippets posted are not errors, they are good and perfectly readable as they are.
Also, I don't think optimization is that much important here: samsung-tools does a very simple job and it's not crucial to be as fast as possible. On the other hand, code readability allows me (and you
