support command line arguments
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| PyShare |
Wishlist
|
Unassigned |
Bug Description
It would be very cool if PyShare would support command line arguments, too, so it could be used from other applications, too (i.e. in my case thunar and bibble5)
I'm not really into python, but for me the following hack to sendFiles works:
if __name__ == "__main__":
if environ.
files = environ[
else:
#parse command line arguments of no nautilus environment is found
files = sys.argv[1:]
Sebastian "Nait" Kacprzak (naicik) wrote : | #1 |
Changed in pyshare: | |
status: | New → Incomplete |
importance: | Undecided → Wishlist |
Spoilerhead (spoilerhead) wrote : | #2 |
Oh, I got to try that when I get home.
What I try to do:
* use it in Thunar as a custom user action, i.e. right click on a file -> sendfiles . Thunar can call a script with the filenames in argv
* use it in Bibble5 (a raw development/image management tool) to upload directly to imageshack. again, a script can be called with the filename as parameter.
* i bet other users can think about a multitude of other uses :)
Sebastian "Nait" Kacprzak (naicik) wrote : | #3 |
I remember that people used old PyShare versions with Thunar actions successfully. About 0.4.0 I introduced a problem for them with setting "allow only one instance" which relied on DBus. If you don't have dbus installed you may want to turn this setting of.
As PyShare would probably wont run here is nasty workaround:
change this lines in Settings.py from
86 def getAllowOneInst
87 return self.__
to :
def getAllowOneInst
return false
I cannot check it at the moment, because I don't have any XFCE only distro installed.
In the future I plan to split PyShare on several packages(
Spoilerhead (spoilerhead) wrote : | #4 |
that takes me a step further
unfortunately it fails instantly with "Upload failed"
The console output is just
translations for your language don't yet exist
translations for your language don't yet exist
(i just upgraded to 0.6.2rc, previously hacked around in 0.5.2)
This is on a Xubuntu 11.04 machine btw, but i can test on a pure xfce crunchbang, too if needed.
Sebastian "Nait" Kacprzak (naicik) wrote : | #5 |
Could you take a look at the ~/.pyshare/errorLog ? If there is something there please post it. Not existing translations should not be fatal.
Spoilerhead (spoilerhead) wrote : | #6 |
ERROR:pluginWra
Traceback (most recent call last):
File "/home/
apply(method, arguments)
File "/home/
credentials = Settings(
File "/home/
key = Keyring(
File "/home/
cls.instance = super(Singleton, cls).__
File "/home/
"proxy": None})
File "/home/
if self._new_
File "/home/
items = gkey.find_
NoMatchError
Sebastian "Nait" Kacprzak (naicik) wrote : | #7 |
Please try new version https:/
Spoilerhead (spoilerhead) wrote : | #8 |
Seems to work, thank you very much!
Sebastian "Nait" Kacprzak (naicik) wrote : | #9 |
Glad to here that.
I don't longer know how to categorize this "bug" so I will close it as invalid. If you come up with more specific title and description what was fixed/or needs to be improved you may reopen this bug or make a new one.
Changed in pyshare: | |
status: | Incomplete → Invalid |
Well you can already run first branch of if by calling sendFiles script and else branch by invoking PyShare_GTK.py.
Could you specify what behavior exactly would you expect? (I have some ideas about improving CLI support, but would like to hear your idea).