- # Get the default charset.
- try:
- lcAll = locale.getdefaultlocale()
- except locale.Error, err:
- print >>sys.stderr, "WARNING:", err
- lcAll = []
-
- if len(lcAll) == 2:
- default_encoding = lcAll[1]
- else:
- try:
- default_encoding = locale.getpreferredencoding()
- except locale.Error, err:
- print >>sys.stderr, "WARNING:", err
- default_encoding = sys.getdefaultencoding()
+ # Get the default charset.
+ try:
+ lcAll = locale.getdefaultlocale()
+ except locale.Error, err:
+ print >>sys.stderr, "WARNING:", err
+ lcAll = []
+
+ if len(lcAll) == 2:
+ default_encoding = lcAll[1]
+ else:
+ try:
+ default_encoding = locale.getpreferredencoding()
+ except locale.Error, err:
+ print >>sys.stderr, "WARNING:", err
+ default_encoding = sys.getdefaultencoding()
This is not a program. Put the script in $HOME/[.local/share/].mc/extfs.d or
/usr/[local/][lib|share]/mc/extfs. For more information read the source!""",
This is not a program. Put the script in $HOME/[.local/share/].mc/extfs.d or
/usr/[local/][lib|share]/mc/extfs. For more information read the source!""",
- path = path.decode('utf-8', 'replace').encode(default_encoding, 'replace')
+ path = path.decode('utf-8', 'replace').encode(
+ default_encoding, 'replace')
- _name_utf8 = _name_utf8.decode(encoding, 'replace').encode('utf-8', 'replace')
+ _name_utf8 = _name_utf8.decode(
+ encoding, 'replace').encode('utf-8', 'replace')
- path = path.decode('utf-8', 'replace').encode(default_encoding, 'replace')
+ path = path.decode('utf-8', 'replace').encode(
+ default_encoding, 'replace')
- path = path.decode('utf-8', 'replace').encode(default_encoding, 'replace')
+ path = path.decode('utf-8', 'replace').encode(
+ default_encoding, 'replace')
- path = path.decode(encoding, 'replace').encode(default_encoding, 'replace')
+ path = path.decode(encoding, 'replace').encode(
+ default_encoding, 'replace')
- name = name_utf8.decode('utf-8', 'replace').encode(default_encoding, 'replace')
+ name = name_utf8.decode('utf-8', 'replace').encode(
+ default_encoding, 'replace')
- name = name.decode(encoding, 'replace').encode(default_encoding, 'replace')
+ name = name.decode(encoding, 'replace').encode(
+ default_encoding, 'replace')
'created by', 'creation date', 'encoding', \
'nodes', 'publisher', 'publisher-url':
if name == 'comment' and 'comment.utf-8' in torrent:
'created by', 'creation date', 'encoding', \
'nodes', 'publisher', 'publisher-url':
if name == 'comment' and 'comment.utf-8' in torrent:
meta.append(('.META/' + name, len(data)))
elif name in torrent:
if name == 'announce-list':
meta.append(('.META/' + name, len(data)))
elif name in torrent:
if name == 'announce-list':
'created by', 'creation date', 'encoding', \
'nodes', 'publisher', 'publisher-url':
if name == 'comment' and 'comment.utf-8' in torrent:
'created by', 'creation date', 'encoding', \
'nodes', 'publisher', 'publisher-url':
if name == 'comment' and 'comment.utf-8' in torrent:
- data = ['%s:%s' % (host, port) for host, port in torrent[name]]
+ data = ['%s:%s' % (host, port)
+ for host, port in torrent[name]]
"""Put a file to the VFS"""
sys.exit("Torrent VFS doesn't support adding files (read-only filesystem)")
"""Put a file to the VFS"""
sys.exit("Torrent VFS doesn't support adding files (read-only filesystem)")
def torrent_error(error_str):
logger.critical("Error parsing the torrent metafile: %s", error_str)
sys.exit(1)
def torrent_error(error_str):
logger.critical("Error parsing the torrent metafile: %s", error_str)
sys.exit(1)
def decode_datetime(dt):
Y, m, d, H, M = localtime(float(dt))[0:5]
return "%02d-%02d-%d %02d:%02d" % (m, d, Y, H, M)
def decode_datetime(dt):
Y, m, d, H, M = localtime(float(dt))[0:5]
return "%02d-%02d-%d %02d:%02d" % (m, d, Y, H, M)