[vdown commit] r59 - in trunk: . po po/de_DE/LC_MESSAGES

0 views
Skip to first unread message

codesite...@google.com

unread,
Nov 14, 2007, 10:50:09 AM11/14/07
to vdow...@googlegroups.com
Author: kopfgeldjaeger
Date: Wed Nov 14 07:49:42 2007
New Revision: 59

Removed:
trunk/po/gvdown.pot
Modified:
trunk/cli.py
trunk/gui.py
trunk/gvdown.glade
trunk/po/de_DE.po
trunk/po/de_DE/LC_MESSAGES/gvdown.mo

Log:
added SAVE-TO option in cli, updated translation, added OptionParser

Modified: trunk/cli.py
==============================================================================
--- trunk/cli.py (original)
+++ trunk/cli.py Wed Nov 14 07:49:42 2007
@@ -38,6 +38,7 @@
from time import sleep
import gettext
from user import home as userhome
+from optparse import OptionParser

# <Tranlations stuff>

@@ -45,89 +46,95 @@

# </Translation stuff>

-try:
- if os.path.isdir(sys.argv[1]):
- save_videos_in = sys.argv[1]
- else:
- save_videos_in = "."
-except IndexError:
- print _("Please specify at least one parameter.")
- print _("Examples: ")
- print sys.argv[0]+_(" /home/testuser/videos URL1 [URL2 ...]")
- print _("or")
- print sys.argv[0]+_(" URL1 [URL2 ...]")
- sys.exit(1)
+parser = OptionParser(usage=_("Usage: %prog [options] URL1 [URL2] [...]"))
+
+parser.remove_option("-h")
+parser.add_option("-h", "--help", action="help", help=_("show this
help message and exit"))
+
+parser.add_option("-d", "--destination", dest="destination",
+ help=_("save videos in DEST"), metavar="DEST", default=".")

-if not folder_is_writable(save_videos_in):
+parser.add_option("-s", "--save-as", dest="saveAs", help=_("save video
file as FILE"), metavar="FILE", default=None)
+
+(options, args) = parser.parse_args()
+
+if not folder_is_writable(options.destination):
print _("Can't write to this directory! Change to another.")
sys.exit(1)

config = configuration()
config.readconfig()

-for i in sys.argv:
- if i != sys.argv[0] and i != save_videos_in:
- print "----"
- print _("Trying to download the video...")
- print _("URL: %(url)s") % {"url" : i}
- try:
- data = get_data(i)
- data.start()
- while data.status == -1:
- time.sleep(0.02)
- if data.status == 0:
- saveAs = os.path.join(save_videos_in, data.data[2])
- print _('Saving file as "%(file)s"...') % {"file" : saveAs}
- down = fdownload(data.data[0], saveAs)
- down.start()
- progress = down.downloaded()
- last_progress = progress
- last_ETA = 0.00
- putWinString = False
- sleep(1) # give "it" some time to get the filesize,
otherwise it'd be just '100'
+if len(args) < 1:
+ print _("Specify at least one video.")
+ sys.exit(1)
+
+for i in args:
+
+ print "----"
+ print _("Trying to download the video...")
+ print _("URL: %(url)s") % {"url" : i}
+ try:
+ data = get_data(i)
+ data.start()
+ while data.status == -1:
+ sleep(0.02)
+ if data.status == 0:
+ if options.saveAs != None:
+ saveAs = options.saveAs
+ else:
+ saveAs = os.path.join(options.destination, data.data[2])
+ print _('Saving file as "%(file)s"...') % {"file" : saveAs}
+ down = fdownload(data.data[0], saveAs)
+ down.start()
+ progress = down.downloaded()
+ last_progress = progress
+ last_ETA = 0.00
+ putWinString = False
+ sleep(1) # give "it" some time to get the filesize,
otherwise it'd be just '100'
+ filesize = down.get_filesize()
+ while filesize == 0: # if it was not enough
+ sleep(1)
filesize = down.get_filesize()
- while filesize == 0: # if it was not enough
+ print _("Filesize: %(filesize)s KB") % {"filesize" : filesize}
+ while True:
+ progress_dif = progress-last_progress
+ kb_per_sec = filesize*(progress_dif/100)
+ downloaded_kb = (progress/100)*filesize
+ left_kb = filesize-downloaded_kb
+ kb_per_sec_asfloat = "%.2f" % (float(kb_per_sec))
+ if kb_per_sec < 1:
+ if last_ETA == 0.00:
+ ETA = "?"
+ else:
+ ETA = "%.2f" % (left_kb/kb_per_sec) # may be inexact!
+ last_ETA = ETA # if kb_per_sec is 0 and something
was already downloaded, print the last ETA
+ seconds_string = _("seconds") # gettext + this one
line under me...
+ if sys.platform == "linux2":
+ sys.stdout.write("\r%.2f \033[6G %% | %s \033[18G
KB/s | ETA: %s \033[38G%s" % (float(progress),
str(kb_per_sec_asfloat).rjust(7), ETA, seconds_string)) # makes it look
more static
+ sys.stdout.flush()
+ last_progress = progress
sleep(1)
- filesize = down.get_filesize()
- print _("Filesize: %(filesize)s KB") % {"filesize" : filesize}
- while True:
- progress_dif = progress-last_progress
- kb_per_sec = filesize*(progress_dif/100)
- downloaded_kb = (progress/100)*filesize
- left_kb = filesize-downloaded_kb
- kb_per_sec_asfloat = "%.2f" % (float(kb_per_sec))
- if kb_per_sec < 1:
- if last_ETA == 0.00:
- ETA = "?"
- else:
- ETA = "%.2f" % (left_kb/kb_per_sec) # may be inexact!
- last_ETA = ETA # if kb_per_sec is 0 and
something was already downloaded, print the last ETA
- seconds_string = _("seconds") # gettext + this one
line under me...
- if sys.platform == "linux2":
- sys.stdout.write("\r%.2f \033[6G %% | %s
\033[18G KB/s | ETA: %s \033[38G%s" % (float(progress),
str(kb_per_sec_asfloat).rjust(7), ETA, seconds_string)) # makes it look
more static
- sys.stdout.flush()
- last_progress = progress
- sleep(1)
- progress = down.downloaded()
- if sys.platform != "linux2" and putWinString == False:
- print _("Downloading...")
- putWinString = True
- if(progress == 100.0):
- sys.stdout.write(_("\rDownload finished...
\n"))
- if config.getboolean("general", "convert") and data.data[3]:
- print _("Converting file...")
- output = fconvert(saveAs,
config.get("general", "convert_filename_extension"), config.get("general", "convertcmd"))
- output.start()
- while output.status == -1:
- sleep(0.2)
- print _("Converted file.")
- if config.getboolean("general", "delete_source_file_after_converting"):
- os.remove(saveAs)
- print _("Deleted input (.flv) file")
- break
- else:
- print _("Could not fetch the wanted line. Wrong URL or
unsupported video portal! But better try again.")
- except KeyboardInterrupt:
- print _("\nKilled by CTRL+C, quitting...")
- sys.exit(1)
- print "----"
+ progress = down.downloaded()
+ if sys.platform != "linux2" and putWinString == False:
+ print _("Downloading...")
+ putWinString = True
+ if(progress == 100.0):
+ sys.stdout.write(_("\rDownload finished...
\n"))
+ if config.getboolean("general", "convert") and data.data[3]:
+ print _("Converting file...")
+ output = fconvert(saveAs,
config.get("general", "convert_filename_extension"), config.get("general", "convertcmd"))
+ output.start()
+ while output.status == -1:
+ sleep(0.2)
+ print _("Converted file.")
+ if config.getboolean("general", "delete_source_file_after_converting"):
+ os.remove(saveAs)
+ print _("Deleted input (.flv) file")
+ break
+ else:
+ print _("Could not fetch the wanted line. Wrong URL or
unsupported video portal! But better try again.")
+ except KeyboardInterrupt:
+ print _("\nKilled by CTRL+C, quitting...")
+ sys.exit(1)
+ print "----"

Modified: trunk/gui.py
==============================================================================
--- trunk/gui.py (original)
+++ trunk/gui.py Wed Nov 14 07:49:42 2007
@@ -280,12 +280,14 @@
sfcb = self.wTree.get_widget("sfcb") # settings filechooser button
convertbutton = self.wTree.get_widget("convertbutton")
convertcmdentry = self.wTree.get_widget("convertcmdentry")
+ fextension_entry = self.wTree.get_widget("fextension_entry")
deletesourcefilebutton = self.wTree.get_widget("deletesourcefilebutton")
sfcb.set_local_only(True)
sfcb.set_show_hidden(False)
sfcb.set_current_folder(self.config.get("general", "save_videos_in"))
convertbutton.set_active(self.config.getboolean("general", "convert"))
convertcmdentry.set_text(self.config.get("general", "convertcmd"))
+ fextension_entry.set_text(self.config.get("general", "convert_filename_extension"))
deletesourcefilebutton.set_active(self.config.getboolean("general", "delete_source_file_after_converting"))
swindow.show()

@@ -299,6 +301,7 @@
swindow = self.wTree.get_widget("settingswindow")
convertcmdentry = self.wTree.get_widget("convertcmdentry")
convertbutton = self.wTree.get_widget("convertbutton")
+ fextension_entry = self.wTree.get_widget("fextension_entry")
deletesourcefilebutton = self.wTree.get_widget("deletesourcefilebutton")
outputdir = sfcb.get_filename()
if convertbutton.get_active():
@@ -307,6 +310,7 @@
self.config.set("general", "convert", "no")
convertcmd = convertcmdentry.get_text()
self.config.set("general", "convertcmd", convertcmd)
+ self.config.set("general", "convert_filename_extension", fextension_entry.get_text())
deletesourcefile = deletesourcefilebutton.get_active()
if deletesourcefile:
self.config.set("general", "delete_source_file_after_converting", "yes")

Modified: trunk/gvdown.glade
==============================================================================
--- trunk/gvdown.glade (original)
+++ trunk/gvdown.glade Wed Nov 14 07:49:42 2007
@@ -419,6 +419,42 @@
</packing>
</child>
<child>
+ <widget class="GtkHSeparator" id="hseparator4">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">7</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox6">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkLabel" id="fextenstion_label">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Filename extension</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="fextension_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">8</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkButton" id="swindow_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -429,7 +465,7 @@
<signal name="clicked" handler="swindow_close_clicked"/>
</widget>
<packing>
- <property name="position">7</property>
+ <property name="position">9</property>
</packing>
</child>
</widget>

Modified: trunk/po/de_DE.po
==============================================================================
--- trunk/po/de_DE.po (original)
+++ trunk/po/de_DE.po Wed Nov 14 07:49:42 2007
@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.5.x\n"
+"Project-Id-Version: 0.x.x\n"
"Report-Msgid-Bugs-To: Nicolai Spohrer <nic...@xeve.de>\n"
-"POT-Creation-Date: 2007-10-16 21:59+0200\n"
-"PO-Revision-Date: 2007-10-16 22:00+0200\n"
+"POT-Creation-Date: 2007-11-14 16:25+0100\n"
+"PO-Revision-Date: 2007-11-14 16:18+0100\n"
"Last-Translator: Nicolai Spohrer <nic...@xeve.de>\n"
"Language-Team: German\n"
"MIME-Version: 1.0\n"
@@ -16,104 +16,114 @@
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

-#: cli.py:53
-msgid "Please specify at least one parameter."
-msgstr "Bitte mindestens einen Parameter übergeben."
-
-#: cli.py:54
-msgid "Examples: "
-msgstr "Beispiele:"
+#: cli.py:49
+msgid "Usage: %prog [options] URL1 [URL2] [...]"
+msgstr "%prog [options] URL1 [URL2] [...]"
+
+#: cli.py:52
+msgid "show this help message and exit"
+msgstr "zeige diese Hilfsnachricht und breche ab"

#: cli.py:55
-msgid " /home/testuser/videos URL1 [URL2 ...]"
-msgstr " /home/testuser/videos URL1 [URL2 ...]"
-
-#: cli.py:56
-msgid "or"
-msgstr "oder"
+msgid "save videos in DEST"
+msgstr "speichere Videos in DEST"

#: cli.py:57
-msgid " URL1 [URL2 ...]"
-msgstr " URL1 [URL2 ...]"
+msgid "save video file as FILE"
+msgstr "speichere Video als FILE"

-#: cli.py:61
+#: cli.py:62
msgid "Can't write to this directory! Change to another."
-msgstr "In dieses Verzeichnis kann nicht geschrieben! Bitte in ein
anderes wechseln."
+msgstr "In dieses Verzeichnis kann nicht geschrieben werden! Bitte in
ein anderes wechseln."
+
+#: cli.py:69
+#, fuzzy
+msgid "Specify at least one video."
+msgstr "Bitte mindestens einen Parameter übergeben."

-#: cli.py:70
+#: cli.py:75
msgid "Trying to download the video..."
msgstr "Versuche, das Video herunterzuladen..."

-#: cli.py:71
+#: cli.py:76
#, python-format
msgid "URL: %(url)s"
-msgstr "URL: %(url)s"
+msgstr ""

-#: cli.py:78
+#: cli.py:87
#, python-format
msgid "Saving file as \"%(file)s\"..."
msgstr "Speichere Datei als \"%(file)s\"..."

-#: cli.py:89 gui.py:235
+#: cli.py:99 gui.py:243
#, python-format
msgid "Filesize: %(filesize)s KB"
msgstr "Dateigröße: %(filesize)s KB"

-#: cli.py:102
+#: cli.py:112
msgid "seconds"
msgstr "Sekunden"

-#: cli.py:109
+#: cli.py:120
+msgid "Downloading..."
+msgstr "Lade herunter..."
+
+#: cli.py:123
+#, fuzzy
msgid ""
"\rDownload "
-"finished... \n"
+"finished... \n"
msgstr ""
-"\rDownload "
-"beendet... \n"
+"\rDownload beendet...
\n"

-#: cli.py:111
+#: cli.py:125
msgid "Converting file..."
msgstr "Konvertiere Datei..."

-#: cli.py:116 gui.py:153 gui.py:253
+#: cli.py:130 gui.py:154 gui.py:261
msgid "Converted file."
msgstr "Datei konvertiert."

-#: cli.py:119 gui.py:156 gui.py:256
+#: cli.py:133 gui.py:157 gui.py:264
msgid "Deleted input (.flv) file"
-msgstr "Eingangsdatei (.flv) gelöscht"
+msgstr "Quelldatei (.flv) gelöscht"

-#: cli.py:122
+#: cli.py:136
msgid ""
"Could not fetch the wanted line. Wrong URL or unsupported video
portal! But "
"better try again."
-msgstr ""
-"Konnte die gesuchte Zeile nicht finden. Falsche URL oder
nichtunterstütztes Videoportal! Aber besser nochmal versuchen..."
+msgstr "Konnte die gesuchte Zeile nicht finden. Falsche URL oder nicht
unterstütztes Videoportal! "
+"Aber am besten nochmal versuchen."

-#: cli.py:124
+#: cli.py:138
msgid ""
"\n"
"Killed by CTRL+C, quitting..."
msgstr ""
"\n"
-"Durch STRG+C getötet, verlassend..."
+"Getötet von STRG+C, verlassend..."
+
#: gui.py:92
+#, fuzzy, python-format
msgid ""
"Could not create the directory where the videos shall be saved in (specified "
-"in ~/.gvdownrc)! Check permissions."
+"in %(configfile)s)! Check permissions."
msgstr ""
-"Konnte das Verzeichnis, in dem die Videos gespeichert werden sollen
(siehe ~/.gvdownrc) nicht anlegen! Zugriffsrechte überprüfen."
+"Konnte das Verzeichnis, in dem die Videos gespeichert werden sollen (siehe "
+"~/.gvdownrc) nicht anlegen! Zugriffsrechte überprüfen."

#: gui.py:95
+#, fuzzy, python-format
msgid ""
"Cannot write to video output directoy! Check permissions or change the "
-"directory in ~/.gvdownrc"
+"directory in %(configfile)s"
msgstr ""
-"Kann in den Video-Speicherort nicht schreiben! Zugriffsrechte
überprüfen oder das Verzeichnis in ~/.gvdownrc ändern."
+"Kann in den Video-Speicherort nicht schreiben! Zugriffsrechte überprüfen "
+"oder das Verzeichnis in ~/.gvdownrc ändern."

-#: gui.py:109 gui.py:210
+#: gui.py:109 gui.py:216
msgid "Fetching video information..."
-msgstr "Hole Videoinformationen..."
+msgstr "Hole Videoinformationen"

#: gui.py:111
msgid "No URL specified"
@@ -124,73 +134,87 @@
msgid "Trying to download %(url)s"
msgstr "Versuche, %(url)s herunterzuladen"

-#: gui.py:129
+#: gui.py:130
msgid "Downloading video..."
msgstr "Lade Video herunter..."

-#: gui.py:144
+#: gui.py:145
msgid "Download finished."
-msgstr "Download beendet."
+msgstr "Download beendet"

-#: gui.py:146 gui.py:246
+#: gui.py:147 gui.py:254
msgid "Converting file"
msgstr "Konvertiere Datei"

-#: gui.py:158 gui.py:258
+#: gui.py:159 gui.py:266
msgid "Wrong URL / unsupported video portal"
-msgstr "Falsche URL / n. unterstützes Portal"
+msgstr "Falsche URL / n. unterstütztes Videoportal"

-#: gui.py:204
+#: gui.py:210
msgid "Downloading a list..."
-msgstr "Lade Liste herunter..."
+msgstr "Lade eine Liste herunter..."

-#: gui.py:217
+#: gui.py:223
#, python-format
msgid "Trying to download %(link)s"
-msgstr "Versuche, %(link)s herunterzuladen"
+msgstr ""

-#: gui.py:225
+#: gui.py:233
#, python-format
msgid "Saving file as \"%(filename)s\"..."
msgstr "Speichere Datei als \"%(filename)s\"..."

-#: gui.py:228
-#, python-format
-msgid "Downloading video #%(number)s"
+#: gui.py:236
+#, fuzzy, python-format
+msgid "Downloading video %(number)s"
msgstr "Lade Video #%(number)s"

-#: gui.py:243
+#: gui.py:251
#, python-format
msgid "Finished download #%(number)s"
-msgstr "Download #%(number)s beendet"
+msgstr "Video #%(number)s beendet"

-#: gui.py:259
+#: gui.py:267
#, python-format
msgid "Download #%(number)s failed"
msgstr "Download #%(number)s gescheitert"

-#: gui.py:262
+#: gui.py:270
#, python-format
msgid "%(successful)s of %(all)s successful"
msgstr "%(successful)s von %(all)s erfolgreich"

-#: gui.py:310
+#: gui.py:321
msgid "Cannot write to video output folder. Choose another."
msgstr "Kann in den Video-Speicheroirt nicht schreiben. Bitte anderen wählen."

-#: gui.py:323
+#: gui.py:334
#, python-format
msgid "Could not open %(gladefile)s"
msgstr "Konnte %(gladefile)s nicht öffnen"

-#: main.py:147
+#: main.py:157
#, python-format
msgid "Config file %s not found. Creating one for you..."
-msgstr "Konfigurationsdatei %s nicht gefunden. Erstelle eine..."
+msgstr "Die Konfigurationsdatei %s konnte nicht gefunden werden. Es
wird eine erstellt..."

-#: main.py:164
+#: main.py:180
msgid "Setting settings to default..."
-msgstr "Setze Einstellungen auf Standard..."
+msgstr "Setze Einstellungen auf Standard zurück..."
+
+#: main.py:208
+#, fuzzy, python-format
+msgid "Download link : %(dlink)s"
+msgstr "Lade Video #%(number)s"
+
+#: main.py:209
+#, python-format
+msgid "Video name : %(vname)s"
+msgstr "Videoname: : %(vname)s"
+
+#: main.py:211
+msgid "Could not fetch the wanted line. Wrong URL or unsupported video portal!"
+msgstr "Konnte die gesuchte Zeile nicht finden. Falsche URL oder nicht
unterstütztes Videoportal!"

#: gvdown.glade.h:1
msgid "Close window"
@@ -203,15 +227,15 @@
"(%i = inputfile, %o = outputfile)"
msgstr ""
"Konvertierungskommando\n"
-"(%i = Quelldatei, %o = Ausgangsdatei)"
+"(%i = Quelldatei, %o = Zieldatei)"

#: gvdown.glade.h:5
msgid "Convert videos"
-msgstr "Konvertiere Videos"
+msgstr "Videos konvertiert"

#: gvdown.glade.h:6
msgid "Delete source (.flv) file"
-msgstr "Quelldatei (.flv) löschen"
+msgstr "Quelldatei (.flv) gelöscht"

#: gvdown.glade.h:7
msgid "Download it!"
@@ -219,40 +243,44 @@

#: gvdown.glade.h:8
msgid "Enter the URL of the video:"
-msgstr "Bitte die URL des Videos eingeben:"
+msgstr "Bitte dir URL des Videos eingeben:"

#: gvdown.glade.h:9
+msgid "Filename extension"
+msgstr "Dateinamenserweiterung"
+
+#: gvdown.glade.h:10
msgid "Nothing to do"
msgstr "Nichts zu tun"

-#: gvdown.glade.h:10
+#: gvdown.glade.h:11
msgid "Save videos in (must be writable!):"
-msgstr "Videos speichern in (muss beschreibbar sein!):"
+msgstr "Speiche Videos in (muss beschreibbar sein!):"

-#: gvdown.glade.h:11
+#: gvdown.glade.h:12
msgid "Settings"
msgstr "Einstellungen"

-#: gvdown.glade.h:12
+#: gvdown.glade.h:13
msgid "This program is licenced under the GPLv3."
-msgstr "Dieses Programm ist unter der GPLv3 lizenziert."
+msgstr "Diese Anwendung ist lizenziert unter der GPLv3."

-#: gvdown.glade.h:13
+#: gvdown.glade.h:14
msgid "_File"
msgstr "_Datei"

-#: gvdown.glade.h:14
+#: gvdown.glade.h:15
msgid "_Help"
msgstr "_Hilfe"

-#: gvdown.glade.h:15
+#: gvdown.glade.h:16
msgid "gtk-close"
-msgstr "gtk-close"
+msgstr ""

-#: gvdown.glade.h:16
+#: gvdown.glade.h:17
msgid "gvdown"
-msgstr "gvdown"
+msgstr ""

-#: gvdown.glade.h:18
+#: gvdown.glade.h:19
msgid "translator-credits"
msgstr "Nicolai Spohrer <nic...@xeve.de>"

Modified: trunk/po/de_DE/LC_MESSAGES/gvdown.mo
==============================================================================
Binary files. No diff available.

Reply all
Reply to author
Forward
0 new messages