2008年5月28日水曜日

Bulk Loader




http://code.google.com/appengine/articles/bulkload.html

1. c:\google\bulkload フォルダを作成し、ここに以下のファイルを作成。
 myloader.py
 people.csv

2. c:/Program Files/Google/google_appengine/google/appengine/tools/bulkload_client.py
を c:\google\buloload に copy


3. c:\google> dev_appserver.py books/ 作成済みのプログラムを起動

起動まえに 以下のファイルに /load を追加
--- c:\google\books\app.yaml
- url: /
script: books.py

- url: /load
script: myloader.py
login: admin

実行
C:\google\bulkload>bulkload_client.py --filename people.csv
                                  --kind Person
                                  --url http://localhost:8080/load

3. ImportError: No module named google.appengine.ext.bulkload がでるので
3.1 C:\Program Files\Google\google_appengine\google\appengine\ext\bulkload\constants.py
を c:\google\buloload に copyし

3.2 -- c:\google\buloload\bulkload_client.py を一部改訂 --
try:
from google.appengine.ext.bulkload import constants
except:
import constants


3.3 再度実行したが login error となるので books/app.yaml を修正*1
C:\google\bulkload>bulkload_client.py --filename people.csv
                                  --kind Person
                                  --url http://localhost:8080/load
INFO 2008-05-28 21:37:29,276 bulkload_client.py]
            Starting import; maximum 10 entities per post
INFO 2008-05-28 21:37:29,276 bulkload_client.py]
            Importing 3 entities in 75 bytes
ERROR 2008-05-28 21:37:29,292 bulkload_client.py]
             An error occurred while importing: Received code 302:
             Requires login ERROR
     2008-05-28 21:37:29,292 bulkload_client.py]
             Import failed

Success
C:\google\bulkload>
  bulkload_client.py --filename people.csv --kind Person --url http://localhost:8080/load
INFO 2008-05-28 21:37:48,947 bulkload_client.py] Starting import;
           maximum 10 entities per post
INFO 2008-05-28 21:37:48,947 bulkload_client.py] Importing 3 entities in 75 bytes
INFO 2008-05-28 21:37:54,119 bulkload_client.py] Import succcessful

---
*1 bulkload.py は http で post しているので 安易に app.yaml の
   admin 部分のコメントアウトは危険。
   元のアプリケーションに 
    'login_url': users.CreateLoginURL(self.request.uri),
   を追加して、ログインしておく。


Unityでドアの開閉はAnimatorそれともiTween?

Mac Mini M2 の Unity で Sketchup のデータを復元したつづき。 以前、苦労して作成したドアの開閉が動作しないので修復する。 どうやって動かしていたのか、また忘れそうなので記録しておく。             Animator 左右のドア PlaneL,...