Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 11-29-2015, 12:07 PM   #181
oren64
I need a chapter break
oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.
 
oren64's Avatar
 
Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
Quote:
Originally Posted by AlPe View Post
@oren64: I found and (hopefully) fixed the problem with outputting to a relative path, I pushed a new version on GitHub and PyPI, v3.1.0. You can upgrade penelope with:

> pip install penelope --upgrade
It generate dicthtml file in the folder.
it didn't delete the tmp... files in C:\...\local\Temp.

Last edited by oren64; 12-01-2015 at 02:29 AM.
oren64 is offline   Reply With Quote
Old 12-02-2015, 08:37 AM   #182
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
Quote:
It generate dicthtml file in the folder.
Good.

Quote:
it didn't delete the tmp... files in C:\...\local\Temp.
Are you using the -k flag (or --keep) ? If so, that's the expected behavior.

If you not, then that's a (Windows) bug. I cannot reproduce it in Linux.

It is quite strange, as I use the Python built-in tempfile module to create the temporary directories and files, and they are supposed to be removed automatically (EDIT for clarity: by my code) as soon as the execution ends (without errors). Are you sure that the tmp* directories you are seeing are not coming from previous executions gone bad? Just delete all of them, run penelope again, and see if a new tmp* directory persists after the execution ended.

Last edited by AlPe; 12-02-2015 at 09:29 AM.
AlPe is offline   Reply With Quote
Advert
Old 12-02-2015, 09:20 AM   #183
oren64
I need a chapter break
oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.
 
oren64's Avatar
 
Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
Without the -k flag it's only deleting the folder with the files(d.dict,d.ifo...), and folder with the HTML files not deleting.
despite that there is a ([DEBU]delete temp dir...), maybe you need to delete the folder after the zip file is created, but it's not a big deal to me.
oren64 is offline   Reply With Quote
Old 12-02-2015, 09:32 AM   #184
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
OK, got it. It appears to be a issue with shutil.rmtree() (the function that is supposed to remove the temporary directory) on Windows. I will investigate.

For now, the only possible workaround consists in manually purging the Temp directory.
AlPe is offline   Reply With Quote
Old 12-02-2015, 12:11 PM   #185
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
Uploaded penelope 3.1.1(.1) to PyPI, including a workaround for forcing the removal of temp directories on Windows. Try upgrading:

> pip install penelope --upgrade

and see it works for you.
AlPe is offline   Reply With Quote
Advert
Old 12-02-2015, 01:42 PM   #186
oren64
I need a chapter break
oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.
 
oren64's Avatar
 
Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
Almost it delete the HTML files except to 21 files.

Edit:files belong to English-Hebrew dictionary, I try with English dictionary and the folder deleted.
Attached Files
File Type: zip tmpnz4lsy.zip (9.5 KB, 255 views)

Last edited by oren64; 12-02-2015 at 02:19 PM.
oren64 is offline   Reply With Quote
Old 12-02-2015, 02:05 PM   #187
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
Woah... now it seems that the problem is that those file names contain accented (i.e., not ASCII-7) letters. I guess I will need to dig the Python os documentation and hacks...
AlPe is offline   Reply With Quote
Old 12-03-2015, 06:46 AM   #188
embryo
Fanatic
embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.
 
embryo's Avatar
 
Posts: 529
Karma: 64554
Join Date: Aug 2013
Device: Kobo Glo, GloHD
Wellcome to the Python's 2.x unicode nightmare...
The way I do it, is to rename all the temp filenames to ascii - do what I want with them and rename them back to the original name.
embryo is offline   Reply With Quote
Old 12-03-2015, 07:52 AM   #189
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
Since v3.0, Penelope works with both Python 2.7.x and 3.x.

It looks more like a shell encoding problem.

I tried reproducing oren64's issue on a Windows Vista machine (I do not have a more recent Windows machine), and with Python 2.7.x I was not able to, penelope v3.1.1 worked as expected, including cleaning up all the temporary files. I also tried changing the windows prompt encoding using chcp and it still worked as expected, also with ??.html files containing non-ASCII characters.

Then, I thought the bug was with Python 3.5 only. I tried installing it on the same Vista machine, but I was not able to run it since it complains about a missing DLL, and I gave up on it.

Yeah, maybe the workaround "rename the ??.html files to say 99.html before removing them" works, but I would like to be able to reproduce the issue and understand it, before throwing in random hacks.

@oren64: sorry, but for now you need to clean your Temp manually. What is the output of

> chcp

(It should print the current shell encoding)

Can you try changing it to latin1 and try again?

> chcp 850

Have you tried using Python 2.7.x instead?
AlPe is offline   Reply With Quote
Old 12-03-2015, 10:04 AM   #190
embryo
Fanatic
embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.
 
embryo's Avatar
 
Posts: 529
Karma: 64554
Join Date: Aug 2013
Device: Kobo Glo, GloHD
The killer combination is Python 2.x on Windows trying anything with command line (popen).
I think its a known bug, but they don't fix it since they don't really support 2.x versions anymore...
... or at least that was my conclusion when I had hit the same wall.
Any other solution would be really appreciated.
embryo is offline   Reply With Quote
Old 12-03-2015, 11:11 AM   #191
oren64
I need a chapter break
oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.
 
oren64's Avatar
 
Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
Quote:
Originally Posted by AlPe View Post
@oren64: sorry, but for now you need to clean your Temp manually. What is the output of

> chcp

(It should print the current shell encoding)

Can you try changing it to latin1 and try again?

> chcp 850

Have you tried using Python 2.7.x instead?
I am using Python 2.7.10, it's only 5kb and not 5-10mb so it okay, and it not happen on all dictionaries, i try with English dictionary and folder deleted.

I don't understand what to do with "chcp" where and how do i use it?

Last edited by oren64; 12-03-2015 at 01:42 PM.
oren64 is offline   Reply With Quote
Old 12-03-2015, 12:14 PM   #192
embryo
Fanatic
embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.
 
embryo's Avatar
 
Posts: 529
Karma: 64554
Join Date: Aug 2013
Device: Kobo Glo, GloHD
Quote:
Originally Posted by oren64 View Post
I don't understand what to do with "chcp" where and how do i use it?
Just open a command prompt (search for cmd.exe) type chcp and hit enter.
It tells you what is the code page that the terminal is using.
To change it, type chcp, the desired code page number and hit enter.
embryo is offline   Reply With Quote
Old 12-03-2015, 02:31 PM   #193
oren64
I need a chapter break
oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.
 
oren64's Avatar
 
Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
Quote:
Originally Posted by embryo View Post
Just open a command prompt (search for cmd.exe) type chcp and hit enter.
It tells you what is the code page that the terminal is using.
To change it, type chcp, the desired code page number and hit enter.
my chcp is 862: OEM Hebrew; Hebrew (DOS).

I tried all the Latin i can find 850,858,852,1252... , and it didn't work.
if i exit cmd.exe and open it again it go back to 862.

EDIT: I tried to install penelope on 3.4.3 and get an error.

Quote:
Originally Posted by AlPe View Post
If the resulting dictionary works on your Kobo, you are good. Otherwise, try:

2. --group-by-prefix-length=1 --group-by-prefix-merge-min-size=1000 --group-by-prefix-merge-across-first

And again see if that works on your Kobo.
I try making the Chinese-Russian Dictionary and it create a zip file, but it also didn't delete all the HTML files in Chinese.
Attached Thumbnails
Click image for larger version

Name:	1.PNG
Views:	370
Size:	39.4 KB
ID:	144284  
Attached Files
File Type: zip dicthtml-zho-rus.zip (10.41 MB, 260 views)

Last edited by oren64; 12-03-2015 at 03:40 PM.
oren64 is offline   Reply With Quote
Old 12-04-2015, 08:45 AM   #194
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
Now I am a bit confused.

Forget about the issue with the Temp/ files not being deleted, and the fact that there is an error installing Python 3.x.

I understand the following:

1. You installed Python 2.7.x and penelope
2. Using Python 2.7.x, you generated the dictionary you attached in the previous post
3. There are some files in Temp/ that are not deleted by Penelope

Now:

A. Is the dictionary file output in 2. working? If so, you are good.

B. About issue 3. : just delete them manually or periodically use the Windows "cleanup" tool (I do not know how it is called now --- it deletes all the temporary directories in the system).

I understand it is inconvenient, but I cannot fix the issue if I cannot reproduce it:

i) On my Vista machine,
ii) with Python 2.7.x and
iii) penelope v3.1.1 and
iv) the non-ASCII-files you provided a few posts ago and
v) chcp=850,

my temporary files got deleted as expected.

(In the weekend I will try using chcp=862 and see if I can reproduce the bug.)

Last edited by AlPe; 12-04-2015 at 08:48 AM.
AlPe is offline   Reply With Quote
Old 12-04-2015, 09:35 AM   #195
oren64
I need a chapter break
oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.
 
oren64's Avatar
 
Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
Quote:
Originally Posted by AlPe View Post
1. You installed Python 2.7.x and penelope
2. Using Python 2.7.x, you generated the dictionary you attached in the previous post
3. There are some files in Temp/ that are not deleted by Penelope
1 & 2) yes, it create the dicthtml.zip in the folder and i used 2.7.10.
3) it didn't delete the Temp folder in C:\...\lokal\temp, with Html files in Chinese (141 files), it only deleted (words,1.html, b.html).

I also tried Hebrew-Hebrew dictionary and it delete the temp folder.

Quote:
B. About issue 3. : just delete them manually or periodically use the Windows "cleanup" tool (I do not know how it is called now --- it deletes all the temporary directories in the system)
I find CCleaner software.
oren64 is offline   Reply With Quote
Reply

Tags
kobo dictionaries


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New custom English dictionaries ShellShock Kobo Developer's Corner 166 09-22-2020 02:48 PM
Kobo desktop loading dictionaries brudigia Kobo Reader 1 07-16-2014 12:55 PM
Touch building custom dictionaries, especially Japanese-English tshering Kobo Reader 0 07-12-2012 06:00 PM
Custom dictionaries for 350/650? 1drey Sony Reader 5 12-28-2010 12:49 PM
non-English dictionaries in eReader on iPod Touch? ficbot Reading and Management 1 10-11-2008 09:04 AM


All times are GMT -4. The time now is 09:08 PM.


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