Giter Club home page Giter Club logo

collectionsync's Introduction

This extension requires yifanlu's guilauncher to work. It is only tested a 
bit with https://github.com/downloads/yifanlu/KindleLauncher/kindle_launcher_1.0.zip.
Use at your own risk. 

unrar this package, copy the whole collectionSync directory into kindle drive's 
extentsions/ directory(available only after you install the launcher). Reboot.
You should see a new menu in launcher->"generate collections". 

Be careful!! Any existing collections will be deleted, new collections with be 
created according to currrent contents on the drive:
   a/b.txt
   a/c/d.txt
   a/c/e.txt
=> a(1)
   a-c(2)

The process might be quite slow if you have lots of books. To let you know a bit 
about the progress, the plugin will first put kindle into screensaver mode until
it finish generate all necessary commands(/mnt/us/extensions/collectionSync/commands
file), then start to perform the real work(delete/insert/update collections, you can
see my items and page numbers changing in this phase), at last it will enter screensaver
mode again to tell you all work is done.

Known limits:
 1, It uses Chinese character '-' to seperate directory hierarchy, if your directories
contains such character, generation will (partly) fail.
 2012/3/29 update: This is removed now, we will wait for the scanner to do its job(2, 
Kindle is slow at scanning books. After copying lots of books onto it, you should wait 
enough time for it to finish the generation of entries database items. Otherwise the 
script might fail due to database operation conflicts with system.)

Happy Hacking.

In Chinese:

这个扩展依赖于yifanlu的guilauncher插件,先安装https://github.com/downloads/yifanlu/
KindleLauncher/kindle_launcher_1.0.zip,然后把本安装包解压后得到的collectSync目录
拷贝到kindle盘extensions目录下,重启,就会看到menu-launcher菜单下有新的选项"generate
collections",选中后就会根据您的kindle目录下的内容生成分类。

这个扩展本质上是一个hack,作者对可能的风险不作任何担保。

生成分类的过程大致如下:根据documents目录下的内容,只要某个目录下有文件,就会生成相应分类,
分类名由目录名生成,例如:
   a/b.txt
   a/c/d.txt
   a/c/e.txt
会生成:
   a(1)   //分类a下有一个文件
   a-c(2) //分类a-c下有两个文件

如果有很多书,这个过程可能会很慢。为了多少给点进度提示,它会先进入屏保,在完成了命令文件
(/mnt/us/extensions/collectionSync/commands)的生成之后,关闭屏保,再进行实际的工作(
即commands文件的删除分类、插入分类、更新分类内容的命令,这个过程你在首页会看到my items的
数量和page的数量在变化,一般是先增加再减少),所有工作完成后再次进入屏保。

如果开始工作的时候kindle还没有完成扫描书目,它会等待,每三秒换一下屏保,以提示还在工作。

2012/3/29: 为了方便查看问题,增加了一些调试信息输出,如果有任何问题,可以查看
   extensions/collectionSync/目录的commands和log文件, commands是json命令,log是调试信息
如果成功,log的输出应该类似:
Started at  Thu Mar 29 15:53:29 UTC 2012
Successfully done.

如果开始的时候要等scanner,则类似这样:
Kindle scanner has not finished scanned all books, Waiting start at date Thu Mar 29 15:54:24 UTC 2012
        w       Int     doFullScan
        rw      Str     logMask [0xffff0000]
        rw      Str     logLevel        [Current log level=info
(Possible levels: all, perf, debug[9-0], info, warn, error, crit, none)]
        r       Int     fullScanStatus  [5]
Started at  Thu Mar 29 15:54:39 UTC 2012
Successfully done.

如果有些书格式kindle不认识,还会有一些warning信息。

如果由于某种原因失败了,会把系统的调试信息dump在log文件里。

已知限制:
  1, 扩展用中文的"-"字符来分割目录层次,如果目录中有这个字符会导致生成失败。
  2012/3/29, 这个应该已经修复了。(2, 扩展依赖于kindle自身的文件扫描和数据库操作接口,在导
入大量书的时候,应该给kindle足够的时间扫描书目,完成基本的数据库操作,否则在生成分类时扩展
的数据库操作和系统的数据库操作可能冲突,导致超时失败。)

Fuxin Zhang
2012/3/29

collectionsync's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.