Giter Club home page Giter Club logo

drive-cli's People

Contributors

adtya avatar ahegde3 avatar anukriti2512 avatar arghyadeep99 avatar avni-sharma avatar fredamartey avatar inishchith avatar jean avatar nurdtechie98 avatar raghav-dalmia avatar sauravchirania avatar ss18 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

drive-cli's Issues

Unable to track a local directory

I got the following error when I attempted to track a local directory. The folder is named vids and is present in my E drive, so the path is E:\vids. I ran this in a Linux shell (Ubuntu 18.04- WSL) on a Windows 10 machine.

Created a tracked directory
Traceback (most recent call last):
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python37-32\Scripts\drive-script.py", line 11, in <module>
    load_entry_point('drive-cli', 'console_scripts', 'drive')()
  File "c:\users\acer\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\acer\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
  File "c:\users\acer\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\acer\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\acer\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "e:\drive-cli\drive_cli\actions.py", line 178, in create_remote
    utils.push_content(child_cwd, child_id)
  File "e:\drive-cli\drive_cli\utils.py", line 474, in push_content
    local_lis = list_local(cwd)
  File "e:\drive-cli\drive_cli\utils.py", line 441, in list_local
    local_lis = os.listdir(cwd)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'E:vids'

After this, I did a drive.exe view-files and could find an entry for vids:

vids | xxxxxxxxxxxxxxxxxxx | vnd.google-apps.folder | 2020-05-06T18:29:29.757

However, there is no such folder (or file) visible in the drive when I accessed it through a browser.

Google Docs duplication during pull and push

When a file of google docs is pulled we need to export it to some other format. In doing so whenever we have pull, a new file in exported format is created even though there has been no changes since the last pull. Similarly while pushing this exported file gets pushed back as well thus causing duplication. This duplication must not happen.

NameError: name 'dir_name' is not defined when doing push

Hi, while doing push, I am getting the following error:

Traceback (most recent call last):
File "/home/dima/anaconda3/bin/drive", line 11, in
load_entry_point('drive-cli', 'console_scripts', 'drive')()
File "/home/dima/anaconda3/lib/python3.7/site-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/home/dima/anaconda3/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/dima/anaconda3/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/dima/anaconda3/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/dima/anaconda3/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/dima/drive-cli/drive_cli/actions.py", line 311, in push
utils.push_content(cwd, fid)
File "/home/dima/drive-cli/drive_cli/utils.py", line 487, in push_content
push_content(child_cwd, child_id)
File "/home/dima/drive-cli/drive_cli/utils.py", line 494, in push_content
if(push_needed(drive_lis[item], item_path)):
File "/home/dima/drive-cli/drive_cli/utils.py", line 178, in push_needed
dir_name + " has been modified\npress o to OVERWRITE s to SKIP")
NameError: name 'dir_name' is not defined

fix get_fid() to work for all the cases

get_fid() function it works for only limited type of links but gets wrong output on certain cases.
example:
for input
https://drive.google.com/file/d/1NKaxkeqEas9GuKc82Thg6jwDxjyOB7Hn/view?usp=sharing
it returns view where it is expected to return 1NKaxkeqEas9GuKc82Thg6jwDxjyOB7Hn

OverflowError: string longer than 2147483647 bytes

Hi, I'm trying to upload a 15GB file from an AWS server to my Google Drive, the server have 32 cores and 480GB of RAM.

After a while, I got this error

linus@srv-aws:~/linus$ drive add_remote --file xxx.zip
Traceback (most recent call last):
  File "/mnt/data/linus/.local/bin/drive", line 10, in <module>
    sys.exit(cli())
  File "/mnt/data/linus/.local/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/mnt/data/linus/.local/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/mnt/data/linus/.local/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/mnt/data/linus/.local/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/mnt/data/linus/.local/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/mnt/data/linus/.local/lib/python3.6/site-packages/drive_cli/actions.py", line 169, in create_remote
    utils.upload_file(file, file_path, pid)
  File "/mnt/data/linus/.local/lib/python3.6/site-packages/drive_cli/utils.py", line 375, in upload_file
    fields='id').execute()
  File "/mnt/data/linus/.local/lib/python3.6/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/mnt/data/linus/.local/lib/python3.6/site-packages/googleapiclient/http.py", line 846, in execute
    method=str(self.method), body=self.body, headers=self.headers)
  File "/mnt/data/linus/.local/lib/python3.6/site-packages/googleapiclient/http.py", line 164, in _retry_request
    resp, content = http.request(uri, method, *args, **kwargs)
  File "/mnt/data/linus/.local/lib/python3.6/site-packages/oauth2client/transport.py", line 175, in new_request
    redirections, connection_type)
  File "/mnt/data/linus/.local/lib/python3.6/site-packages/oauth2client/transport.py", line 282, in request
    connection_type=connection_type)
  File "/mnt/data/linus/.local/lib/python3.6/site-packages/httplib2/__init__.py", line 1926, in request
    cachekey,
  File "/mnt/data/linus/.local/lib/python3.6/site-packages/httplib2/__init__.py", line 1595, in _request
    conn, request_uri, method, body, headers
  File "/mnt/data/linus/.local/lib/python3.6/site-packages/httplib2/__init__.py", line 1502, in _conn_request
    conn.request(method, request_uri, body, headers)
  File "/usr/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1065, in _send_output
    self.send(chunk)
  File "/usr/lib/python3.6/http/client.py", line 986, in send
    self.sock.sendall(data)
  File "/usr/lib/python3.6/ssl.py", line 975, in sendall
    v = self.send(byte_view[count:])
  File "/usr/lib/python3.6/ssl.py", line 944, in send
    return self._sslobj.write(data)
  File "/usr/lib/python3.6/ssl.py", line 642, in write
    return self._sslobj.write(data)
OverflowError: string longer than 2147483647 bytes

Any ideal how to resolve this everyone ? Thanks a lot ;)

add drive info functionality

Using the command by either specifying the sharing link or the file id one should be able to view relevant information of the file/folder like size of it, members / owners, mimetype , creation date, last modified date, parent folder etc.
Note: The data displayed regarding the same should be organised and layout should be clean enough to read.

add requirements.txt or Pipfile

currently, the only option to install and manage the dependencies is by using the setup.py. It'll be easier to manage the dependencies by having a requirements.txt or Pipfile

OverflowError: string longer than 2147483647 bytes

Hi, though I see this issue has been fixed, I still experience it. It happens while doing drive add_remote I would appreciate an advice.

File "/home/dima/drive-cli/drive_cli/actions.py", line 178, in create_remote utils.push_content(child_cwd, child_id) File "/home/dima/drive-cli/drive_cli/utils.py", line 492, in push_content upload_file(item, item_path, fid) File "/home/dima/drive-cli/drive_cli/utils.py", line 375, in upload_file fields='id').execute() File "/home/dima/anaconda3/lib/python3.7/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper return wrapped(*args, **kwargs) File "/home/dima/anaconda3/lib/python3.7/site-packages/googleapiclient/http.py", line 846, in execute method=str(self.method), body=self.body, headers=self.headers) File "/home/dima/anaconda3/lib/python3.7/site-packages/googleapiclient/http.py", line 164, in _retry_request resp, content = http.request(uri, method, *args, **kwargs) File "/home/dima/anaconda3/lib/python3.7/site-packages/oauth2client/transport.py", line 175, in new_request redirections, connection_type) File "/home/dima/anaconda3/lib/python3.7/site-packages/oauth2client/transport.py", line 282, in request connection_type=connection_type) File "/home/dima/anaconda3/lib/python3.7/site-packages/httplib2/__init__.py", line 1926, in request cachekey, File "/home/dima/anaconda3/lib/python3.7/site-packages/httplib2/__init__.py", line 1595, in _request conn, request_uri, method, body, headers File "/home/dima/anaconda3/lib/python3.7/site-packages/httplib2/__init__.py", line 1502, in _conn_request conn.request(method, request_uri, body, headers) File "/home/dima/anaconda3/lib/python3.7/http/client.py", line 1244, in request self._send_request(method, url, body, headers, encode_chunked) File "/home/dima/anaconda3/lib/python3.7/http/client.py", line 1290, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/home/dima/anaconda3/lib/python3.7/http/client.py", line 1239, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/home/dima/anaconda3/lib/python3.7/http/client.py", line 1065, in _send_output self.send(chunk) File "/home/dima/anaconda3/lib/python3.7/http/client.py", line 987, in send self.sock.sendall(data) File "/home/dima/anaconda3/lib/python3.7/ssl.py", line 1034, in sendall v = self.send(byte_view[count:]) File "/home/dima/anaconda3/lib/python3.7/ssl.py", line 1003, in send return self._sslobj.write(data) OverflowError: string longer than 2147483647 bytes

command line authorize

Is it possible to authorize this in command line only no (gui browser) as i am using it on server which has no gui installed.

-P

Is it possible to parallelize drive pull?

verify user for some commands

verify user by user id(email id) or password for commands like push, share, log --delete. Something like git verify us before it push local commits to remote.

add error handling

At several places only ideal cases have been considered. Need error handling at all the required places

  • help
  • login
  • view-files
  • clone
  • add_remote
  • cat
  • rm
  • ls
  • status
  • pull
  • push

Note: Each section will be up for grab separately and so will be score for filling the allotted section, so claim a particular section only.

Undefined name 'link' in drive_cli/dcli.py

link is an undefined name in get_fid() which has the potential to raise NameError at runtime.

flake8 testing of https://github.com/nurdtechie98/drive-cli on Python 3.7.1

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./drive_cli/dcli.py:170:22: F821 undefined name 'link'
        if 'open' in link:
                     ^
./drive_cli/dcli.py:171:19: F821 undefined name 'link'
            fid = link.split('=')[-1]
                  ^
./drive_cli/dcli.py:173:19: F821 undefined name 'link'
            fid = link.split('/')[-1].split('?')[0]
                  ^
3     F821 undefined name 'link'
3

E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. Most other flake8 issues are merely "style violations" -- useful for readability but they do not effect runtime safety.

  • F821: undefined name name
  • F822: undefined name name in __all__
  • F823: local variable name referenced before assignment
  • E901: SyntaxError or IndentationError
  • E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree

Requirement.parse('pyasn1<0.5.0,>=0.4.1')

I tried using the application.When I try drive login or any other command it gives me an error.The traceback is as follow.

Traceback (most recent call last):
File "/home/ahegde3/anaconda3/lib/python3.5/site-packages/pkg_resources/init.py", line 666, in _build_master
ws.require(requires)
File "/home/ahegde3/anaconda3/lib/python3.5/site-packages/pkg_resources/init.py", line 984, in require
needed = self.resolve(parse_requirements(requirements))
File "/home/ahegde3/anaconda3/lib/python3.5/site-packages/pkg_resources/init.py", line 875, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pyasn1 0.1.9 (/home/ahegde3/anaconda3/lib/python3.5/site-packages), Requirement.parse('pyasn1<0.5.0,>=0.4.1'), {'pyasn1-modules'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/ahegde3/anaconda3/bin/drive", line 6, in
from pkg_resources import load_entry_point
File "/home/ahegde3/anaconda3/lib/python3.5/site-packages/pkg_resources/init.py", line 3144, in
@_call_aside
File "/home/ahegde3/anaconda3/lib/python3.5/site-packages/pkg_resources/init.py", line 3128, in _call_aside
f(*args, **kwargs)
File "/home/ahegde3/anaconda3/lib/python3.5/site-packages/pkg_resources/init.py", line 3157, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/home/ahegde3/anaconda3/lib/python3.5/site-packages/pkg_resources/init.py", line 668, in _build_master
return cls._build_from_requirements(requires)
File "/home/ahegde3/anaconda3/lib/python3.5/site-packages/pkg_resources/init.py", line 681, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/home/ahegde3/anaconda3/lib/python3.5/site-packages/pkg_resources/init.py", line 875, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pyasn1 0.1.9 (/home/ahegde3/anaconda3/lib/python3.5/site-packages), Requirement.parse('pyasn1<0.5.0,>=0.4.1'), {'pyasn1-modules'})

Didnt find any solution .

Load authentication data from a user writable location

Please create and read the authentication data from a directory, which can be modified by the invoking user. The current implementation assumes that the install directory (/usr/local/lib) is writable to users, which is usually not true for unix like systems.

I suggest to adhere to the XDG base directory standard to place the authentication data.

Version: 2.1.0

Installed via pip install drive-cli

--noauth_local_webserver is ignored

/ # drive add_remote --noauth_local_webserver
/usr/local/lib/python3.7/site-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access /usr/local/lib/python3.7/site-packages/drive_cli/token.json: No such file or directory
  warnings.warn(_MISSING_FILE_MESSAGE.format(filename))

Your browser has been opened to visit:

    https://accounts.google.com/o/oauth2/auth?client_id=928646931793-ikgq3vgbapu8b2okuf99s4875inlh02j.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&access_type=offline&response_type=code

If your browser is on a different machine then exit and re-run this
application with the command-line parameter

  --noauth_local_webserver

look like it's ignored

use library for mimetypes

remove the manually written dict of mimetypes in utils.py and use some library to extract the mimetype from file extension.

TypeError during Push and Pull causes sync to fail (TypeError: '<' not supported between instances of 'dict' and 'float')

$ drive push
checking for changes in 'myFolderName' ....
Traceback (most recent call last):
File "/home/ubuntu/anaconda3/bin/drive", line 10, in
sys.exit(cli())
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/drive_cli/actions.py", line 311, in push
utils.push_content(cwd, fid)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/drive_cli/utils.py", line 487, in push_content
push_content(child_cwd, child_id)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/drive_cli/utils.py", line 494, in push_content
if(push_needed(drive_lis[item], item_path)):
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/drive_cli/utils.py", line 173, in push_needed
if sync_time < local_time:
TypeError: '<' not supported between instances of 'dict' and 'float'

$ drive pull
checking for changes in 'myFolderName' ....
Preparing: myFilename.ext for download
downloading file [####################################] 100%
completed download of myFilename.ext
Traceback (most recent call last):
File "/home/ubuntu/anaconda3/bin/drive", line 10, in
sys.exit(cli())
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/drive_cli/actions.py", line 290, in pull
utils.pull_content(cwd, fid)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/drive_cli/utils.py", line 422, in pull_content
if((not os.path.exists(dir_name)) or write_needed(dir_name, item)):
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/drive_cli/utils.py", line 154, in write_needed
if(sync_time < drive_time):
TypeError: '<' not supported between instances of 'dict' and 'float'

Make view-files more friendly to non-interactive usage and machine readable output

The current implementation forces some prompts on usage, even if the script is invoked within a pipeline where the prompt serves no purpose.

Do you want to continue? [y/N]: y

The terminal is wiped, all useful information are cleared.

Do you want to continue? [y/N]: n

The application reports "Aborted!" so did the application crash? The exit code indicates so.

None of the --name, --types or --pid accepts the value from command line, but instead a prompt is forced.

Also the tabular output is unneccessary hard to parse to extract something like the ID for a subsequent invocation.

complete "How to use ?" section of wiki

As decided we remove the usage section from readme to keep it clean. Henceforth all documentation will be maintained in wiki "How to use ?" section

A basic wiki has been added but the contents are yet to filled in many section.

  • help
  • login
  • view-files
  • clone
  • add_remote
  • cat
  • rm
  • ls
  • status
  • pull
  • push
  • share
  • history
  • log
  • info
  • ignore

Note: Each section will be up for grab separately and so will be score for filling the allotted section, so claim a particular section only.

Fix: Remote login

Login via oauth2client as of now can't be done remotely [ i.e without browser access, mainly on compute cloud ]

  • A fix can be done by simply setting noauth_local_webserver flag here

Refresh auth tokens once found expired or invalid

  • Current scenario:

    • Once logged in, if the user tries any feature after the expiry period i.e 1 hour, the user has to authenticate him/her self.
  • Expected behaviour:

    • In order to solve this, we can use refresh_token with the help of which once the key found available but invalid or expired, the dependent methods should call refresh() method and refresh the token.
  • Current progress on this issue

    • refresh() method is yet to be merged which can be found here. #30 .

Feel free to ask doubts.

add unit tests

Unit tests can help save a lot of time when during testing. Without it, testing seems to be difficult and time consuming as we have to run the whole program through different scenarios manually every time.

Drive push not syncing file

Hello
I had a problem when syncing the file, when I modify it, drive detects it has changed but when I try to push it again I get a "working directory is clean" message and the file don't gets uploaded into Gdrive. I downloaded drive-cli using pip instead of cloning the project.

Steps:

  • Cloned an empty directory: drive clone <ID>
  • Inside the cloned directory, created a text file with something inside, example file.md
  • Synchronized the new file using: drive push
  • Modified the file.
  • drive status showed file was indeed changed.
  • called drive push.
  • Got a "working directory is clean" message.
  • File on drive didn't change.

This happened on a Python 3.7.5 virtual enviroment. Can anyone confirm this issue please?

Best regards

json.decoder.JSONDecodeError: Extra data: line 1 column 1450 (char 1449)

Hi!

After some too frequent invocations of drive push the drive command stopped to work with the following error:

json.decoder.JSONDecodeError: Extra data: line 1 column 1450 (char 1449)

I suspect that Drive APIs are requesting to solve a captcha. It would be nice to handle this request and ask the user to solve the captcha instead of showing the error.

globbing functionality in view-files command

the current scenario is user have to enter starting characters/full name to search a file. The expected scenario should be, the user can use globbing methods ( *, ?, etc... ) to search for a file/folder.

Issue with cat command

I create a dummy folder on my drive and test drive cat command on that folder. Terminal show error

googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/drive/v3/files/1f5Lhttb1ZdA8fuOxlZo48A-_hZDnu8_w/export?mimeType=application%2Fmsword&alt=media returned "Export only supports Google Docs."

screenshot from 2019-02-15 12-12-06

I select doc as the export type, the error still persists.

Some comments on commands and options

#adding the file or folder inside particular parent file(test) using its file id
$ drive add_remote --file mailer.py --pid 1RJOWpW5MuP9RXpgZbp9OdauhaBtJd49g

pid in command-line context more familiarly means "process id". I'd prefer parent-id.

The help text sounds like you can add a file inside a file, that doesn't seem to make sense, should be folder?

  • view-files: list your files; filter them by name, type.

Rather query or search. And then rename the cat command to view-file ๐Ÿ˜‰

  • add_remote: upload existing local file to drive and get it linked.

Just add, remote is implied. Also, "remote" here invites confusion with git remote.

  • status: list changes made to local files since last pull or pull.

Also shows files updated remotely?

MemoryError

Greatings,
Unfortunatly am getting the following error while trying to upload to drive a 1GB file:

Traceback (most recent call last):
File "/usr/local/bin/drive", line 11, in
sys.exit(cli())
File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/drive_cli/actions.py", line 169, in create_remote
utils.upload_file(file, file_path, pid)
File "/usr/local/lib/python3.5/dist-packages/drive_cli/utils.py", line 375, in upload_file
fields='id').execute()
File "/usr/local/lib/python3.5/dist-packages/googleapiclient/discovery.py", line 858, in method
payload = media_upload.getbytes(0, media_upload.size())
File "/usr/local/lib/python3.5/dist-packages/googleapiclient/http.py", line 486, in getbytes
return self._fd.read(length)
MemoryError

Am running in a Google Cloud Platform machine -n1-standard-1 (1 vCPU, 3.75 GB memory).

Complete Usage section of readme

Only a limited number of commands have been added at the moment to usage section. Add all the commands and their corresponding explanations.

Implement exponential backoff in utils/upload_file function

I ran into a problem while uploading a large number of files to my university's managed Google Drive: HttpError 403 "User rate limit exceeded." Google suggests an exponential backoff strategy to resolve this: https://developers.google.com/drive/api/v3/handle-errors#resolve_a_403_error_user_rate_limit_exceeded. I have implemented a rudimentary solution in my fork of the repo: https://github.com/karolisr/drive-cli/blob/550bf14c53ebfbcb0007ef2ca2b2ff7be46fe5a8/drive_cli/utils.py#L381. If you would like I could clean up other changes and push this code to the dev branch here. Additionally, if there are problems with the code I am proposing, please let me know how you would like me to resolve them.

Thanks

Change "add_remote" to "add-remote"

In the command view-files, the separator between the words view and files is a hyphen. It'll be nice if add_remote follows the same convention for consistency.

So, we need to change the command add_remote to add-remote and update the README accordingly.

Tag application releases

Please add Git tag the source commits, which provided the corresponding application releases.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.