查看源代码
出自Linux Wiki
对
沙盒
的源代码
根据以下的原因,您无权限进行编辑这个页面操作:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
{| class="FCK__ShowTableBorders" |- | '''跟我做''' * [[配置Trackpoint的中键滚轮功能]] * [[Debian下教育网直通车的使用]] * [af] * [[在Debian中启用Bootsplash]] * [[制作GRUB背景图片]] * [[Debian硬盘安装]] * [[Debian使用CPU频率调节]] * [[驱动摄像头]] * [[Fedora硬盘安装]] * [[Firefox中使用Thinkpad导航键]] * [[Grub引导Windows系统]] * [[使用gfxboot让grub有SUSE效果]] | '''HOWTOs''' * [[修复被grub覆盖的ntfs分区引导扇区|修复被grub复盖的ntfs分区引导扇区]] * [[在线观看网络视频]] * [[教育网直通车连接工具]] * [[用Windows引导器启动grub]] * [[自动挂载Windows分区并使所有用户都有读写权限]] * [[:Category:中文编码使用|MP3/elinks/lftp等乱码问题]] * [[迅雷解决方案]] * [[远程登陆到XP桌面]] * [[通过mms协议下载视频]] | '''Linux基础''' * [[Bash的输入输出重定向]] * [[Gnome菜单项文件位置]] * [[Grub磁盘分区表示方法]] * [[Linux网卡配置]] * [[使用虚拟光驱文件]] * [[常见压缩文件的解压缩方法]] * [[使用软盘镜像]] * [[文件名编码转换]] * [[无线网卡配置]] * [[显示PCI设备详细信息]] * [[查看硬件详细信息]] * [[添加sudoer]] |- | '''Other''' * [[从Debian源安装jre或jdk]] * [[使用Debian-Multimedia源]] * [[启用openoffice语法检查]] * [[安装Archlinux时挂载但不格式化分区]] * [[教育网内Fedora源配置]] | '''技巧与建议''' * [[为普通用户提供CPU调频权限]] * [[使用bmp播放wma、ape音频]] * [[播放歌曲时显示歌词]] * [[Debian使用文泉驿(WQY)字体注意事项]] * [[VI(VIM)编写程序技巧]] | '''Linux程序设计''' * [[G++声明模板友元函数]] * [[建立TCP连接(C语言)]] |} <source lang="python"> #!/usr/bin/python # # Copyright (c) Dropbox, Inc. # # dropbox # Dropbox frontend script # This file is part of nautilus-dropbox 1.6.0. # # nautilus-dropbox is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # nautilus-dropbox is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with nautilus-dropbox. If not, see <http://www.gnu.org/licenses/>. # from __future__ import with_statement import errno import locale import optparse import os import platform import shutil import socket import StringIO import subprocess import sys import tarfile import tempfile import threading import thread import time import traceback import urllib2 try: import gpgme except ImportError: gpgme = None from contextlib import closing, contextmanager from posixpath import curdir, sep, pardir, join, abspath, commonprefix INFO = u"Dropbox is the easiest way to share and store your files online. Want to learn more? Head to" LINK = u"https://www.dropbox.com/" WARNING = u"In order to use Dropbox, you must download the proprietary daemon." GPG_WARNING = u"Note: python-gpgme is not installed, we will not be able to verify binary signatures." ERROR_CONNECTING = u"Trouble connecting to Dropbox servers. Maybe your internet connection is down, or you need to set your http_proxy environment variable." ERROR_SIGNATURE = u"Downloaded binary does not match Dropbox signature, aborting install." DOWNLOAD_LOCATION_FMT = "https://www.dropbox.com/download?plat=%s" SIGNATURE_LOCATION_FMT = "https://www.dropbox.com/download?plat=%s&signature=1" DOWNLOADING = u"Downloading Dropbox... %d%%" UNPACKING = u"Unpacking Dropbox... %d%%" PARENT_DIR = os.path.expanduser("~") DROPBOXD_PATH = "%s/.dropbox-dist/dropboxd" % PARENT_DIR DESKTOP_FILE = u"/usr/share/applications/dropbox.desktop" enc = locale.getpreferredencoding() # Available from https://linux.dropbox.com/fedora/rpm-public-key.asc DROPBOX_PUBLIC_KEY = """ -----BEGIN PGP PUBLIC KEY BLOCK----- Version: SKS 1.1.0 mQENBEt0ibEBCACv4hZRPqwtpU6z8+BB5YZU1a3yjEvg2W68+a6hEwxtCa2U++4dzQ+7EqaU q5ybQnwtbDdpFpsOi9x31J+PCpufPUfIG694/0rlEpmzl2GWzY8NqfdBFGGm/SPSSwvKbeNc FMRLu5neo7W9kwvfMbGjHmvUbzBUVpCVKD0OEEf1q/Ii0Qcekx9CMoLvWq7ZwNHEbNnij7ec nvwNlE2MxNsOSJj+hwZGK+tM19kuYGSKw4b5mR8IyThlgiSLIfpSBh1n2KX+TDdk9GR+57TY vlRu6nTPu98P05IlrrCP+KF0hYZYOaMvQs9Rmc09tc/eoQlN0kkaBWw9Rv/dvLVc0aUXABEB AAG0MURyb3Bib3ggQXV0b21hdGljIFNpZ25pbmcgS2V5IDxsaW51eEBkcm9wYm94LmNvbT6J ATYEEwECACAFAkt0ibECGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRD8kYszUESRLi/z B/wMscEa15rS+0mIpsORknD7kawKwyda+LHdtZc0hD/73QGFINR2P23UTol/R4nyAFEuYNsF 0C4IAD6y4pL49eZ72IktPrr4H27Q9eXhNZfJhD7BvQMBx75L0F5gSQwuC7GdYNlwSlCD0AAh Qbi70VBwzeIgITBkMQcJIhLvllYo/AKD7Gv9huy4RLaIoSeofp+2Q0zUHNPl/7zymOqu+5Ox e1ltuJT/kd/8hU+N5WNxJTSaOK0sF1/wWFM6rWd6XQUP03VyNosAevX5tBo++iD1WY2/lFVU JkvAvge2WFk3c6tAwZT/tKxspFy4M/tNbDKeyvr685XKJw9ei6GcOGHD =5rWG -----END PGP PUBLIC KEY BLOCK----- """ # Futures def methodcaller(name, *args, **kwargs): def caller(obj): return getattr(obj, name)(*args, **kwargs) return caller def relpath(path, start=curdir): """Return a relative version of a path""" if not path: raise ValueError("no path specified") if type(start) is unicode: start_list = unicode_abspath(start).split(sep) else: start_list = abspath(start).split(sep) if type(path) is unicode: path_list = unicode_abspath(path).split(sep) else: path_list = abspath(path).split(sep) # Work out how much of the filepath is shared by start and path. i = len(commonprefix([start_list, path_list])) rel_list = [pardir] * (len(start_list)-i) + path_list[i:] if not rel_list: return curdir return join(*rel_list) # End Futures def console_print(st=u"", f=sys.stdout, linebreak=True): global enc assert type(st) is unicode f.write(st.encode(enc)) if linebreak: f.write(os.linesep) def console_flush(f=sys.stdout): f.flush() def yes_no_question(question): while True: console_print(question, linebreak=False) console_print(u" [y/n] ", linebreak=False) console_flush() text = raw_input() if text.lower().startswith("y"): return True elif text.lower().startswith("n"): return False else: console_print(u"Sorry, I didn't understand that. Please type yes or no.") def plat(): if sys.platform.lower().startswith('linux'): arch = platform.machine() if (arch[0] == 'i' and arch[1].isdigit() and arch[2:4] == '86'): plat = "x86" elif arch == 'x86_64': plat = arch else: FatalVisibleError("Platform not supported") return "lnx.%s" % plat else: FatalVisibleError("Platform not supported") def is_dropbox_running(): pidfile = os.path.expanduser("~/.dropbox/dropbox.pid") try: with open(pidfile, "r") as f: pid = int(f.read()) with open("/proc/%d/cmdline" % pid, "r") as f: cmdline = f.read().lower() except: cmdline = "" return "dropbox" in cmdline def unicode_abspath(path): global enc assert type(path) is unicode # shouldn't pass unicode to this craphead, it appends with os.getcwd() which is always a str return os.path.abspath(path.encode(sys.getfilesystemencoding())).decode(sys.getfilesystemencoding()) </source>
返回到
沙盒
。
导航
首页
社区入口
当前事件
最近更改
随机页面
帮助
查看
页面
讨论
查看源代码
历史
个人工具
登录/创建账户
搜索
简体繁体转换
不转换
简体
繁體
工具箱
链入页面
链出更改
特殊页面