九月 20, 2012

limodou的學習記錄
limodou
is about »
» 百度空间

全新百度空间亮相登场,为所有hier呈现了超炫的视觉体验。新版空间开启了百度空间探索精彩生活的一扇大门,抛却喧嚣和包袱,重拾对内容最初的信仰,回归对生活最真挚的记录,以全新的视觉风格、简洁流畅的体验,实现蜕变之后的新生。》》》体验新版

四月 26, 2012

limodou的學習記錄
limodou
is about »
» µ±Ç°¸üÐÂÖ÷ÒªÒÔÐÂÀË΢²©ÎªÖ÷

²»ÊǸøÐÂÀË×ö¹ã¸æ¡£Ò»¡¢Îһᾭ³£ÔÚ΢²©ÉÏ·¢Ð©¶¯Ì¬£¬±ÈÈçuliweb, plugsµÈ¡£¶þ¡¢°Ù¶Èrss¶©ÔÄÂÒÂë¡£Èý¡¢ÐÂÀËÓÐÇᲩ¿Í£¬¿ÉÒÔд³¤ÎÄ£¬ÕâÑùÎҾͿÉÒÔÖ»ÔÚÒ»¸öµØ·½Ð´ÁË¡£ÀÁµÃcopyÀ´copyÈ¥µÄ¡£


Àà±ð£ºÄ¬ÈÏ·ÖÀ࠲鿴ÆÀÂÛ

三月 26, 2012

limodou的學習記錄
limodou
is about »
» °Ù¶È²©¿ÍΪʲô×ÜÊÇÂÒÂ룿

°Ù¶ÈµÄ²©¿ÍʹÓõıàÂëÊÇGBK£¬½á¹ûÓÐЩrss readerʶ±ð¾ÍÓÐÎÊÌâ¿´ÉÏÈ¥¾ÍÊÇÂÒÂë¡£´òËãÊÔÊÔתÏòÐÂÀ˵ÄÇᲩ¿ÍÁË¡£

 

http://qing.weibo.com/u/1689940061


Àà±ð£ºÐÄÇé¹ÊÊ ²é¿´ÆÀÂÛ

三月 25, 2012

limodou的學習記錄
limodou
is about »
» parsimonious Ò»¸öPEG·ÖÎöÄ£¿é

ÕâÁ½ÌìÒ»Ö±ÔÚ¿¼ÂÇÈçºÎʵÏÖÒ»¸ö±È½ÏcoolµÄ»¥¶¯Ê½±àд½Ì³ÌµÄ¹¦ÄÜ£¬µ±È»Ò²¿ÉÒÔÓÃÀ´Ð´²©¿Í£¬×÷Ϊ·ÅÔÚ uliweb.clkg.org ÉϵÄÒ»¸ö½Ì³ÌµÄÑùÀý¡£Õâ¸öÑùÀý»á±ß×ö±ßд¡£ÄÇôºÜÖØÒªµÄÒ»¸öÎÊÌâ¾ÍÊÇÈçºÎ¸ù¾Ý¼ÈëµÄÄÚÈÝÉú³ÉÒ×ÓÚʹÓõÄhtmlµÄÒ³Ã档Ŀǰ²»ÏëʹÓÃËù¼û¼´ËùµÃµÄ±à¼­Æ÷£¬ÕâÑùÉú³ÉÒ³Ãæ±È½ÏÂé·³¡£´òËãʹÓýṹ»¯Îı¾£¬²»¹ýÉÏ´«Í¼Æ¬¿ÉÄܲ»ÊǺܷ½±ã£¬²»¹ýû̫´ó¹Øϵ¡£µ«ÊÇÈçºÎ½øÐнâÎö£¬²ÉÓÃÄĸö°ü¾Í³ÉΪһ¸öÎÊÌâ¡£ÎÒÏ£Íû¸ñʽ¾¡¿ÉÄܵļòµ¥¡£ÕýºÃÕâÁ½Ìì¿´ÁËpyconÉϵÄÒ»¸öÊÓƵ

 

Parsing Horrible Things with Python. ÉÏÃæ½éÉÜÁËÑݽ²ÕßÓõļ¸¸ö½âÎöÆ÷£¬ºÜ¶àÊÇ»ùÓÚPEG(¹ØÓÚPEG http://www.brynosaurus.com/pub/lang/peg.pdf ÎÒÒ²²»¶®£¬µÚÒ»´ÎÌý˵)·½Ê½µÄ½âÎö¡£ÓÚÊÇÎÒÏëÊÔÊÔʹÓÃparsimonious×÷Ò»¸ö½âÎöÆ÷¡£ÓÚÊÇ¿ªÊ¼ÏÂÔØ£¬³¢ÊÔ¡£²»¹ý£¬·¢ÏÖÄ¿Ç°»¹ÎÞ·¨Ö»Ð´Îı¾µÄÐÎʽ¾ÍÉú³ÉÒ»¸ö½âÎöÆ÷£¬Îª´ËÎÒдÁËÒ»¸öÎÊÌâÔÚgithubÉÏ¡£×÷Õ߻ظ´ÊÇÈÃÎÒ¹Ø×¢Ëü£¬Ä¿Ç°Õâ¸ö¹¦ÄÜ»¹Ã»ÓÐʵÏÖ£¬Ö»ÊÇʵÏÖÁË¿ÉÒÔ½âÎöPEGÓï·¨¡£¿´µ½ËüµÄµ×²ãʵÏÖÆäʵ»¹ÊÇ»ùÓÚÕýÔò±í´ïʽ£¬Ö»²»¹ýдÆðÀ´¿ÉÒÔÈÝÒ׵㡣ÓÚÊÇÎÒ»¹ÊÇÔÚÕâ¸ö»ù±¾ÉϽøÐÐÁ˳¢ÊÔ¡£·¢ÏÖ³ýÁË»¹ÎÞ·¨¶¨ÒåÎı¾µÄGrammarÖ®Í⣬ËüÌṩµÄVisitorÒ²²»ÊÇÎÒÏëÏóµÄÄÇÑù¹¤×÷¡£²»¹ý£¬ËüÒѾ­¿ÉÒÔÉú³ÉASTµÄÊ÷£¬ÕâÒ»µã»¹ÊDz»´í¡£

½ñÌìÔÚ³¢ÊÔʱ·¢ÏÖÔÚ´òÓ¡ÓÐunicodeµÄ½áµãʱ»á±¨´í£¬ÓÚÊÇÎÒ·¢ÁËÒ»¸öÎÊÌâÔÚgithubÉÏ£¬ÎÒÄ¿Ç°ÊÇÊÖ¹¤ÐÞ¸ÄÁËËüµÄ´úÂëÕâÑùÎÒ¿ÉÒÔ¼ÌÐøʵÏÖÏÂÈ¥¡£ÎÒÏÖÔÚÏë×öµÄ¾ÍÊÇ×öÒ»¸öÏóWikiÒ»ÑùµÄ½âÎöÆ÷£¬¼õÉÙʹÓÃËõ½üµÄ·½Ê½¡£ÕâÑù¾Í¿ÉÒÔδÀ´ÓÃÓڽ̳ÌÍøÕ¾ÄÚÈݵÄת“Q¹¦ÄÜÁË¡£


Àà±ð£ºUliweb ²é¿´ÆÀÂÛ

三月 15, 2012

limodou的學習記錄
limodou
is about »
» uliwebµÄÂÛ̳

uliwebµÄÂÛ̳ÆäʵÎÒÒѾ­²¿Êð¹ýºÜ¶à´ÎÁË£¬Ïódotcloud, saeµÈ£¬ÏÖÔÚÓÉasmcos´î½¨ÁËÒ»¸öеģ¬µØÖ·ÔÚ£º http://uliweb.clkg.org ¡£·Ç³£¸Ðл¡£ÏÖÔÚµÄforum¹¦ÄÜÒѾ­Ê¹µÃÁËbootstrapÑùʽ£¬±ÈÒÔÇ°Òª¸üºÃ¿´Ò»Ð©£¬¹¦ÄÜÉÏÒ²×öÁËһЩ‰ˆÇ¿£¬±ÈÈ版¼ÓÁ˶Ôij¸öÈ˵Ļظ´¹¦ÄÜ£¬²»¹ý»¹ÓеãСbug£¬ÓÐʱ¼äÔÙÓÅ»¯¡£

uliwebºÍplugsÒ²Ò»Ö±ÔڸĽø¡£Ä¿Ç°ÎÒ¸ú×Ùbootstrap±È½Ï¶à£¬Ä¿Ç°plugsÖеÄbootstrapÒѾ­ÊÇ2.0.1ÁË¡£¹ý¼¸ÌìÎÒÉýµ½2.0.2¡£jquery×î¸ß°æ±¾ÊÇ1.7.2b1£¬Èç¹û³öÕýʽµÄÒ²Òª¸üÐÂÉÏ¡£plugsµÄlayout¿ªÊ¼°´·ÖÀàÀ´´¦Àí£¬ÒѾ­‰ˆ¼ÓÁËbootstrapµÄlayout£¬ÓëÔ­À´µÄlayout¼æÈÝ¡£Í¬Ê±¸ÄдÁËһЩģ°å¡£

uliwebµÄformÒ²×öÁ˸üУ¬Ö÷ÒªÊÇÖ§³ÖÁËBootstrapµÄÑùʽ£¬Ä¿Ç°È±Ê¡µÄÑùʽ¾ÍÊÇBootstrapLayout¡£

½ñÌìÓÖÊÔÑé³É¹¦ÔÚpypyÉÏÅÜuliweb¡£

uliwebµÄORM»¹ÏëÔÙ×öһЩÓÅ»¯£¬È版¼Óexist()·½·¨£¬orm appÖ§³Ö¶ÌÁ¬½Ó¡£

¶Ôuliweb¸ÐÐËȤµÄÈË¿ÉÒÔÔÚuliwebµÄÓʼþÁбí»òÉÏÃæµÄÂÛ̳ÓëÎÒ½»Á÷¡£ÉõÖÁÓÐÐËȤ²ÎÓ뿪·¢¶¼ÊÇ»¶Ó­µÄ¡£


Àà±ð£ºÄ¬ÈÏ·ÖÀ࠲鿴ÆÀÂÛ

十一月 15, 2011

limodou的學習記錄
limodou
is about »
» uliweb·¢²¼0.0.1a7°æ±¾ÁË

ÒѾ­ÔÚpypiÉÏ¿ÉÒÔ¿´µ½£¬²¢ÇÒ¿ÉÒÔͨ¹ýcode.googleºÍgithubÀ´ÏÂÔØ¡£Ê¹ÓÃeasy_install Ó¦¸ÃÒ²¿ÉÒÔ°²×°¡£

ÏÖÔÚsaeµÄÄÚ²â°æ±¾ÒѾ­ÄÚÖÃÁËuliwebµÄ°æ±¾£¬²¢ÇÒsqlalchemyÒ²°²×°ÁË£¬°æ±¾ÊÇ0.7.3¡£

Ϊʲô°æ±¾ºÅÕâôµÍ£¬ÒòΪÎҸоõ»¹²»ÊÇÌرðµÄÂúÒ⣬µÈÔÙÌí¼ÓһЩÐµĹ¦ÄÜÕùÈ¡Éý¼¶µ½0.0.1°É¡£×îÐÂÒªÌí¼ÓµÄ¹¦Äܼƻ®:

Êý¾Ýµ¼Èëµ¼³ö‰ˆ¼Ó¶Ôcsv, excelµÄÖ§³Ö
‰ˆ¼ÓÒ»¸öÊý¾Ý¿âά»¤µÄ½çÃ棬½«·ÅÔÚplugsÖУ¬ÒÔ±ã¿ÉÒÔÔÚsaeÉÏʹÓÃ

½«form, generic, dbuploadÎĵµÐ´Íê

bug fix

ºóÃ滹ҪÍê³ÉµÄ£º

plugsÏà¹ØµÄÎĵµ

ormµÄ½øÒ»²½ÓÅ»¯

CRUDµÄ´úÂë¿ò¼ÜµÄÉú³É

forum¹¦ÄܵĽøÒ»²½ÓÅ»¯

¿ª·¢Ò»¸öBlog app

rss feedÉú³ÉÖ§³Ö

develop¹¦ÄÜʹÓÃjqueryÖØд

Óëin.jsµÄ¼¯³É

 


Àà±ð£ºUliweb ²é¿´ÆÀÂÛ

十一月 12, 2011

limodou的學習記錄
limodou
is about »
» uliweb×¼±¸·¢²¼Ð°汾ÁË

°æ±¾½«ÊÇ0.0.1a7,²»¹ý»¹ÓÐһЩûŪÍêµÄ¡£ÓÐһЩ±ä»¯»áÔì³ÉÓëÏÖÓеijÌÐò²»¼æÈݵĵط½£º

1. MiddlewareµÄÅäÖÃд·¨±ä»¯

Ô­À´ÊÇÔÚGLOBALÏ£¬ÏÖÔÚ¶ÀÁ¢ÁË£¬ÏÖÔÚµÄд·¨ÊÇ£º

[MIDDLEWARES]
name = 'middleware_class_path'[, order]

ÎĵµËµÃ÷£º http://readthedocs.org/docs/uliweb/en/latest/middleware.html#id4

Ó°Ïì×î´óµÄ¿ÉÄܾÍÊÇapps/settings.iniÁË£¬Èç¹ûÄãÓõ½ÊÂÎñ£¬¿ÉÄÜ»áдtransaction_middleware£¬ÄÇô¿ÉÄÜÒªÐ޸ġ£ÆäËüµÄmiddleÒ»°ã¶¼ÔÚij¸öappϵÄsettings.iniÖж¨ÒåºÃÁË£¬Ò»°ã²»ÓÃÔÙÖظ´¶¨Ò壬ËùÒÔÓ°Ïì²»´ó¡£


2. appÒÀÀµ¶¨Òå±ä»¯¡£Ô­À´ÊÇÔÚappϵÄconfig.iniÖеÄ[DEFAULT]ÖУ¬ÏÖÔÚÐÞ¸ÄΪ[DEPENDS]ÁË¡£

ÒÔÉÏÄÚÈÝ£¬Ö»ÒªÊÇÉæ¼°µ½uliwebºÍplugsµÄapp¶¼ÒѾ­½øÐÐÁËÐ޸ġ£Ö»ÓÐ×ÔÒѶ¨ÒåµÄappºÍsettingsÒªÊÖ¹¤ÐÞ¸Äһϡ£


Àà±ð£ºUliweb ²é¿´ÆÀÂÛ

十一月 10, 2011

limodou的學習記錄
limodou
is about »
» sphinx i18nµÄÖ§³Ö

ʹÓÃSpninxÊÇÖ§³Öi18nµÄ£¬ÎĵµÔÚÕâÀï¡£

Ò»¡¢·­Òë

¾­¹ýÎÒµÄÊÔÑ飬¾ßÌåµÄÃüÁî¾ÍÊÇ£º

sphinx-build -b gettext -d ../locale/doctrees ./ ../locale/en

-b gettext ±íʾҪÉú³Épot¸ñʽ

-d ../locale/doctrees ºÃÏóÊÇ»º´æ

./ Ô´ÎļþĿ¼

../locale/en Êä³öĿ¼

Õâ¸öÃüÁîÊÇ¿¼ÂÇÒÔÏÂĿ¼½á¹¹£º

/project

    /docs

        #you are here

    /locale

        /en

ÄãÔÚdocsĿ¼ÏÂÀ´½øÐвÙ×÷¡£Éú³Épotºó¾Í¿ÉÒÔ·­ÒëÁË¡£

ÒÔÉÏÃæΪÀý£¬·­ÒëÍêµÄPOÎļþ·Åµ½ locale/en/LC_MESSAGES Ï£¬Í¬Ê±Éú³ÉmoÎļþ¡£

¶þ¡¢Éú³ÉÎĵµ

ÕâÑùmo×¼±¸Íê³É¡£ÏÂÃæÔÙ´Îͨ¹ýÕý³£µÄ·­ÒëÀ´Éú³ÉÄ¿±ê½á¹û£¬Èçhtml¸ñʽÎĵµ¡£

Ê×ÏÈÒª¼ì²éconf.pyÖÐÊÇ·ñÓÐlocale_dirsµÄÅäÖã¬Èç¹ûûÓУ¬ÔòÌí¼Ó½øÈ¥:

locale_dirs = ['../locale']

ÕâÀï¿ÉÒÔÌí¼Ó¶à¸ö¡£È»ºó£¬»òÕßÖ±½ÓÐÞ¸Äconf.pyÖеÄlanaguageµÄֵΪĿ±êÓïÑÔ£¬»òÕßÔÚ±àÒëʱÔÚÃüÁîÐÐÀ´Ö¸¶¨£¬È磺

sphinx-build -b html -d ../html/doctrees -D language=zh_CN ./ ../html

ÕâÀï²ÎÊý½âÊÍһϣº

-b html ½«Éú³Éhtml¸ñʽÎĵµ

-d ../html/doctrees »º´æĿ¼£¬ÕâÀïºÍlocaleÒª²»Í¬£¬²»È»»á±¨´í

-D language=zh_CN ÔÚÃüÁîÐÐÖ¸¶¨ÐÞ¸ÄÅäÖÃÖеÄlanaugeµÄÖµ£¬ÕâÀïΪzh_CN¡£


Àà±ð£ºPython ²é¿´ÆÀÂÛ

十一月 9, 2011

limodou的學習記錄
limodou
is about »
» UliPad 4.1ÒѾ­·¢²¼

ҲûʲôÌرðµÄ¸üУ¬²»¹ý°ÑÒÔÇ°»ýÀ۵Ķ«Î÷Éú³ÉÁËÒ»¸ö°æ±¾¡£

  1. Upgrade winpdb version to 1.4.8
  2. Improve Edit->Format->Wrap Text functionality to suit for reStructuredText wrap
  3. Made memo file configurable thanks to Helio Perroni Filho
  4. Add Bash support thanks to Helio Perroni Filho
  5. Add some useful methods to support scripts files. Such as emptytab, newtab, etc. thanks to Helio Perroni Filho
  6. Add Lua support thanks to zhangchunlin
  7. Improve python file detect according to #! /usr/bin/env python thanks to zhangchunlin
  8. Add default color theme support, you can set it in Preference
  9. Add Create Python Package menu in context menu of Directory Browser Window
  10. Improve web2py plugin
  11. Improve regex window, and when you set Unicode flag, it'll automatically convert \uXXXX to unichr
  12. Fix strip tailing spaces bug
ÏÂÔصØÖ·: http://ulipad.googlecode.com/files/ulipad.4.1.zip

 


Àà±ð£ºUlipad ²é¿´ÆÀÂÛ

十月 26, 2011

limodou的學習記錄
limodou
is about »
» ¹ØÓÚÈçºÎʹÓÃUpload App½øÐÐÎļþÉÏ´«µÄÎĵµ

²Î¼û http://readthedocs.org/docs/uliweb/en/latest/app_upload.html


Àà±ð£ºUliweb ²é¿´ÆÀÂÛ

十月 22, 2011

limodou的學習記錄
limodou
is about »
» Ìí¼ÓrbacʹÓõÄÎĵµ

µØÖ·£º http://uliweb.readthedocs.org/en/latest/app_rbac.html


Àà±ð£ºUliweb ²é¿´ÆÀÂÛ

» ÏòUlipadµÄÎı¾»ØÈƹ¦ÄÜÌí¼ÓÐÐβ×Ö·û´¦Àí¹¦ÄÜ

ÔÚдrstÎĵµÊ±Óöµ½Ò»¸öÎÊÌ⣺ÒòΪÐí¶àʱºò£¬Ò»¸ö¶ÎÂäµÄÎı¾±È½Ï³¤£¬Òò´ËÎÒÒ»°ãÊÇ“QÐÐÀ´Ð´¡£µ«ÊÇÓÐÒ»¸öÎÊÌâ¾ÍÊÇ£¬Í¨¹ýreStructuredText´¦Àíºó£¬»Ø³µ±ä³ÉÁË¿Õ¸ñ£¬¶øÈç¹ûÔÚºóÃæÌí¼Ó'\'¾ÍûÓÐÎÊÌâ¡£µ«ÊÇÊÖ¹¤Ìí¼ÓÌ«Âé·³ÁË£¬ÓÚÊÇÎÒÔÚulipadÔ­À´µÄÎı¾»ØÈƹ¦ÄÜÉÏ×öÁËÓÅ»¯¡£Ô­À´µÄÎı¾»ØÈƲ»ÄÜ´¦ÀíÐÐβ·û£¬ÏÖÔÚÎÒÌí¼ÓÁËÁ½Ï¼ûÏÂͼ£º


Remove Tailing CharactersµÄ×÷ÓÃÊÇɾ³ýÐÐβµÄÌØÊâ×Ö·û£¬±ÈÈçÊÇ'\'

Add Tailing CharactersµÄ×÷ÓÃÊÇÎı¾»ØÈÆʱ£¬Ã¿ÐÐ×îºóÌí¼ÓµÄ×Ö·û£¬±ÈÈçÊÇ'\'

Õâ¸ö¹¦ÄÜʹÓÃʱ£¬Ê×ÏÈҪѡÖÐÎı¾£¬È»ºó¿ÉÒÔͨ¹ý°´¿ì½Ý¼üCtrl+Shift+T»òͨ¹ý[Edit]²Ëµ¥»òÊó±êÓÒ¼ü²Ëµ¥[Format]->[Wrap Text...]À´¼¤»î¡£

width±íʾ×ܵÄÁпí

Indent±íʾÿÐеÄËõ½ü×Ö·û£¬Ê×ÏȳýÍâ

First Line Indent ΪÊ×ÏÈËõ½üµÄ×Ö·û

Skip Begging Characters ΪºöÂÔÿÐпªÊ¼µÄ×Ö·û£¬Èç#»ò¿Õ¸ñ

È»ºóµãOKºó£¬»á×Ô¶¯¶ÔÑ¡ÖÐÎı¾½øÐÐÖØÅÅ¡£

Òò´ËÔÙдrstʱ»á±È½Ï·½±ã½øÐд¦ÀíÁË¡£

 


Àà±ð£ºUlipad ²é¿´ÆÀÂÛ

十月 19, 2011

limodou的學習記錄
limodou
is about »
» ÔÚwindowsÏ°²×°LessµÄ¼Ç¼

ÔÚÎÒµÄÏîÄ¿ÖпªÊ¼Ê¹ÓÃbootstrap£¬²»¹ýÈÃÎҸоõµ½²»ÂúÒâµÄÊÇËü°ÑһЩ»ù±¾µÄ±êÇ©µÄÑùʽҲÐÞ¸ÄÁË£¬Èç:tableµÈ£¬ÕâÑù¾ÍÔì³ÉºÍÎÒÒÔǰʹÓõÄһЩcss»áÓÐһЩ³åÍ»£¬Òò´ËÎÒ´òËãÊÔןÄÔìһϣ¬½«Ä³Ð©Ñùʽµ¥¶ÀÓÃclassÀ´¶¨Ò壬²»Ö±½ÓÔÚÔ­±êÇ©É϶¨Òå¡£¶øbootstrapʹÓÃÁËLess(http://www.lesscss.org)À´Éú³Écss£¬Òò´ËÖ±½ÓÐÞ¸Äcss²¢²»Ì«ºÃ¡£ÓÚÊÇ´òËã×°Ò»¸öLessµÄ¹¤¾ßÀ´´¦Àí¡£

ÔÚbootstrapµÄÎĵµÖÐ˵ÊÇʹÓÃnpm install lessÀ´°²×°¡£²»¹ýnpmÊÇnode.jsµÄ°ü¹ÜÀíÆ÷£¬ËùÒÔÒªÏëʹÓÃnpm֮ǰ£¬ÒªÏÈ°²×°node.js»·¾³¡£ÏÖÔÚ×îеĿª·¢°æ±¾ÊÇ0.5.9°æ±¾£¬ÒѾ­ÓÐwindowsϵĶþ½øÖÆ°üÁË¡£ÎÒ°²×°ºÃºó£¬°²ÕÕnpmµÄ²Ù×÷²½ÖèÖ´ÐÐʧ°Ü£¬ºÃÏó×ÜÊÇ˵ÍøÂçÓÐÎÊÌ⣬ÒòΪÔÚ°²×°npmʱͬʱ»¹Òª°²×°Ò»Ð©×Ó°ü£¬¶¼ÊÇÒÀÀµÓÚgitµÄ£¨ÎҵĻ·¾³ÉÏÒѾ­ÓÐgitÁË£©£¬µ«ÊDz»ÖªµÀΪʲô²»ÐС£

ÓÚÊÇÕÒµ½ÁíÒ»¸ö²ÉÓÃcygwin°²×°node.jsµÄÎÄÕ¡£ÕâƪÎÄÕÂдµÃºÜÏêϸ£¬ËüÊDzÉÓÃÖ±½Ó±àÒëµÄ·½Ê½À´°²×°µÄ¡£¶ÔÓÚwin7µÄ»·¾³£¬ÆäÖÐ̸µ½rebaseallÕâ¸öÃüÁîµÄÖ´Ðзdz£ÖØÒª¡£²»¹ý¶ÔÓÚ±àÒë0.5.9ʧ°Ü£¬ºóÀ´ÎÒ¸ÄΪÎȶ¨°æ0.4.12¾ÍûÎÊÌâÁË¡£²»¹ý°²×°npmÒÀȻʧ°Ü¡£

ÓÚÊÇÓÖÕÒµ½Ò»¸öÍøÕ¾£¬ËüÊÇ°Ñnode.jsÔÚwindowsÏÂÍêÕûµÄ´ò°üÁË£¬ÆäÖÐ×îеİ汾ÒѾ­ÓÐnpmÁË¡£²»¹ý˵Ã÷¿´²»Ì«Çå³þ£¬ËµÊÇdocÏÂÓÐÎĵµ£¬µ«ÊÇûÕÒµ½¡£Ëü˵ÊÇÒѾ­×Ô´øÁËcygwinµÄ»·¾³£¬Ó¦¸Ã¿ÉÒÔÍÑÀëcygwinÀ´ÔËÐС£ÎÒÏÈÔËÐÐbin/shell.cmd£¬È»ºóÖ´ÐУº

node npm install less

ÕâÀïҪעÒâ¼ÓÉÏnode¡£²»´í£¬ÖÕÓڳɹ¦ÁË¡£less°²×°µ½ÁËlib/node_modules/lessĿ¼Ï¡£µ½ÕâÀïÎÒÓָ㲻¶®ÁË£¬ÔõôÔËÐÐlessc°¡¡£

ÓÚÊÇÎҾͽ«node/binϵļ¸¸öÖ÷ÒªµÄÎļþ£º

node.exe

node_modules

npm

npm-g

npm_g

ºÍlibĿ¼Õû¸ö¿½±´µ½ÁËcygwinµÄ°²×°Ä¿Â¼Ï¡£Ê¹ÓÃcygwinÀ´ÔËÐС£

ÓÖÔÚÍøÉÏËÑË÷Ò»µ½ÁËÕâƪÎÄÕ£¬¼ÓÁËÒ»¸ö·ûºÅÁ´½Ó:

ln -s /lib/node_modules/less/bin/lessc /bin/lessc

ÕâÑùlessc¾Í¿ÉÒÔÓÃÁË¡£

ÕâÑùÔÚcygwinÏÂÇГQµ½bootstrapµÄĿ¼Ï£¬Ö´ÐУº

make

¾Í¿ÉÒÔ¶ÔlibϵÄbootstrap.less½øÐбàÒëÁË£¬Í¬Ê±¿ÉÒÔÉú³Émin.cssÎļþ¡£

³¢ÊÔ¹ý³ÌºÜÂÒ£¬²»¹ýºÃ´õless¿ÉÒÔÓÃÁË¡£


Àà±ð£ºUliweb ²é¿´ÆÀÂÛ

十月 7, 2011

limodou的學習記錄
limodou
is about »
» uliweb auth½øÐÐÁËÓÅ»¯

Îĵµ¿ÉÒԲμû:http://uliweb.readthedocs.org/en/latest/auth.html

ÓÅ»¯ºóµÄ¹¦ÄÜÓëÔ­À´µÄʹÓÃÓе㲻ͬ£º

1. User±í‰ˆ¼ÓÁËnickname×Ö¶Î

2. Ô­À´auth/__init__.pyÖеÄif_login¸ÄΪÁËhas_login£¬²¢ÇÒÔ­require_loginÖ»ÊÇdecorator£¬ÏÖÔÚΪ¼È¿É×÷Ϊdecorator£¬ÓÖ¿É×÷Ϊһ°ãº¯ÊýʹÓá£

3. ½«require_loginдµ½settings.iniÖÐFUNCTIONSºÍDECORATORS£¬Óû§¿ÉÒÔͨ¹ý£º

from uliweb import functions, decorators

functions.require_login()
@decorators.require_login

À´·Ö±ðʹÓÃÁ½ÖÖÐÎʽ¡£

4. functionsÊÇЉˆµÄÈ«¾Ö¶ÔÏó£¬ÓÃÓÚ´Ósettings.iniÖУ¬Í¨¹ý¡°.function"µÄÐÎʽÀ´»ñÈ¡FUNCTIONSÖеĺ¯Êý£¬ºÍdecoratorsµÄʹÓ÷½Ê½ÀàËÆ¡£

5. ÔÚsettings.iniÖÐ×¢²áÁË/login, /logout URL£¬Ìí¼ÓauthÖ®ºó¾ÍÊÇȱʡʹÓÃÁË¡£


Àà±ð£ºUliweb ²é¿´ÆÀÂÛ

九月 25, 2011

limodou的學習記錄
limodou
is about »
» ³õ²½ÊµÏÖÁËSoapµÄÖ§³Ö

Îĵµ£º http://uliweb.readthedocs.org/en/latest/soap.html

²»¹ý»¹Ã»Óо­¹ýÕýʽÏîÄ¿µÄÑéÖ¤£¬¹À¼Æ»¹ÓкܶàÒªÐ޸ĵġ£

ͬʱ»¹¶Ôuliweb×öÁËÒ»µãÓÅ»¯£¬È磺

ʹÓÃÊÂÎñÖмä¼þʱ£¬ÏÖÔÚÖ§³Öµ±response.error=Trueʱ×Ô¶¯»Ø¹ö¡£ÒÔÇ°Ö»ÄÜÔÚÅ×Ò쳣ʱ²Å»á×Ô¶¯´¦Àí£¬Òò´ËÈç¹ûÄã×ÔÐд¦ÀíÒì³£¾ÍÐèÒª×ÔÐд¦ÀíÊÂÎñ¡£ÏÖÔÚͨ¹ýÕâ¸ö·½·¨¾Í¼òµ¥¶àÁË¡£

½«libĿ¼´¦ÀíÕâpackageÁË¡£

EXPOSESµÄ¶¨Ò巽ʽ½øÐÐÁËÐ޸ġ£ÎĵµÒѾ­¸üС£


Àà±ð£ºUliweb ²é¿´ÆÀÂÛ

九月 19, 2011

limodou的學習記錄
limodou
is about »
» uliwebÈÕÖ¾´¦Àí˵Ã÷Îĵµ

ÒѾ­Íê³É£¬·Åµ½uliweb-docÖÐÁË¡£¿ÉÒÔ·ÃÎÊ: http://uliweb.readthedocs.org/en/latest/log.html


Àà±ð£ºUliweb ²é¿´ÆÀÂÛ

九月 17, 2011

limodou的學習記錄
limodou
is about »
» loggingµÄʹÓ÷ÖÎö

×òÌ죬Lord LeatherfaceÎÊÎÒΪʲôʹÓÃÁËsudsºó£¬Êä³öÈÕÖ¾±ä³ÉÁËÁ½Ìõ¡£ÓÚÊÇÎÒ×ÐϸµØÑо¿ÁËloggingµÄÈÕÖ¾´¦Àí»úÖÆ£¬²¢ÇÒÔٴο¼ÂÇÁËuliwebµÄÈÕÖ¾´¦Àí£¬×îÖÕ¶ÔuliwebµÄÈÕÖ¾½øÐÐÁËÖع¹£¬²¢ÇÒŪÇå³þÁËΪʲô»áÓÐÁ½ÌõÈÕÖ¾µÄÏÖÏó£¬Òò´ËÒÔ±¾ÎÄ×÷Ò»¸ö¼Ç¼¡£

¶ÔÓÚloggingÎÒÏë´ó¼ÒÓõÃÓ¦¸Ã²»ÉÙ£¬ÄÇôÎÒÏÈÌἸ¸öÎÊÌ⣺

1. loggingÖ±½ÓÊä³öÈÕÖ¾£¬Èçlogging.info()Óëlog = logging.getLogger('name') log.info()ÓÐʲô²»Í¬£¿

2. ¡°No handlers could be found for logger¡±ÊÇÔõô»ØÊ£¿

3. root loggerÓÐʲôÓã¬ÈçºÎ»ñµÃ£¿

4. ÐÎÈç"a.b.c"µÄloggerÃûÓÐʲôÓã¿

5. Èç¹ûÒ»¸öloggerÖ´Ðжà´ÎaddHandler£¬ÄÇôÿ¸öhandler¶¼»á±»Ö´ÐÐÂð£¿

6. loggerµÄ´«²¥(propagate)ÊÇÔõô»ØÊ£¿ÈçºÎ×èÖ¹Ëü£¿

ÓÐʱºò´ø×ÅÎÊÌâѧϰ¿ÉÄÜ»á¸ü¿ì¡£ÄÇôÏÂÃæ¸ù¾ÝÎÒµÄÀí½âÒ»µãµã½øÐнâÊÍ¡£

loggingÖÐlogÊÇ¿ÉÒÔ·Ö¼¶µÄ£¬ËüµÄ¼¶±ðÓëÄãʹÓÃgetLogger()ÖеÄÃû×ÖÓйØϵ¡£±ÈÈ磬Äã¿ÉÒÔʹÓÃ"uliweb"»ò"uliweb.app"£¬ËüÃǵÄÇø±ð¾ÍÊÇ"uliweb.app"ÖÐÓÐÒ»¸ö'.'¡£ÄÇôlogging»á×Ô¶¯Éú³É"uliweb"ºÍ"uliweb.app"µÄlogger£¬²¢ÇÒ"uliweb"½«ÊÇ"uliweb.app"µÄloggerµÄ¸¸¶ÔÏó¡£ÕâÒ»µã¿ÉÒÔÕâÑùÑéÖ¤£º

>>> import logging

>>> log = logging.getLogger('uliweb.app')

>>> log.manager.loggerDict.items()

[('uliweb.app', <logging.Logger instance at 0x017CE238>), ('uliweb', <logging.PlaceHolder instance at 0x017CE2D8>)]

ÕâÀïÓÐÒ»¸öͦÓÐÒâ˼µÄ£¬¾ÍÊÇ'uliweb'Õâ¸öloggerËüµÄ¶ÔÏóÊÇPlaceHolder£¬Ï൱ÓÚÊÇÒ»¸ö¡°Ðé"ÈÕÖ¾¶ÔÏó¡£logging¿ÉÒÔÔÊÐíͨ¹ýgetLogger()À´×Ô¶¯Éú³É¶ÔÓ¦µÄlogger¶ÔÏ󡣶ÔÓÚ·Ö¼¶µÄÈÕÖ¾Ãû×Ö£¬Ëü»áÒ»¼¶¼¶µØ´´½¨£¬Èç¹û¸¸¶ÔÏó»¹²»´æÔÚ£¬Ôò»á×Ô¶¯´´½¨Ò»¸öռλ¶ÔÏó¡£Èç¹û£¬ºóÃæÓû§ÓÖͨ¹ýgetLogger()À´´´½¨Ò»¸ö¸¸¶ÔÏó£¬Ôòlogging»á×Ô¶¯¶Ô¸¸×Ó¹Øϵ½øÐÐÖØÐÂÐÞ¶©£¬±£Ö¤¶ÔÏó¹ØϵµÄÕýÈ·ÐÔ¡£

ÔÙ¿´Ò»¿´¸¸×Ó¹Øϵ£º

>>> log.parent

<logging.RootLogger instance at 0x017E3AD0>

>>> log1 = logging.getLogger('uliweb')

>>> log.parent

<logging.Logger instance at 0x01820DA0>

>>> log.parent.name

'uliweb'

ͦÓÐÒâ˼¡£µ±ÎÒÃÇÖ±½Óͨ¹ýgetLogger('uliweb.app')»ñµÃÈÕÖ¾¶ÔÏóʱ£¬ËüµÄparent²¢²»ÊÇռλ¶ÔÏó'uliweb'£¬¶øÊÇRootLogger¡£Õâ¸öRootLoggerÊÇÔÚµ¼Èëloggingʱ×Ô¶¯ÓÉÄ£¿é´´½¨µÄ£¬ËüµÄ´´½¨´úÂëÊÇ£º

root = RootLogger(WARNING)

Logger.root = root

Logger.manager = Manager(Logger.root)

LoggerÊÇÕæÕýµÄloggerµÄÀà¡£¿ÉÒÔ¿´ËüÔÚÔËÐÐʱ»á¸øËü¸³ÓèrootºÍmanager¶ÔÏ󡣶ømanager¾ÍÊÇÓÃÀ´´´½¨logger²¢½øÐйÜÀíµÄÀࡣǰÃæµÄ´úÂë¾ÍÊÇͨ¹ý²é¿´manager.loggerDictÀ´²é¿´ËùÓÐÒѾ­¶¨ÒåµÄlogger¡£
Òò´Ë´ÓÉÏÃæµÄ´úÂëÎÒÃÇ¿ÉÒÔÀí½â£¬ÔÚÖ±½Ó´´½¨Ò»¸ö¶à¼¶µÄloggerʱ£¬Èç¹û¸¸¶ÔÏó²»´æÔÚ£¬Ôò¸¸¶ÔÏó×ÔÈ»ÊÇroot¶ÔÏó¡£Èç¹û¸¸¶ÔÏó±»´´½¨£¬Ôò¸¸×Ó¹Øϵ±»ÐÞÕý¡£

root¶ÔÏóÓÐʲôÓÃÄØ£¿Ëü¾ÍÊÇȱʡµÄÈÕÖ¾¶ÔÏó¡£Ê¹ÓÃloggingµÄ×î¼òµ¥µÄ·½·¨ÊÇ£º

import logging

logging.info()

¿ÉÒÔÖ±½ÓÊä³ö¡£ÕâÀïÓÐʲôÃØÃÜ£¿¿´Ò»¿´´úÂëÒ»ÇоͶ¼Çå³þÁË¡£

def info(msg, *args, **kwargs):

    """

    Log a message with severity 'INFO' on the root logger.

    """

    if len(root.handlers) == 0:

        basicConfig()

    root.info(*((msg,)+args), **kwargs)

ÕâÀïÏȶÔrootµÄhandlers½øÐÐÅжϡ£ÄÇôhandlersÊÇʲô¶«Î÷£¿Ëü¾ÍÊÇÓÃÀ´´¦ÀíÿÌõÈÕÖ¾µÄ´¦ÀíÀàµÄʵÀý¡£Ã¿¸ölogger¿ÉÒÔÓв»Ö¹Ò»¸öhandlerʵÀý¡£²¢ÇÒÿ¸öhandler¶ÔÏó¿ÉÒÔÓÐ×ÔÒѵÄÈÕÖ¾Êä³ö¼¶±ð£¬¿ÉÒÔºÍloggerµÄ²»Í¬¡£handlerµÄ´¦ÀíÎÒÃǺóÃæÔÙ˵¡£ÉÏÃæµÄ´úÂëÒâ˼¾ÍÊÇ£¬Èç¹ûroot»¹Ã»Óж¨Òå´¦Àí¶ÔÏó£¬ÔòÖ´ÐÐbasicConfig()½øÐÐȱʡÅäÖá£È»ºóʹÓÃroot.info()½øÐÐÊä³ö¡£ËùÒÔÎÒÃÇ¿ÉÒÔÀí½â£ºlogging.info()Æäʵ¾ÍÊÇʹÓÃrootÀ´½øÐÐÊä³öµÄ£¬Äã¿ÉÒÔÀí½âËüÊÇÒ»¸öÈ«¾ÖÐԵģ¬È±Ê¡µÄÈÕÖ¾¶ÔÏó¡£²¢ÇÒ¿ÉÒÔ×Ô¶¯½øÐÐÅäÖá£
ÄÇô£¬ÎªÊ²Ã´ÒªÅäÖã¿ÒòΪRootLogger(WARNING)Ö»ÊÇ´´½¨ÁËloggerÀ࣬µ«ÊÇ»¹Ã»ÓÐÌí¼ÓÈκεÄhandler£¬Òò´ËhandlersÊǿյġ£Ò²¾ÍÊÇ˵£¬´´½¨ÁËÒ»¸ölogger£¬²¢²»±íʾËü¾Í¿ÉÒÔÊä³öÈÕÖ¾¡£ÊDz»ÊÇÓÐЩÆæ¹Ö£¿»¹ÊÇÒÔ´úÂëΪÉÏ£º

    def callHandlers(self, record):

        c = self

        found = 0

        while c:

            for hdlr in c.handlers:

                found = found + 1

                if record.levelno >= hdlr.level:

                    hdlr.handle(record)

            if not c.propagate:

                c = None    #break out

            else:

                c = c.parent

        if (found == 0) and raiseExceptions and not self.manager.emittedNoHandlerWarning:

            sys.stderr.write("No handlers could be found for logger"

                             " \"%s\"\n" % self.name)

            self.manager.emittedNoHandlerWarning = 1

ÉÏÃæµÄ´úÂëÊÇLoggerÀàÖÐÓÃÀ´Êä³öÈÕÖ¾µÄÒ»¸ö·½·¨£¬ËùÓеÄÃØÃܶ¼ÔÚÕâÀïÃæÁË¡£ÕâÀï²»Ò»ÌõÌõ½â¾öÁË£¬ËµÒ»ÏÂÎÒµÄÀí½â°É¡£ËüÊ×ÏÈÉèÖÃÁËÒ»¸öfoundµÄ±êÖ¾£¬ËüµÄ×÷ÓþÍÊÇÈç¹ûÕÒµ½ÁËÒ»¸ö¿ÉÓõÄhandler£¬Ôò¼Ó1£¬È»ºóµÈ×îºóÅжÏһϣ¬Èç¹ûfoundΪ0£¬Ôò±íʾÄ㻹ûÓжÔlogger½øÐÐÅäÖã¬ÔÚ×îºó»áÊä³ö¡°No handlers could be found for logger¡±µÄÐÅÏ¢¡£»¹¼ÇµÃrootµÄÊÂÇéÂ𣿴´½¨ÁËÒ»¸ölogger²¢²»±íʾËü¾Í´øÓÐhandlerÁË£¬Ò²¾ÍÊÇÎÞ·¨½øÐд¦Àí¡£Òò´Ëlogging.info()´úÂëÖУ¬»áµ±rootûÓÐÅäÖÃhandlerʱ£¬Ê¹ÓÃbasicConfig()À´½øÐÐÅäÖá£ÄÇôÔÚbasicConfig()µÄ´úÂëÖУ¬Äã»á¿´µ½Ëü»á¸ù¾Ý´«ÈëµÄ²ÎÊý×Ô¶¯Éú³ÉÏàÓ¦µÄHandlerʵÀý£¬Ìí¼Óµ½rootÖÐÈ¥¡£ËùÒÔlogging.info()²»»á±¨´í£¬ÊÇÒòΪËü×Ô¶¯ÅäÖÃÁË¡£¶øÄã×ÔÒÑͨ¹ýgetLogger()µÃµ½µÄij¸öÈÕÖ¾¶ÔÏ󣬿ÉûÓÐ×Ô¶¯»¯µÄÅäÖ÷½Ê½£¬ËùÒÔÓпÉÄܻᱨ´í¡£Òò´ËÏÖÔÚÎÒÃÇ¿ÉÒÔ¾ÍÓÐÒ»¸öÓ¡Ïó£¬ÈÕ־ʹÓÃÇ°ÒªÅäÖã¬Ö÷ÒªÊÇÌí¼ÓÏàÓ¦µÄhandler¡£ÄÇôÕâ¶Î´úÂ뻹ÓÐʲôÌØÊâµÄ£¿Ò»¸ö¾ÍÊÇc.propagate(propagateµÄÖÐÎÄÒâ˼ÊÇ´«²¥)£¬ËüÊÇLoggerµÄÒ»¸öÊôÐÔ£¬È±Ê¡Îª1¡£´ÓÉÏÃæµÄ´úÂë¿ÉÒÔ¿´³ö£¬Èç¹ûpropagateΪ0»ò¼ÙÖµ£¬ÔòÑ­»·¾ÍÍ˳öÁË¡£Èç¹ûΪ1£¬ÔòÑ­»·»á¼ÌÐø´Ó¸¸¶ÔÏó¿ªÊ¼£¬Ö±µ½ÕÒ²»µ½»òpropagateΪ¼Ù¡£Òò´Ëlogging»áÀûÓÃpropagateºÍ¸¸¶ÔÏó½øÐеݹ鴦Àí»ò´«²¥´¦Àí¡£Òò´Ë¾ÍÑù¾ÍʵÏÖÕâÑùÒ»ÖÖЧ¹û£ºÔÚ´«²¥Çé¿öÏ£¬´Ó×Ó½áµãµ½¸¸½áµãµÄhandler¶¼»á±»´¦ÀíÒ»·¬¡£µ±È»£¬»¹ÓÐÒ»¸ö¼ì²éµã¾ÍÊÇÐÅÏ¢Êä³öµÄÈÕÖ¾¼¶±ðÒª´óÓÚµÈÓÚhandlerµÄÈÕÖ¾¼¶±ð¡£Òò´Ë£¬Èç¹û¸¸½áµãºÍ×Ó½áµã¶¼¶¨ÒåÁËhandler£¬²¢ÇÒÈÕÖ¾¼¶±ð¶¼·ûºÏÒªÇó£¬ÕâÑùµÄÈ·»áÊä³öÁ½ÌõÈÕÖ¾£¬µ«ÊÇÓɲ»Í¬µÄhandlerÊä³öµÄ¡£ËùÒÔ£¬Èç¹û×Ó¶ÔÏó¶¨ÒåÁË×ÔÒѵÄhandler£¬ÎªÁ˱ÜÃâ´«²¥£¬Òò´ËÓ¦¸ÃÉèÖÃËüµÄpropagate=0¡£µ«ÊÇ£¬ÀûÓô«²¥£¬ÎÒÃÇÒ²¿ÉÒÔʵÏÖ£¬×ÓÈÕÖ¾¶ÔÏ󲻶¨Òå×ÔÒѵÄhandler£¬Òò´Ë×îÖÕÊÇʹÓø¸¶ÔÏóµÄhandler¡£ÌرðÊǶÔÓÚ¸¸¶ÔÏóÊÇroot¶ÔÏóµÄÇé¿ö£¬Ö»ÒªÖ´ÐÐÁËbasicConfig()£¬ÔòÒ»¶¨»á´æÔÚhandler£¬¾Í¿ÉÒÔ¸´ÓÃrootµÄhandlerÁË¡£
ÉÏÃæµÄ´úÂ뻹ÓÐÒ»µãҪעÒâµÄ¾ÍÊÇ£¬Ëü»á¶ÔloggerµÄËùÓÐhandler½øÐÐÑ­»·£¬µ±È»Í¬Ê±Òª¼ì²éÈÕÖ¾Êä³ö¼¶±ð¡£Òò´Ë£¬Èç¹ûÄãΪһ¸ölogger¶¨ÒåÁ˶à¸öhandler£¬ÄÇô¾ÍÓпÉÄܶ¼»áÊä³ö¡£Èç¹ûÏëÇø·Ö²»Í¬µÄhandler£¬¿ÉÒÔÀûÓü¶±ðÀ´¿ØÖÆ¡£
¶ÔÓÚroot¶ÔÏó£¬ÔÙ˵һµã¾ÍÊÇʲôʱºòÒªÖ´ÐÐbasicConfig()½øÐÐÅäÖã¿Èç¹ûÄãûÓÐ×Ô¶¨Òålogger£¬Ö»ÊÇʹÓÃloggingÖÐÒѾ­ÌṩµÄÈ磺info(), debug()Ö®ÀàµÄ·½·¨£¬µÄÈ·²»±ØÌرðµ÷ÓÃbasicConfig()£¬ÒòΪÕâЩº¯ÊýÔÚÖ´ÐÐʱ¶¼×öÁ˼ì²é£¬Èç¹ûûͨ¹ý£¬Ôò×Ô¶¯»áµ÷ÓÃbasicConfig()¡£µ«ÊÇ£¬Èç¹ûÄã²»ÊÇÕâÑùʹÓ㬶øÊÇʹÓÃ×Ô¶¨ÒåµÄlogger£¬Òò´Ë»¹Êǽ¨ÒéÄãÏÈÖ´ÐÐbasicConfig()½øÐÐȱʡµÄÅäÖá£ÔÚʹÓÃ×Ô¶¨ÒåµÄlogger£¬Òª×¢ÒâµÄÎÊÌâ¾ÍÊÇ£ºhandlerµÄÌí¼ÓÓëpropagateµÄ´¦Àí¡£

ÄÇôÈç¹ûÎÒÏë»ñµÃroot¶ÔÏó¸ÃÈçºÎ×öÄØ£¿Ê¹ÓÃlogging.rootÂ𣿳£Óõķ½·¨»¹ÊÇͨ¹ýgetLogger('')À´»ñµÃ¡£²ÎÊý¿ÉÒÔÊÇ''»òÆäËüΪ¼ÙµÄÖµ¡£

ͨ¹ýÉÏÃæµÄ½²½â£¬ÎÒÏëÄãÓ¦¸ÃÖªµÀÎÒÌáµÄ¼¸¸öÎÊÌâµÄ´ð°¸ÁË°É¡£ÏÂÃæÔÙ¼òµ¥×ܽáһϣº
loggerÊÇ·Ö¼¶µÄ£¬Óи¸×Ó¹Øϵ¡£
loggerµÄ´¦ÀíÒª¿¿handlerÀ´Êä³ö£¬»ñµÃÁËlogger²¢²»Ò»¶¨»á×Ô¶¯´´½¨handler£¬Òò´ËloggerÒ»°ã¶¼ÐèÒªÅäÖá£
ÔÚ´æÔÚ¸¸×Ó¹ØϵµÄÇé¿öÏ£¬ÈÕÖ¾ÊÇ¿ÉÒÔ±»´«²¥Êä³öµÄ£¬²¢ÇÒ¿ÉÒÔͨ¹ýpropagateÊôÐÔÀ´¿ØÖÆ¡£


Àà±ð£ºUliweb ²é¿´ÆÀÂÛ

九月 15, 2011

limodou的學習記錄
limodou
is about »
» uliwebÖÐtimezoneµÄ´¦Àí

ÔÚºÜÔçÒÔÇ°µÄ°æ±¾ÖУ¬uliwebÖоÍÒѾ­ÓÐÁËtimezoneµÄ´¦Àí£¬ÔÚuliweb/utils/data.pyÖУ¬ÒѾ­¶¨ÒåÁËÈô¸ÉÓëÈÕÆÚ¡¢Ê±¼äÏà¹ØµÄapi¡£ÄÇʱÎÒ²ÉÓõÄÊÇpytzÀ´½øÐÐʱÇøµÄ´¦Àí¡£ÔÚdefault_settings.iniÖÐGLOBAL/TIME_ZONEÖÐÉèÖÃÁËȱʡµÄʱÇø£¬È±Ê¡ÊÇNone¡£Í¬Ê±uliormÖеÄÈÕÆÚ¡¢Ê±¼äÔÚ×Ô¶¯Éú³Éʱ£¬Ò²ÊÇʹÓÃdate.pyÖеĺ¯ÊýÀ´Éú³ÉµÄ¡£Æô¶¯uliwebʱ£¬»á×Ô¶¯µ¼Èëpytz£¬È»ºó¸ù¾ÝTIME_ZONEÀ´ÉèÖÃʱÇø¡£µ«ÊǺóÀ´·¢ÏÖ£¬pytzµÄtzinfoÐÅϢ̫´óÁË£¬µ¼Èë·Ç³£Âý¡£ÓÚÊǾͰÑÕâ¸ö×Ô¶¯³õʼ»¯È¥µôÁË¡£ÒòΪpytzµÄʱÇøÊý¾ÝÌ«¶à£¬¶øÇÒÌ«¸´ÔÓ£¬±ÈÈçÏÄÁîʱµÄ´¦Àí£¬µÄȷʹÓÃÆðÀ´±È½ÏÂé·³¡£ÓÚÊÇÎÒ¾ÍÏëÖ»Òª¼òµ¥µÄʱÇø¾Í¹»ÁË£¬±ÈÈ磺UTCºÍGMT-12µ½GMT+12µÄʱÇø£¬ÎÒÏëʹÓÃʱÇøµÄÈËÓ¦¸Ã×ã¹»Á˽⣬ËûÏëҪʲôʱÇø¡£

²»¹ý´ËÊÂÒ»Ö±ÍÏ×Å£¬Ö±µ½Ç°Á½Ì컨ÁËЩʱ¼ä°ÑÕâ¸öÊ»ù±¾¸ã¶¨ÁË¡£Ê×ÏȲο¼ÁËpythonÊÖ²áÖйØÓÚdatetimeģʽÖеÄtzinfoµÄʾÀý£¨ºÃÏóÓв¿·ÖÊÇ´ÓpytzÖÐÀ´µÄ£©£¬±àдÁËUTCºÍGMT-12µ½GMT+12ʱÇøµÄÀ࣬²¢½øÐÐÁ˳õʼ»¯¡£È»ºóÓÖÐÞ¸ÄÁËdate.pyÖеÄһЩº¯Êý£¬Ê¹Æä¸üºÃÓÃһЩ¡£È»ºóÓÖÐÞ¸ÄÁËuliormÖеÄDatetimeProperty, DateProperty, TimePropertyµÈÊôÐÔÀ࣬ͬʱµ÷ÕûÁËuliormµÄvalidateµÄ´¦Àí¡£

ÕâÑù£¬ÔÚuliwebÖÐʹÓÃʱÇø¿ÉÒÔÓÐÁ½ÖÖ״̬£º1. ÎÞʱÇø״̬¡£2.ÓÐʱÇø״̬¡£

ÔÚuliwebÖеÄcontribÖУ¬ÐÂÌṩÁËÒ»¸ötimezoneµÄapp¡£Ò»µ©°üº¬Ëü£¬Ôò×Ô¶¯¸ù¾Ýsettings.iniÖеÄGLOBAL/TIME_ZONEÖеÄÉèÖóõʼ»¯date.pyÖÐʹÓõÄȱʡʱÇø¡£ÕâÑù£¬Ö»ÒªÄãµÄÈÕÆÚºÍʱ¼äº¯Êý¶¼Ê¹ÓÃdate.pyÖÐÌṩµÄ·½·¨£¬¾Í¿ÉÒÔ×Ô¶¯´¦ÀíʱÇø¡£ËùνÎÞʱÇø״̬£¬¾ÍÊÇTIME_ZONEΪNone¡£ÕâÑù£¬Æäʵ¶¼ÊÇ·þÎñÆ÷µÄʱ¼ä£¬Ã»ÓÐʲôʱÇøµÄ¸ÅÄ¿ÉÄܾÍÊÇÎÒÃÇƽ³£ËùʹÓõķ½Ê½¡£¶øÓÐʱÇø״̬£¬ÔòTIME_ZONE²»Îª¿Õ£¬±ÈÈçÉèÖóÉ'UTC'£¬ÔòËùÓÐdate.pyÖеĺ¯Êýȱʡ¶¼Ê¹ÓÃ'UTC'ʱÇøÀ´Éú³Éʱ¼ä¡£ÔÚuliormÖУ¬ÈÕÆÚºÍʱ¼äÊôÐÔÊÇ¿ÉÒÔͨ¹ýÌí¼Óauto_nowºÍauto_now_addÀ´×Ô¶¯ÔÚÐ޸ĺÍÌí¼Óʱ×Ô¶¯Éú³ÉÈÕÆÚÖµ£¬Ëü¾ÍÊÇʹÓÃÁËdate.pyÖеÄnow()º¯Êý¡£ËùÒÔ£¬Ò»µ©ÄãÉèÖÃÁËTIME_ZONE£¬Ôòuliweb»á×Ô¶¯°´Ê±ÇøµÄ·½Ê½½øÐд¦Àí¡£

¶ÔÓÚʱÇøµÄ´¦ÀíÎÒÃÇÒª¿¼ÂÇ·þÎñÆ÷ºÍ¿Í»§¶ËÓпÉÄܲ»Ò»ÖµÄÎÊÌ⣺

Èç¹ûÎÒÃǵķþÎñÆ÷ºÍÓû§µÄ»úÆ÷ÊÇÔÚÒ»¸öµØÇø£¬Õâ¸öÎÊÌâ×îºÃ°ì£¬¿ÉÒÔ²»Ê¹ÓÃʱÇø£¬Ö±½ÓʹÓñ¾µØʱ¼ä¡£ÕâÑùÖ»Òª²»ÉèÖÃTIME_ZONE»ò±£³ÖΪNone¾ÍºÃÁË¡£

µ«Èç¹û·þÎñÆ÷ºÍ¿Í»§¶Ë¿ÉÄܲ»ÔÚÒ»¸öµØÇø£¬±ÈÈçdotcloudµÄÓ¦Óã¬ÄÇô¾ÍÒª¿¼ÂÇÈçºÎ´¦Àí¿Í»§¶ËµÄʱÇø¡£ÕâÀïÎÒÃÇ¿ÉÒÔͳһ·þÎñÆ÷·½µÄʱÇø£¬Í¨¹ýÉèÖÃTIME_ZONE¡£µ«ÊÇ¿Í»§¶ËµÄʱÇø²»ºÃ´¦Àí¡£±ÈÈ磺ÓÐÓû§µÄÇé¿öºÍÎÞÓû§µÄÇé¿ö¡£ÓÐÓû§µÄÇé¿öÏ£¬¿ÉÒÔ¿¼ÂÇÈÃÓû§×ÔÐÐÉèÖÃËùÔÚµÄʱÇø¡£¶øÎÞÓû§µÄÇé¿öÏ£¬ÈçºÎ»ñµÃʱÇøÓв»Í¬µÄ×ö·¨¡£×î¼òµ¥µÄ£¬¾ÍÊÇĬÈÏ¿Í»§Ê±Çø¡£±ÈÈ磬uliwebÖпÉÒÔÉèÖÃGLOBAL/LOCAL_TIME_ZONE£¬È»ºóʹÓÃdate.to_local()À´½«Ò»¸öʱ¼äתΪLOCAL_TIME_ZONEËùÖ¸¶¨µÄʱÇø¡£ÁíÍâÔÚstackoverflowÕÒµ½ÓÐÀàËƵÄÎÊÌ⣬±ÈÈçÕâ¸ö£¬ËüµÄ°ì·¨¾ÍÊÇͨ¹ýä¯ÀÀÆ÷¶ËÖ´ÐÐÒ»¶ÎjavascriptÀ´±ÈÈçÓëUTCµÄ²îÒìÀ´»ñµÃʱÇø²îÒ죬ÕýºÃÒ²ÊÇʹÓÃGMT +|-nµÄÐÎʽ¡£Æä¹Ø¼üµÄjs´úÂëÊÇ£º

<scripttype="text/javascript">

    $(document).ready(function(){

        if("<?php echo $timezone; ?>".length==0){

            var visitortime =new Date();

            var visitortimezone ="GMT "+-visitortime.getTimezoneOffset()/60;

            $.ajax({

                type:"GET",

                url:"http://domain.com/timezone.php",

                data:'time='+ visitortimezone,

                success:function(){

                    location.reload();

                }

            });

        }

    });

</script>


ÕâÊÇphpµÄÀý×Ó£¬ºÜÈݸÄΪÆäËüµÄ³ÌÐòÐÎʽ¡£¹Ø¼üµÄµØ·½¾ÍÊÇ£ºvisitortime.getTimezoneOffset()/60 £¬²¢ÇÒÔڵõ½Ê±ÇøºóÔÙ×Ô¶¯Ë¢Ð£¬È»ºó½«Öµ±£´æµ½sessionÖС£

¼òµ¥×ܽáһϣ¬Í¨¹ýÉèÖÃGLOBAL/TIME_ZONE¿ÉÒÔÉèÖ÷þÎñÆ÷¶ËÈÕÆÚ¡¢Ê±¼äµÄÉú³É£¬±ÈÈçuliormµÄ×Ô¶¯ÈÕÆÚ¡¢Ê±¼äµÄÉú³É¡£ÆäËüµØ·½µÄÈÕÆÚ£¬Í¨¹ýʹÓÃdate.pyÖеÄAPI¡£½¨Òéºǫ́ͳһʹÓÃUTCÈÕÆÚ£¬¼òµ¥ÔÚuliwebÖÐÅäÖÃÈçÏ£º

[GLOBAL]

TIME_ZONE = 'UTC'

ͬʱҪ°²×° 'uliweb.contrib.timezone', ·ñÔò²»Æð×÷Óá£

¶ÔÓÚ¿Í»§¶ËµÄʱÇø´¦Àí£¬Óм¸ÖÖ·½·¨£º

1. ÏÈÉèÖÃGLOBAL/LOCAL_TIME_ZONEµÄʱÇø£¬È»ºóʹÓÃdate.to_local(datetime)À´×Ô¶¯×ªÎªLOCAL_TIME_ZONEµÄʱÇø£¬µ«ÕâÖÖÒ²ÊÇÏ൱Óڹ̶¨µÄʱÇø£¬²»ÄܺÜÁé»îµÄ×ÔÊÊÓ¦¡£

2. ÔÚÉè¼ÆÉÏ£¬ÎªÃ¿¸öÓû§Ìí¼ÓÒ»¸öʱÇøÑ¡ÔñµÄ×ֶΣ¬ÈÃÓû§×ÔÐÐÉèÖá£ÕâÑùÔÚչʾҳÃæÖУ¬¸ù¾ÝÓû§µÄʱÇøÖµÀ´×ª“QʱÇøÏÔʾ¡£

3. ²ÉÓÃjsÔÚÇ°¶Ë̽²âµÄ°ì·¨£¬½«Ç°¶ËµÄʱÇø̽²â³öÀ´£¬²¢±£´æÔÚsessionÖУ¬ºóÐø´¦ÀíÒÔ´ËΪ¿Í»§¶ËʱÇøµÄ´¦Àí¡£

ͬʱ»¹ÓÐÒ»¸öҪעÒâµÄ£¬ÄǾÍÊÇÓû§ÉÏË͵ÄÈÕÆÚÐÅÏ¢µÄ´¦Àí¡£ÒòΪËüÒ²ÊDz»´øʱÇøµÄ£¬ËùÒÔÒª¸ù¾ÝÇ°ÃæµÄ·½Ê½Ä¬ÈÏΪij¸ö¿Í»§¶ËʱÇøÔÙ½øÐд¦Àí¡£

 


Àà±ð£ºUliweb ²é¿´ÆÀÂÛ

九月 12, 2011

limodou的學習記錄
limodou
is about »
» uliwebzone¸üÐÂÁËÒ»ÏÂ

ÐÞ¸´ÁËһЩbug£¬²¢ÇÒ·ÖÒ³js¿Ø¼þ»»³ÉsmartpaginatorÁË¡£Í¬Ê±uliwebºÍplugs¶¼Éýµ½×îеİ汾ÁË¡£·¢ÏÖÖ±½ÓÔÚdotcloudÉÏÓÃssh²¿Êð»¹ÊÇ×î·½±ãµÄ¡£ÏîÄ¿´úÂë·Åµ½codeĿ¼Ï£¬uliwebºÍplugs·Åµ½~Ŀ¼Ï£¬ÓÃsetup.py developÀ´°²×°¡£ÒÔºó¾ÍûÓÐͬ²½Ôì³ÉÎļþ¶ªÊ§µÄÇé¿öÁË¡£


Àà±ð£ºUliweb ²é¿´ÆÀÂÛ

九月 11, 2011

limodou的學習記錄
limodou
is about »
» ¾²Ì¬Îļþºó׺´¦Àí£¬±ÜÃâä¯ÀÀÆ÷»º´æ

Ôö¼ÓÁËÒ»¸öSTATIC_VERµÄÈ«¾ÖÅäÖÃÏ¿ÉÒÔÔÚʹÓÃurl_for_staticʱ×Ô¶¯¸ù¾ÝÕâ¸öÅäÖÃÏÔÚ¾²Ì¬Á´½ÓºóÃæÌí¼Ó?ver=xxxµÄÐÅÏ¢¡£×Ô¶¯ÊÊÓÃÓÚ{{use}}ºÍ{{link}}Ä£°åtag¡£Ö»Êǵ±Ç°´¦Àí»¹ÊDZȽϼòµ¥£¬ÎÞ·¨×öµ½Õë¶Ôij¸öÐ޸ĵÄÎļþµÄ°æ±¾¡£È±Ê¡ÎªNone£¬±íʾ²»Ìí¼Ó¡£


Àà±ð£ºUliweb ²é¿´ÆÀÂÛ

biggo.com.tw

A Django site.