Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 07-17-2018, 12:37 PM   #136
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 4,360
Karma: 9565623
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, Kobo AuraHD/Aura6"/H2O/GloHD/KA1/ClaraHD
Quote:
Originally Posted by jcn363 View Post
Could we pass the device as a parameter or use a variable?

Spoiler:
Code:
./bin/kobopatch-linux-64bit AuraOne

  vars:
    device: AuraOne

  Parameters:
    DevType:
      Description: Device type.
      Default: AuraOne
      Type: String
      AllowedValues:
        - Touch # Trilogy
        - Touch2 # Pika
        - Mini # Pixie
        - AuraHD # Dragon
        - Aura # Phoenix
        - Glo # uses the values of Phoenix
        - H2O # uses the values of Dragon
        - GloHD # Alyssum
        - ClaraHD # Nova
        - AuraOne # Daylight
      ConstraintDescription: must specify a value.
I've got 4 different models which I'm still patching every fw update. That sounds like I'd need 4 different configurations instead of the single one I currently have. It sounds like more work.
jackie_w is offline   Reply With Quote
Old 07-17-2018, 01:15 PM   #137
jcn363
absolute beginner
jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.
 
jcn363's Avatar
 
Posts: 131
Karma: 1730614
Join Date: May 2017
Location: Go with the wind (43°19'17.7"N 2°00'19.4"W)
Device: ka1
Quote:
Originally Posted by jackie_w View Post
I've got 4 different models which I'm still patching every fw update. That sounds like I'd need 4 different configurations instead of the single one I currently have. It sounds like more work.
I realy prefer to make a device dedicated one versus worldwide one.

It depends on the patch and/or the value of parameter/variable. If you pass a number of devices as parameter the patch will made for those devices. If you don't pass a parameter (or var is null) the program acts as now.

This could be a comparative
Spoiler:
Code:
  - FindZlib: "#connectedPixmap {"
  - ReplaceZlib:
      Find:    "#title[qApp_deviceIsTrilogy=true] {\n  font-size: 29px;\n}\n#title[qApp_deviceIsPhoenix=true] {\n  font-size: 36px;\n}\n#title[qApp_deviceIsDragon=true] {\n  font-size: 46px;\n}\n#title[qApp_deviceIsDaylight=true] {\n  font-size: 60px;\n}"
#      Replace: "#title[qApp_deviceIsTrilogy=true]{font-size:33px;}"
#      Replace: "#title[qApp_deviceIsPhoenix=true]{font-size:39px;}"
#      Replace: "#title[qApp_deviceIsDragon=true]{font-size:49px;}"
      Replace: "#title[qApp_deviceIsDaylight=true]{font-size:60px;}"

  - FindZlib: "#connectedPixmap {"
  - ReplaceZlib:
      Find:    "#title[qApp_deviceIsTrilogy=true] {\n  font-size: 29px;\n}\n#title[qApp_deviceIsPhoenix=true] {\n  font-size: 36px;\n}\n#title[qApp_deviceIsDragon=true] {\n  font-size: 46px;\n}\n#title[qApp_deviceIsDaylight=true] {\n  font-size: 60px;\n}"
      Replace: "#title[qApp_deviceIs{{device}}=true] !If [AuraOne, {font-size:60px;}, [Dragon, {font-size:49px;}, [Phoenix, {font-size:39px;}, {font-size:33px;}]]]"

In the first case (now) the user must go patch by patch changing the value he/she wants. In the second one he/she only must say the device once.
I think it's pretty simple for the common user.

Good luck.
jcn363 is offline   Reply With Quote
Old 07-17-2018, 01:43 PM   #138
Terisa de morgan
Wizard
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 4,890
Karma: 5438866
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara,Kobo Aura One, XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Nobody should write after a nap....

Last edited by Terisa de morgan; 07-17-2018 at 02:40 PM.
Terisa de morgan is offline   Reply With Quote
Old 07-17-2018, 02:20 PM   #139
boriar
Addict
boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.
 
Posts: 322
Karma: 279082
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
Like I see, I think is better the second option. With the first you still must modify the patch whenever you use for a different device going through the patch file to comment and uncomment options. With the second you must change only the name of device at the beginning.
But @geek1011, why not to pass the name for device like a parameter?
boriar is offline   Reply With Quote
Old 07-17-2018, 11:51 PM   #140
norbusan
Zealot
norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.
 
Posts: 130
Karma: 82382
Join Date: Jan 2013
Device: Kindle Paperwhite, Kobo Glo
Quote:
Originally Posted by geek1011 View Post
For overriding the in tag, it would be simple (just setting cfg.In). I would need to add pflag for command line parsing, so tell me before you make a PR, if you are planning to. I can do this myself if you want.
Do you prefer the external pflag or the golang internal flag library? Syntax-wise they seem to be rather close.

Adding some command line parsing I would switch to specifying the config yaml via an extra cmd line flag instead of a normal argument?

E.g.
Code:
  kobopatch [--config SomeConfig.yaml] [--firmware PathToFirmware.zip]
WDYT?
norbusan is offline   Reply With Quote
Old 07-18-2018, 09:48 AM   #141
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 688
Karma: 2001813
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Kobo Aura Edition 2, Moto G5
Quote:
Originally Posted by norbusan View Post
Do you prefer the external pflag or the golang internal flag library? Syntax-wise they seem to be rather close.

Adding some command line parsing I would switch to specifying the config yaml via an extra cmd line flag instead of a normal argument?

E.g.
Code:
  kobopatch [--config SomeConfig.yaml] [--firmware PathToFirmware.zip]
WDYT?
I prefer pflag (spf13's fork), as it has better help, supports sort flags, and uses 2 dashes for long flags. Have a look at this to see how I usually implement flags in my apps.

I'd keep the config as a positional argument so Windows users can drag and drop a config file.
geek1011 is offline   Reply With Quote
Old 07-18-2018, 09:52 AM   #142
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 688
Karma: 2001813
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Kobo Aura Edition 2, Moto G5
Quote:
Originally Posted by jcn363 View Post
I realy prefer to make a device dedicated one versus worldwide one.

It depends on the patch and/or the value of parameter/variable. If you pass a number of devices as parameter the patch will made for those devices. If you don't pass a parameter (or var is null) the program acts as now.

This could be a comparative
Spoiler:
Code:
  - FindZlib: "#connectedPixmap {"
  - ReplaceZlib:
      Find:    "#title[qApp_deviceIsTrilogy=true] {\n  font-size: 29px;\n}\n#title[qApp_deviceIsPhoenix=true] {\n  font-size: 36px;\n}\n#title[qApp_deviceIsDragon=true] {\n  font-size: 46px;\n}\n#title[qApp_deviceIsDaylight=true] {\n  font-size: 60px;\n}"
#      Replace: "#title[qApp_deviceIsTrilogy=true]{font-size:33px;}"
#      Replace: "#title[qApp_deviceIsPhoenix=true]{font-size:39px;}"
#      Replace: "#title[qApp_deviceIsDragon=true]{font-size:49px;}"
      Replace: "#title[qApp_deviceIsDaylight=true]{font-size:60px;}"

  - FindZlib: "#connectedPixmap {"
  - ReplaceZlib:
      Find:    "#title[qApp_deviceIsTrilogy=true] {\n  font-size: 29px;\n}\n#title[qApp_deviceIsPhoenix=true] {\n  font-size: 36px;\n}\n#title[qApp_deviceIsDragon=true] {\n  font-size: 46px;\n}\n#title[qApp_deviceIsDaylight=true] {\n  font-size: 60px;\n}"
      Replace: "#title[qApp_deviceIs{{device}}=true] !If [AuraOne, {font-size:60px;}, [Dragon, {font-size:49px;}, [Phoenix, {font-size:39px;}, {font-size:33px;}]]]"

In the first case (now) the user must go patch by patch changing the value he/she wants. In the second one he/she only must say the device once.
I think it's pretty simple for the common user.

Good luck.
Hmm. I'm not totally convinced this is a good idea. This would add a lot of parsing complexity, make patches less readable, and increase the change of mistakes and bugs. The only benefits would be shorter patches and less comments if I understand this correctly.

Also, did you get the quotes working properly?
geek1011 is offline   Reply With Quote
Old 07-19-2018, 03:39 AM   #143
jcn363
absolute beginner
jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.
 
jcn363's Avatar
 
Posts: 131
Karma: 1730614
Join Date: May 2017
Location: Go with the wind (43°19'17.7"N 2°00'19.4"W)
Device: ka1
Quote:
Originally Posted by geek1011 View Post
Hmm. I'm not totally convinced this is a good idea. This would add a lot of parsing complexity, make patches less readable, and increase the change of mistakes and bugs. The only benefits would be shorter patches and less comments if I understand this correctly.

Also, did you get the quotes working properly?
The last first.
I think so. Thanks. There was an extra " ' " hidden.

If you aren't convinced, then you shouldn't do.
Don't worry about. Your decision on the parameter/variable will be the best.
You had fill the main goal (zlib support).

Just in case this helps (I hope so):
I think is a question of choosing between an universal solution and optimized one.

In the first case final user must choose (one by one) all his/her devices need.
And very important: you have spare time, because you are done.

In the second one, user gets what his/her device needs in exchange of a device id, but must run once per device.
You must think on and code.

This reminds me... the code is not optimized at all (there is an entire css four times repeated) and we overload it with more (four or six options for one only device is a lot of dead code).

So, as a final user, what do you want? Do you prefer simplicity or universality?
And you developer?
Yours is the last word. Thanks.

Good luck.
jcn363 is offline   Reply With Quote
Old Today, 03:45 AM   #144
jcn363
absolute beginner
jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.
 
jcn363's Avatar
 
Posts: 131
Karma: 1730614
Join Date: May 2017
Location: Go with the wind (43°19'17.7"N 2°00'19.4"W)
Device: ka1
Two typo on nickel 4.9.11311.

Spoiler:
Code:
#138 (zlib) pos 483c52:
  - FindZlib: "#topVerticalSpacer"
  - ReplaceZlib:
      Find:    "#bottomVerticalSpacer[qApp_deviceIsPhoenix=true] {\n  min-height: 24x;\n  max-height: 24px;\n}"
      Replace: "#bottomVerticalSpacer[qApp_deviceIsPhoenix=true]{min-height:24px;max-height:24px;}"

#48 (zlib) pos 4781f5:
  - FindZlib: "#SelectionMenuView"
  - ReplaceZlib:
      Find:    "#highlight[qApp_deviceIsDaylight=true],\n#search[qApp_deviceIsDaylight=true] {\n  margin-right: 7x;\n}"
      Replace: "#highlight[qApp_deviceIsDaylight=true],#search[qApp_deviceIsDaylight=true]{margin-right:7px;}"

Good luck.
jcn363 is offline   Reply With Quote
Reply

Tags
kobo, kobopatch, patch, patch32lsb

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
kobopatch - A new (WIP) patching system geek1011 Kobo Developer's Corner 93 05-27-2018 03:04 PM
Patching H2O Maillemom Kobo Developer's Corner 8 10-19-2016 09:58 AM
Instructions for patching firmware 3.17.3 GeoffR Kobo Developer's Corner 60 09-17-2015 05:35 PM
Instructions for patching firmware 3.8.0 GeoffR Kobo Developer's Corner 92 10-22-2014 07:22 AM
how to clean more disk space in root file system to upgrade system chinaet iRex 1 12-18-2006 03:54 PM


All times are GMT -4. The time now is 06:03 AM.


MobileRead.com is a privately owned, operated and funded community.