Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 60 lines (48 sloc) 1.947 kb
#!/usr/bin/python
import commands, os
sourceFile = "usr/lib/linuxmint/mintUpload/upload-manager.py"
menuName = commands.getoutput("cat " + sourceFile + " | grep menuName")
menuName = menuName.replace("menuName", "")
menuName = menuName.replace("=", "")
menuName = menuName.replace("_(", "")
menuName = menuName.replace("\"", "")
menuName = menuName.replace(")", "")
menuName = menuName.strip()
menuComment = commands.getoutput("cat " + sourceFile + " | grep menuComment")
menuComment = menuComment.replace("menuComment", "")
menuComment = menuComment.replace("=", "")
menuComment = menuComment.replace("_(", "")
menuComment = menuComment.replace("\"", "")
menuComment = menuComment.replace(")", "")
menuComment = menuComment.strip()
desktopFile = open("usr/share/applications/upload-manager.desktop", "w")
desktopFile.writelines("""[Desktop Entry]
Name=Upload Manager
""")
import gettext
gettext.install("mintupload", "/usr/share/linuxmint/locale")
for directory in os.listdir("/usr/share/linuxmint/locale"):
if os.path.isdir(os.path.join("/usr/share/linuxmint/locale", directory)):
try:
language = gettext.translation('mintupload', "/usr/share/linuxmint/locale", languages=[directory])
language.install()
desktopFile.writelines("Name[%s]=%s\n" % (directory, _(menuName)))
except:
pass
desktopFile.writelines("Comment=Define upload services\n")
for directory in os.listdir("/usr/share/linuxmint/locale"):
if os.path.isdir(os.path.join("/usr/share/linuxmint/locale", directory)):
try:
language = gettext.translation('mintupload', "/usr/share/linuxmint/locale", languages=[directory])
language.install()
desktopFile.writelines("Comment[%s]=%s\n" % (directory, _(menuComment)))
except:
pass
desktopFile.writelines("""Exec=mintupload-manager
Icon=/usr/lib/linuxmint/mintUpload/icon.svg
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Application;System;Settings
StartupNotify=false
""")
Jump to Line
Something went wrong with that request. Please try again.