I wrote it and use it all the time. I'll look at bugs. There are a few other people around who also use it. If you have some fixes, post a new version or a patch here and Michael who hosts it will probably pick it up.
I wrote it and use it all the time. I'll look at bugs. There are a few other people around who also use it. If you have some fixes, post a new version or a patch here and Michael who hosts it will probably pick it up.
This isn't a bug --- just a comment. I'm a python programmer as well and I noticed that your long help message is encoded in your source by repeatedly using string concatenation over multiple lines. An easier way to do this in python is by using triple quotes, i.e.
self.parser = OptionParser(
self.short_usage + """
Create smugmug galleries and upload to them. Mirror directory trees
on smugmug and keep up to date.
...
"""
Packaged for Fedora Core
I love sm_tool.py. I've packaged it up in an RPM for use with Fedora Core. I use it daily. Is the code hosted anywhere? i.e. sourceforge, etc.?
I love sm_tool.py. I've packaged it up in an RPM for use with Fedora Core. I use it daily. Is the code hosted anywhere? i.e. sourceforge, etc.?
jesus rodriguez
I appreciate that. I wrote this thing as personal software to solve a problem of my own. I've never gotten a good sense of how many people actually use this (though I think the SM people might be able to answer this.)
Anyway, it's never really grown out of a very informal sort of sharing. I'd be happy if someone picked it up and helped it grow up and move away from its parent's home.
I appreciate that. I wrote this thing as personal software to solve a problem of my own. I've never gotten a good sense of how many people actually use this (though I think the SM people might be able to answer this.)
Anyway, it's never really grown out of a very informal sort of sharing. I'd be happy if someone picked it up and helped it grow up and move away from its parent's home.
If you don't mind, I would be happy to create a sourceforge type project for
it. And be the Fedora Core package maintainer for it. I will post here with
the project site once it's ready.
If you don't mind, I would be happy to create a sourceforge type project for
it. And be the Fedora Core package maintainer for it. I will post here with
the project site once it's ready.
sincerely,
jesus rodriguez
sm_tool is not a valid project name, smtool conflicts with an existing
sourceforge project. If you don't mind I'd like to name it
sm-photo-tool. Let me know if that's ok. If you don't care, let me know
as well
Nice tool. I actually took part of the scipt, enhanced and modified it to make it easy to mirror galleries between multiple accounts. If your a programmer and need an interface to work with smugmug galleries you may find it useful. Thanks!
My version of this script stopped working for me on Sunday (after chugging along unchanged for years.) The power of open-source payed off and before I even got around to trying to debug it, the sm_tool.py user community found and submitted a bug fix. Basiccally, use a different URL for initializing the connection, and pass the API key.
I'm sorry, I've had sort of an IT infrastructure meltdown and I no longer have a great way to provide access to script, at least until September. I've sent mdm a copy of the most recent version of the script. Great if he hosts it.
I use your tool often (thanks!) and noticed it is broken, too. I tried to make your changes - but when I try to login, I get the following errors below.
(mind you I wrote an extension to your tool that I have been using for over a year, unchanged. It allows me to plug in the photograph ID from the URL and look up the name of my photograph in the command line.)
$ sm_tool.py getFileInfo 193759560
Traceback (most recent call last):
File "/usr/bin/sm_tool.py", line 744, in ?
main()
File "/usr/bin/sm_tool.py", line 735, in main
getInfo(argv[2],Options(argv[3:]))
File "/usr/bin/sm_tool.py", line 672, in getInfo
smugmug = Smugmug(opts.login,opts.password)
File "/usr/bin/sm_tool.py", line 186, in __init__
transport=CURLTransport())
NameError: global name 'CURLTransport' is not defined
here is the fragment of script changes:
class Smugmug:
def __init__(self,account,passwd):
from sys import stderr
# probably don't need to hard code this after all - FIXXME
self.account = account
self.password = password
self.sp = ServerProxy("https://api.smugmug.com/hack/xmlrpc/1.1.1/",
transport=CURLTransport())
self.api_version = "1.0"
self.api_key = "COZkd1MBtHQtgs0zf2OQ4KTaiIk3ehVs"
self.categories = None
self.subcategories = None
self.login()
self.logout()
Oops, you need to have a bunch of curl stuff installed for that curlTransport parameter to work. Just omit it and you will be fine, if a little slower.
I use your tool often (thanks!) and noticed it is broken, too. I tried to make your changes - but when I try to login, I get the following errors below.
(mind you I wrote an extension to your tool that I have been using for over a year, unchanged. It allows me to plug in the photograph ID from the URL and look up the name of my photograph in the command line.)
$ sm_tool.py getFileInfo 193759560
Traceback (most recent call last):
File "/usr/bin/sm_tool.py", line 744, in ?
main()
File "/usr/bin/sm_tool.py", line 735, in main
getInfo(argv[2],Options(argv[3:]))
File "/usr/bin/sm_tool.py", line 672, in getInfo
smugmug = Smugmug(opts.login,opts.password)
File "/usr/bin/sm_tool.py", line 186, in __init__
transport=CURLTransport())
NameError: global name 'CURLTransport' is not defined
here is the fragment of script changes:
class Smugmug:
def __init__(self,account,passwd):
from sys import stderr
# probably don't need to hard code this after all - FIXXME
self.account = account
self.password = password
self.sp = ServerProxy("https://api.smugmug.com/hack/xmlrpc/1.1.1/",
transport=CURLTransport())
self.api_version = "1.0"
self.api_key = "COZkd1MBtHQtgs0zf2OQ4KTaiIk3ehVs"
self.categories = None
self.subcategories = None
self.login()
self.logout()
that worked - but ... encountering error with my extension to sm_tool
Thanks, that at least got me logged in. But now I am getting an error in the extension I wrote. I wondered if I could ask for your help a little further....I'm not a strong python programmer....I'll show you the error I am getting and the function I wrote to take the image ID and return the file name....maybe you have an idea....It must be because of the recent changes to the API...
getFileInfo is supposed to take the Image ID and return the file name and album name to the screen.
getInfoFiles works on a file that lists a batch of URLs from smugmug and returns a file with a .out extension where it has decoded the URL into its actual file name and gallery name.
here's the error (to be followed by the script)
$ sm_tool.py getFileInfo 193759560
Traceback (most recent call last):
File "/usr/bin/sm_tool.py", line 745, in ?
main()
File "/usr/bin/sm_tool.py", line 736, in main
getInfo(argv[2],Options(argv[3:]))
File "/usr/bin/sm_tool.py", line 674, in getInfo
smugmug.getInfo_file(image_id,opts,rest)
File "/usr/bin/sm_tool.py", line 358, in getInfo_file
fileInfo = self.sp.getImageInfo(self.session, int(imageId))
File "/usr/lib/python2.4/xmlrpclib.py", line 1096, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request
verbose=self.__verbose
File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request
return self._parse_response(h.getfile(), sock)
File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in _parse_response
return u.close()
File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 4: 'invalid user (missing/incorrect album password)'>
Oops, you need to have a bunch of curl stuff installed for that curlTransport parameter to work. Just omit it and you will be fine, if a little slower.
I uploaded several directory trees containing a large number of pictures over the weekend, only to find that on SmugMug only galleries were created, but no images populate them. I have no errors from sm-photo-tool to figure out what's going on. Please help.
I'm running Ubuntu Linux 7.10 with Python 2.5.
Last Friday, I implemented the fix referred to by rutt above to my version 1.10 of the script, including removal of the CurlTransport portion of the fixes - everything seemed to work great and I watched by computer chug away all weekend uploading the files.
I had successfully used the script to upload previously - back in September.
If there's any other info I need to provide, I'll be happy to do so.
I uploaded several directory trees containing a large number of pictures over the weekend, only to find that on SmugMug only galleries were created, but no images populate them. I have no errors from sm-photo-tool to figure out what's going on. Please help.
I'm running Ubuntu Linux 7.10 with Python 2.5.
Last Friday, I implemented the fix referred to by rutt above to my version 1.10 of the script, including removal of the CurlTransport portion of the fixes - everything seemed to work great and I watched by computer chug away all weekend uploading the files.
I had successfully used the script to upload previously - back in September.
If there's any other info I need to provide, I'll be happy to do so.
Thanks,
Wayne
G'day Wayne,
It might be related to the new security measures we implemented, can you please email me your latest script to have a look at ? send it to david at smugmug
I went to source forge and downloaded the latest versions, but I don't know what to do with the .rpm and .tar files?
thanks
The version in sourceforge was my attempt at putting sm-photo-tool into a source control system to track the changes. I asked rutt if I could do this some time ago.
.rpm and .tar files are for Linux (or Unix variants). If you need it for windows I'm sure I can make sure I generate a zip file for you on sourceforge.
Also, I'm trying to scour this forum for patches that I can import into the sourceforge project.
Many thanks to Dave Parry for his quick and easy help on solving my issue. He sent me a new copy of the script and all works fine now.
The script that I was using I downloaded from sm-photo-tool.sourceforge.net, and am not sure what the difference is between the two.
Either way, thanks to all for a great tool,
Wayne
I'm also having this same issue. I tried the latest version from sourceforge.net. I even tried the version in the head of the repository - (version 1.13). Can you send me over the file that is working for you?
Hmm. The version I use (which works thanks to David) is very different from the version in sourceforge. My version is available here. I hope some ambitious soul will merge the best from both versions.
Hmm. The version I use (which works thanks to David) is very different from the version in sourceforge. My version is available here. I hope some ambitious soul will merge the best from both versions.
I get this when I follow your link....
Not Found
The requested URL /sm-app.tar.gz was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Hmm. The version I use (which works thanks to David) is very different from the version in sourceforge. My version is available here. I hope some ambitious soul will merge the best from both versions.
I will be happy to merge the two. I've been maintaining it in sourceforge.
FYI, this version/file did not fix the issue for me. I'm still having the same issue. It can create the albums and says it's uploading the pictures. The albums show up, but not the photos.
Comments
Download sm_tool.py
I use ver 1.10 as above. I have modified it slightly to
get it to work. (Swedish national characters in directory
names will not work.)
Is the script maintained by anyone?
Are there newer versions than 1.10 available.
This isn't a bug --- just a comment. I'm a python programmer as well and I noticed that your long help message is encoded in your source by repeatedly using string concatenation over multiple lines. An easier way to do this in python is by using triple quotes, i.e.
self.parser = OptionParser(
self.short_usage + """
Create smugmug galleries and upload to them. Mirror directory trees
on smugmug and keep up to date.
...
"""
The tool seems to work nicely so far. Great work!
I love sm_tool.py. I've packaged it up in an RPM for use with Fedora Core. I use it daily. Is the code hosted anywhere? i.e. sourceforge, etc.?
jesus rodriguez
I appreciate that. I wrote this thing as personal software to solve a problem of my own. I've never gotten a good sense of how many people actually use this (though I think the SM people might be able to answer this.)
Anyway, it's never really grown out of a very informal sort of sharing. I'd be happy if someone picked it up and helped it grow up and move away from its parent's home.
If you don't mind, I would be happy to create a sourceforge type project for
it. And be the Fedora Core package maintainer for it. I will post here with
the project site once it's ready.
sincerely,
jesus rodriguez
sm_tool is not a valid project name, smtool conflicts with an existing
sourceforge project. If you don't mind I'd like to name it
sm-photo-tool. Let me know if that's ok. If you don't care, let me know
as well
an invalid project name. So I used sm-photo-tool.
http://code.google.com/p/sm-photo-tool/
I will be checking in the Fedora Core packaging later this week.
Hi,
Nice tool. I actually took part of the scipt, enhanced and modified it to make it easy to mirror galleries between multiple accounts. If your a programmer and need an interface to work with smugmug galleries you may find it useful. Thanks!
http://www.realityforge.org/articles/2006/11/14/smuggle
Here is a diff:
you may want to replace the version of the script linked in the original post.
David
SmugMug API Developer
My Photos
I put the script under subversion:
http://sm-photo-tool.sourceforge.net/
Download the release here:
http://sourceforge.net/projects/sm-photo-tool
Hi Rutt...
I use your tool often (thanks!) and noticed it is broken, too. I tried to make your changes - but when I try to login, I get the following errors below.
(mind you I wrote an extension to your tool that I have been using for over a year, unchanged. It allows me to plug in the photograph ID from the URL and look up the name of my photograph in the command line.)
$ sm_tool.py getFileInfo 193759560
Traceback (most recent call last):
File "/usr/bin/sm_tool.py", line 744, in ?
main()
File "/usr/bin/sm_tool.py", line 735, in main
getInfo(argv[2],Options(argv[3:]))
File "/usr/bin/sm_tool.py", line 672, in getInfo
smugmug = Smugmug(opts.login,opts.password)
File "/usr/bin/sm_tool.py", line 186, in __init__
transport=CURLTransport())
NameError: global name 'CURLTransport' is not defined
here is the fragment of script changes:
class Smugmug:
def __init__(self,account,passwd):
from sys import stderr
# probably don't need to hard code this after all - FIXXME
self.account = account
self.password = password
self.sp = ServerProxy("https://api.smugmug.com/hack/xmlrpc/1.1.1/",
transport=CURLTransport())
self.api_version = "1.0"
self.api_key = "COZkd1MBtHQtgs0zf2OQ4KTaiIk3ehVs"
self.categories = None
self.subcategories = None
self.login()
self.logout()
def login(self):
rep = self.sp.loginWithPassword(self.account,self.password,
self.api_version,
self.api_key)
self.session = rep
def logout(self):
self.sp.logout(self.session)
any ideas?
thanks for the help and the script!!
Susan Jones
I went to source forge and downloaded the latest versions, but I don't know what to do with the .rpm and .tar files?
thanks
Thanks, that at least got me logged in. But now I am getting an error in the extension I wrote. I wondered if I could ask for your help a little further....I'm not a strong python programmer....I'll show you the error I am getting and the function I wrote to take the image ID and return the file name....maybe you have an idea....It must be because of the recent changes to the API...
getFileInfo is supposed to take the Image ID and return the file name and album name to the screen.
getInfoFiles works on a file that lists a batch of URLs from smugmug and returns a file with a .out extension where it has decoded the URL into its actual file name and gallery name.
here's the error (to be followed by the script)
$ sm_tool.py getFileInfo 193759560
Traceback (most recent call last):
File "/usr/bin/sm_tool.py", line 745, in ?
main()
File "/usr/bin/sm_tool.py", line 736, in main
getInfo(argv[2],Options(argv[3:]))
File "/usr/bin/sm_tool.py", line 674, in getInfo
smugmug.getInfo_file(image_id,opts,rest)
File "/usr/bin/sm_tool.py", line 358, in getInfo_file
fileInfo = self.sp.getImageInfo(self.session, int(imageId))
File "/usr/lib/python2.4/xmlrpclib.py", line 1096, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request
verbose=self.__verbose
File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request
return self._parse_response(h.getfile(), sock)
File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in _parse_response
return u.close()
File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 4: 'invalid user (missing/incorrect album password)'>
and here is the implementation of getFileInfo
I modified main() to accept two new commands
elif argv[1] == '--help':
Options(argv[1:])
elif argv[1] == 'getFileInfo':
if len(argv) < 2:
Options([]).help()
getInfo(argv[2],Options(argv[3:]))
elif argv[1] == 'getInfoFiles':
if len(argv) < 2:
Options([]).help()
getInfoFiles(argv[2],Options(argv[3:]))
else:
Options([]).help()
and here are the two new methods
def getInfo(image_id,options):
opts = options.options
rest = options.args
smugmug = Smugmug(opts.login,opts.password)
smugmug.getInfo_file(image_id,opts,rest)
def getInfoFiles(imageListFilename,options):
opts = options.options
rest = options.args
smugmug = Smugmug(opts.login,opts.password)
smugmug.getInfo_files(imageListFilename,opts,rest)
and here are the methods called from the smugmug instance
def getInfo_file(self,imageId,opts,rest):
fileInfo = []
fileInfo = self.sp.getImageInfo(self.session, int(imageId))
message(opts,"\n filename is %s\n" % (
fileInfo["FileName"]))
albumInfo = []
albumInfo = self.sp.getAlbumInfo(self.session, fileInfo["AlbumID"])
message(opts,"\n albumTitle is %s\n" % (
albumInfo["Title"]))
def getInfo_files(self,imageFile,opts,rest):
if not path.isfile(imageFile):
raise "ImageFile %s is not a file" % (imageFile)
outputFileName = imageFile + '.out'
fileHandle = open ( outputFileName, 'wa' )
f = file(imageFile,"rU")
try:
option = None
for lwithnl in f:
l = lwithnl[:-1]
imageIndex = string.rfind(l,"#")
if imageIndex == -1:
imageIndex = string.rfind(l,"/")
if imageIndex != -1:
imageIdIndex = imageIndex+1
imageIdString = (l[imageIdIndex:])
fileInfo = []
fileInfo = self.sp.getImageInfo(self.session, int(imageIdString))
message(opts,"Image: %s Filename is %s\n" % (
imageIdString, fileInfo["FileName"]))
albumInfo = []
albumInfo = self.sp.getAlbumInfo(self.session, fileInfo["AlbumID"])
fileHandle.write("%s!%s\n" % (
albumInfo["Title"],
fileInfo["FileName"]))
finally:
fileHandle.close()
f.close()
any help you have to offer is greatly appreciated! I use these all the time for my business....
thanks!
Susan
Hello all,
I uploaded several directory trees containing a large number of pictures over the weekend, only to find that on SmugMug only galleries were created, but no images populate them. I have no errors from sm-photo-tool to figure out what's going on. Please help.
I'm running Ubuntu Linux 7.10 with Python 2.5.
Last Friday, I implemented the fix referred to by rutt above to my version 1.10 of the script, including removal of the CurlTransport portion of the fixes - everything seemed to work great and I watched by computer chug away all weekend uploading the files.
I had successfully used the script to upload previously - back in September.
If there's any other info I need to provide, I'll be happy to do so.
Thanks,
Wayne
G'day Wayne,
It might be related to the new security measures we implemented, can you please email me your latest script to have a look at ? send it to david at smugmug
Cheers,
David
SmugMug API Developer
My Photos
The script that I was using I downloaded from sm-photo-tool.sourceforge.net, and am not sure what the difference is between the two.
Either way, thanks to all for a great tool,
Wayne
Hey, can you guys send a dif or something so I don't have to reinvent it? Thanks.
The version in sourceforge was my attempt at putting sm-photo-tool into a source control system to track the changes. I asked rutt if I could do this some time ago.
.rpm and .tar files are for Linux (or Unix variants). If you need it for windows I'm sure I can make sure I generate a zip file for you on sourceforge.
Also, I'm trying to scour this forum for patches that I can import into the sourceforge project.
I'm also having this same issue. I tried the latest version from sourceforge.net. I even tried the version in the head of the repository - (version 1.13). Can you send me over the file that is working for you?
I get this when I follow your link....
Not Found
The requested URL /sm-app.tar.gz was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I will be happy to merge the two. I've been maintaining it in sourceforge.
Download it here:
http://sourceforge.net/project/showfiles.php?group_id=179298
If you have problems with the sm-photo-tool in sourceforge, please file a bug here:
http://sourceforge.net/tracker/?group_id=179298&atid=888591
FYI, this version/file did not fix the issue for me. I'm still having the same issue. It can create the albums and says it's uploading the pictures. The albums show up, but not the photos.
I'm running Fedora Core 5.
Is there something we can do to make it more robust?
Dave, thanks in advance for the help.