wget http://webupd8.googlecode.com/files/script.py não está funcionando

0

Enquanto tenta executar o erro inacessível de rede de comando abaixo está chegando.

wget http://webupd8.googlecode.com/files/script.py
--2013-07-24 12:05:23--  http://webupd8.googlecode.com/files/script.py
Resolving webupd8.googlecode.com (webupd8.googlecode.com)... 173.194.70.82, 2a00:1450:4001:c02::52
Connecting to webupd8.googlecode.com (webupd8.googlecode.com)|173.194.70.82|:80... failed: Connection timed out.
Connecting to webupd8.googlecode.com (webupd8.googlecode.com)|2a00:1450:4001:c02::52|:80... failed: Network is unreachable.
    
por user177898 24.07.2013 / 08:47

1 resposta

1

Eu fiz o download do arquivo com sucesso. Se o seu ISP tiver algum problema com o servidor webupd8, então não há problema, eu baixei o script para você.

frank@FRANK-NATHE:~$ cat script.py 
#!/usr/bin/python
#credits: ppd @ Ubuntuforums.org: http://ubuntuforums.org/showthread.php?t=1954637

import shutil
import sys
import os

def getparent (content, line_nr):
    for i in range (line_nr - 1, -1, -1):
        if "{" in content[i].lstrip():
            return content[i].lstrip().split(" ")[0]

def change_line (content, key, value, parent):
    line_nr = 0
    for line in content:
        if line.lstrip().startswith(key + ":"):
            lparent = getparent(content, line_nr)
            if parent == lparent:
                content[line_nr] = key + ": " + value + "\n"
                return content
        line_nr = line_nr + 1        

def load_file (filename):
    file = open (filename, "r")
    content = file.readlines()
    file.close()
    return content

def write_file (filename, content):
    shutil.copyfile (filename, filename + ".bak")
    file = open (filename, "w")
    for line in content:
        file.write (line)
    file.close()
    return 

shell_qml = "/usr/share/unity-2d/shell/Shell.qml"
icontile_qml = "/usr/share/unity-2d/shell/common/IconTile.qml"
launcherlist_qml = "/usr/share/unity-2d/shell/launcher/LauncherList.qml"
launcheritem_qml = "/usr/share/unity-2d/shell/launcher/LauncherItem.qml"

if (len(sys.argv) > 1):
    icon_size = int(sys.argv[1])
else:
    sys.exit("Please enter your desired icon size as the first argument.")

if not os.geteuid() == 0:
    sys.exit("Script must be run as root.")

content = load_file (shell_qml)
content = change_line (content, "width", str (icon_size + 16), "LauncherLoader")
write_file (shell_qml, content)
content = load_file (icontile_qml)
content = change_line (content, "sourceSize.width", str (icon_size), "Image")
content = change_line (content, "sourceSize.height", str (icon_size), "Image")
write_file (icontile_qml, content)
content = load_file (launcherlist_qml)
content = change_line (content, "property int tileSize", str (icon_size + 6), "AutoScrollingListView")
content = change_line (content, "property int selectionOutlineSize", str (icon_size + 16), "AutoScrollingListView")
write_file (launcherlist_qml, content)
frank@FRANK-NATHE:~$ 
    
por rɑːdʒɑ 24.07.2013 / 08:56