My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
gls  
Manual for gls.
Featured
Updated Jan 8, 2010 by devraj

Introduction

Since 2.0 we have split our utility in two, the first gls which provides ways of listing various documents and the second gcp, which allows you to copy files to-and-from your computer to the Google servers.

gls does more than listing documents, it can filter the document list feed based on parameters that you provide, it's behaviour is quite close to that of ls apart from its sytax.

The server string closely resembles scp, please read the documentation to

Requirements

  • Python 2.4
  • GData Python API 2.0.2+

Tested under Mac OSX and Linux. Windows testing pending.

Usage

gls.py options username@gmail.com:/doctype/foldername/Pattern

Both doctype and foldername are optional parameters, doctype may have the value of all, docs, sheets, slides, pdf

If you provide a Pattern string the title of the document will be matched, an asterisk at the end of the Pattern string will make the title search non-exact.

Parameters

-p or --password to provide passwords in the command line -d or --debug to increase verbosity, prints Python error messages as well -h or --help to print out help screen

Usage examples

List all documents, sheets, slides for username@gmail.com

./gls.py username@gmail.com:/

List all folders for username@gmail.com

./gls.py username@gmail.com:/folders

List all sheets for username@gmail.com

./gls.py username@gmail.com:/sheets

List all documents for username@gmail.com in the Documentation folder

./gls.py username@gmail.com:/docs/Documentation

List all documents for username@gmail.com where the title contains the string GTE

./gls.py  username@gmail.com:/docs/Documentation/GTE*

List all objects in the folder Documentation for username@gmail.com

./gls.py username@gmail.com:/all/Documentation

List all documents for username@gmail.com in all where the title contains the words Over

./gls.py username@gmail.com:/docs/all/Over*
Comment by ber...@gmail.com, Aug 12, 2010

Hello,

As with the reports in  issue 47  and 48 (http://code.google.com/p/gdatacopier/issues/detail?id=47, http://code.google.com/p/gdatacopier/issues/detail?id=48), I too receive a generic "failed" error message when attempting to run gls or gcp (2.1.1 version of gdatacopier). I've tested this on three separate systems, each with the same result:

"Fetching document list feeds from Google servers for username@gmail.com ... done.
Failed."

All three of these system have two versions of the gdata Python API installed, as I've been using this application for awhile. This includes version 2.0.10, as shown below:

$ sudo find / -name gdata*
/usr/lib/python2.5/site-packages/gdata-2.0.10.egg-info
/usr/lib/python2.5/site-packages/gdata
/usr/lib/pymodules/python2.6/gdata.py-1.2.4.egg-info
/usr/lib/pymodules/python2.6/gdata
/usr/share/pyshared/gdata.py-1.2.4.egg-info

I commented out lines 174-176 of gls.py as suggested in  issue 47 , and received the following output:

./gls-ed.py username@gmail.com:/
gls 2.1.1, document list utility. Copyright 2010 Eternity Technologies
Released under the GNU/GPL v3 at <http://gdatacopier.googlecode.com>
Password:
Logging into Google server as username@gmail.com ... done.
Fetching document list feeds from Google servers for username@gmail.com ... done.

Traceback (most recent call last):
  File "./gls-ed.py", line 233, in <module>
    main()
  File "./gls-ed.py", line 229, in main
    parse_user_input()            # Check to see we have the right options or exit
  File "./gls-ed.py", line 217, in parse_user_input
    list_documents(args[0], options)
  File "./gls-ed.py", line 148, in list_documents
    document_type = entry.GetDocumentType()
AttributeError: 'DocumentListEntry' object has no attribute 'GetDocumentType'

The third system I tried this on has the following specs:

  • Ubuntu 10.04
  • Python 2.6.5
  • gdatacopier 2.1.1
  • gdata python API 2.0.10
  • gdata python API 1.2.4

I'm guessing that, as with issues 47 and 48, I need to somehow get gdatacopier to use the 2.x.x gdata python API, but I can't figure out how to do so.

Any help greatly appreciated.

p.s. - I planned to post this to the Google Group, but my membership request has been pending for a bit. I hesitate to post it as an 'issue' yet, because I doubt it is an issue with gdatacopier. Hope it's Ok to post here..

Comment by project member devraj, Aug 12, 2010

I think this might the same as every Ubuntu user faces with GData. I would recommend not installing gdata using apt which seems to be gdata 1.2.4 on your third system. Unfortunately there's no real way of importing a specific version of the gdata api in Python.

As for your first example, do you have two versions of Python? If you have two versions of Python, you might have accidentally compiled gdata against the non default version of Python.

Let me know and I am happy to help you sort this out.

Comment by ber...@gmail.com, Aug 13, 2010

Hello devraj, Thank you very much for your response. I actually did not install gdata thru apt the first time, but I did install it manually quite a long time ago. It's frustrating that I can't figure out how to have gdatacopier "point" at the newer gdata. You are right that I have two versions of Python also. I will try uninstalling the old version, and recompiling gdata. (unfortunately I am away from these systems for the weekend, so I'll try this on Monday)

thank you again.

Comment by ber...@gmail.com, Aug 18, 2010

I finally got it working!

Here's what I did: - removed python2.5 via Synaptic - re-installed gdata library (2.0.10 version); attempted gdatacopier - no success

- renamed / moved all existing files & directories related to gdata from within the python2.6/dist-packages/ directory - re-installed gdata library (2.0.10 version); attempted gdatacopier - success!

Thank you again for your help, and thank you for your work on this software.

Comment by project member devraj, Aug 18, 2010

Great. Thanks for posting your comments here. Hopefully others with the same problem find it useful.

Thanks for choosing GDataCopier, please keep an eye on the Roadmap.

Comment by theduns...@gmail.com, Feb 9, 2011

I removed all gdata packages that came with Ubuntu (10.04.2 LTS) (this will uninstall Evolution, which I don't use anyway) and installed gdata (gdata-2.0.13) from the tarball and that worked for me.


Sign in to add a comment
Powered by Google Project Hosting