使用nautilus脚本一键上传文件
每天都要从Ubuntu上将一些文件上传到www.dbank.com,使用网页很麻烦,于是用nautilus+python写了一个一键上传的脚本,这也是我自己的第一个Python脚本。
系统要求:
- 支持Nautilus Script的Linux发行版(我这里只有Ubuntu),现在大部分的Linux都支持了
- 安装Nautilus, Python, Python-json, Python-notify等支持
使用方法:
- 将下载的文件解压到一个目录
- 修改其中的auth.conf,将用户名和密码改成的帐号
- 运行其中的Install脚本
- 在文件系统中在一个文件上点右键,就会出现Script->Upload to DBANK的菜单,点击(如下图)
- 文件会在后台上传,如果上传成功,会在桌面右上角的Notify区域给出提醒
- 如果要卸载,运行Uninstall即可
注意事项:
- 目前不支持目录,只支持文件,可以选择多个;
- 写来自己用的,所以没有加太多的异常处理,所以请auth.conf中的密码自己保证正确;不放心的可以用网络检测工具看一下,程序只会发送你的密码到dbank官方网站
如果要自己制作类似的脚本怎么处理?比如一键生成缩略图/发送到Email等功能,下面就来介绍一下开发Nautilus脚本的步骤:
- 写自己的脚本程序,语言无所谓,java/php/python/perl/c等都可以,最终实现的调用方式是将选中的文件作为命令行参数传入你的程序,比如python/php来说,就是:
python uploader.pyc /root/codigg.jpg
php uploader.php /root/codigg.jpg
而对应的程序中,实现你要的功能。在我的程序中,调用方式实际上是:
python uploader.pyc auth.conf file1 file2 ...
- 打开目录中的文件”Upload to DBANK” , 可以看到调用脚本。修改为你的调用方式
- 打开Install和Uninstall,修改相关的安装目录就OK
原创文章如转载,请注明:转载自CODIGG [ http://www.codigg.com/ ]
本文链接地址:http://www.codigg.com/2010/08/nautilus-scripts-upload-dbank-python-ubuntu/




九月 4th, 2010 at 10:32
这个很方便,不过很少有ubuntu
[回复]
九月 10th, 2010 at 08:36
最好直接右键上传就更爽啦,呵呵
[回复]
六月 3rd, 2011 at 15:44
4019193 beers on the wall.
[回复]
一月 25th, 2012 at 06:52
˙ţC
[回复]
一月 30th, 2012 at 19:39
I wish to get across my affection for your kindness for folks that absolutely need assistance with in this area of interest. Your special dedication to passing the message up and down has been extraordinarily significant and has in most cases encouraged associates like me to achieve their goals. This interesting useful information entails much a person like me and even more to my fellow workers. Regards; from each one of us.
[回复]
二月 2nd, 2012 at 10:00
Great 1 blog site proprietor good results blog site article fantastic sharings in such a website often have pleasurable
[回复]
二月 2nd, 2012 at 19:29
The moment I first made a comment I clicked your button which says-Notify me when new comments are added- now each and every moment a new comment is created I receive four messages having the actual precise same comment. Maybe there is any means you can pull out me right from that program? Thanks!
[回复]
二月 3rd, 2012 at 00:25
I used to be curious about your following article admin genuinely needed this weblog super astounding weblog
[回复]
二月 3rd, 2012 at 03:28
Many thanks for posting this, It?s just what I used to be researching for on bing. I?d loads relatively hear opinions from a person, slightly than a company web web page, that?s why I like blogs so significantly. Many thanks!
[回复]
二月 3rd, 2012 at 04:01
Whats up convertxtodvd keygen tremendous short article vso convertxtodvd key for 使用nautilusè„šæœ¬ä¸€é”®ä¸Šä¼ æ–‡ä»¶ – CODIGG
[回复]
二月 3rd, 2012 at 12:09
oh my god fantastic post admin will examine your webpage generally
[回复]
二月 4th, 2012 at 08:02
When I initially left a comment I clicked on this -Notify me when new comments are added- Checkbox – right now every single time a comment is added on I end up with 4 email messages that has all the precise same comment. Do you have any way you can erase me out of that service? Thanks!
[回复]
二月 4th, 2012 at 13:58
Great a person website proprietor achievement weblog post great sharings in this website always have exciting
[回复]
二月 4th, 2012 at 16:31
Great put up admin! i bookmarked your net web site. i will appear forward in case you will have an e-mail checklist adding.
[回复]
二月 6th, 2012 at 02:21
I’ve been surfing online more than three hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as you did, the net will be a lot more useful than ever before.
[回复]
二月 6th, 2012 at 08:49
Well I really liked studying it. This article offered by you is very constructive for good planning.
[回复]
二月 6th, 2012 at 11:44
Hello admin very good put up a lot thanks loved this blog site genuinely significantly
[回复]
二月 6th, 2012 at 13:14
The success of the jokes were erratic.
[回复]
二月 6th, 2012 at 13:23
Hello guys I merely wished to stop by your website as well as check in so I could possibly drop my link. I wish that you locate our composition as practical as I did yours! We are a hands on type of operation, so if you have any sort of inquiries about our services gratify let us know!
[回复]
二月 6th, 2012 at 13:25
Howdy! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche. Your blog provided us beneficial information to work on. You have done a outstanding job!
[回复]
二月 6th, 2012 at 13:43
When I originally commented I clicked the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the same comment. Is there any way you can remove me from that service? Thanks!
[回复]
二月 6th, 2012 at 13:44
Heya! Cool piece of writing! I am just a frequent visitor (very much like addict
) of the website although I had a concern. I am only in no way absoluterly certain if it is the right web site to ask, but you’ve got no spam comments. I get comments just about every day. Would you help me? Appreciate it!
[回复]
二月 6th, 2012 at 22:57
woh I your content , saved to bookmarks ! .
[回复]
二月 6th, 2012 at 23:24
Regards for this marvelous post, I am glad I discovered this internet site on yahoo.
[回复]
二月 7th, 2012 at 01:28
Keep working ,great job!
[回复]
二月 7th, 2012 at 01:29
Someone necessarily lend a hand to make severely posts I would state. This is the very first time I frequented your website page and up to now? I surprised with the analysis you made to make this particular publish amazing. Fantastic activity!
[回复]
二月 7th, 2012 at 04:12
Impressive! I am amazed at how nicely you use words to get your point across. I would be interested in reading much more of your function.
[回复]
二月 7th, 2012 at 05:38
I always was interested in this subject and still am, appreciate it for posting .
[回复]
二月 7th, 2012 at 05:53
Hi Admin. Thanks for the awesome post! Now just check this out.. Just thought I’d let you in on a secret! You won’t believe it if I told you that these folks know what they are talking about!!
[回复]
二月 7th, 2012 at 08:47
I will immediately clutch your rss as I can not in finding your e-mail subscription hyperlink or newsletter service. Do you’ve any? Please let me understand in order that I could subscribe. Thanks.
[回复]
二月 7th, 2012 at 09:01
Yeah, and set aside the unemployment rate, along with the gigantic debt and deficit, the lagging economy, our downward status from the eyes belonging to the world, the shredding of our Constitution, the insidious and treacherous takeover of our federal government, the growing class warfare and racism, and all belonging to the other negative factors that have been continuing to happen, non-stop, considering that the Hussein REGIME took more than
[回复]
二月 7th, 2012 at 09:49
Absolutely composed subject material , regards for selective information .
[回复]
二月 7th, 2012 at 12:23
who is watching the big superbowl
[回复]
二月 7th, 2012 at 13:15
I appreciate all the work you all have put into your site! I’m going to Tweet this out to my followers… Definitely worth passing on!
[回复]
二月 7th, 2012 at 14:43
Excellent article admin! i bookmarked your web blog site. i will search forward should you may have an e-mail checklist including.
[回复]
二月 7th, 2012 at 15:47
It never ceases to be able to astonish me personally that, using a bit of additional browsing on the internet, you can fall on many of the most unique sites.
[回复]