Giter Club home page Giter Club logo

grabrc-client's People

Contributors

louisrli avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

grabrc-client's Issues

Backup doesn't work correctly when downloading repo

[louis@dhcp-10-249-202-32 ~]$ grabrc repo -k                                                                                                                                                                                            (1) ~
[INFO] Downloading the repository...
[INFO] Found an existing directory named grabrc.d in /Users/louis...
[INFO] Backing up the directory...
Traceback (most recent call last):
  File "/usr/local/bin/grabrc", line 8, in <module>
    load_entry_point('grabrc-client==0.3', 'console_scripts', 'grabrc')()
  File "/Library/Python/2.7/site-packages/client/client.py", line 161, in main
    downloader.download_repo_nongit(opts)
  File "/Library/Python/2.7/site-packages/client/downloader.py", line 93, in download_repo_nongit
    options.outfile or Const.DEFAULT_DIRNAME)
  File "/Library/Python/2.7/site-packages/client/downloader.py", line 57, in _create_grabrc_folder
    util.backup_file(repo_dirpath)
  File "/Library/Python/2.7/site-packages/client/util.py", line 74, in backup_file
    shutil.move(filepath, backup_path)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 288, in move
    raise Error, "Destination path '%s' already exists" % real_dst
shutil.Error: Destination path '/Users/louis/grabrc.d.grbak/grabrc.d' already exists

File download broken

Haven't had time to investigate deeply, but individual file download is broken on the server-side. The grabrc server fails with "File not found" when querying for the raw Github file. On initial glance, it doesn't seem like Github has changed its URL formats.

The unit tests that fail are all in the filedownload module.

Initial Push to Git Fails

Pushing to Git with a newly made "grabrc-repo" repository fails as

No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to '[email protected]:[USERNAME]/grabrc-repo.git'
[ERROR] Oops! Something went wrong:
-- Failed to push to the git repository.

I think this SO post is related. Doing a dummy commit first resolved the issue when trying to push a file. I think specifying a branch on the push should also resolve this. It also would suppress the warning produced:

[INFO] [git push] warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple

--destdir does not expand home variable

louisli% ./client.py .emacs --destdir=~
DEBUG:root:Options and arguments: {'zip': None, 'tar': None, 'stdout': None, 'destdir': '~', 'nobackup': None, 'outfile': None, 'replace': None, 'append': None} / ['.emacs']
DEBUG:root:Github account: louisrli
DEBUG:root:FILE_URL: http://grabrc.heroku.com/louisrli/.emacs
Traceback (most recent call last):
  File "./client.py", line 371, in <module>
    main()
  File "./client.py", line 146, in main
    _download_file(download_name, opts)
  File "./client.py", line 351, in _download_file
    handle = open(target_path, "a+")
IOError: [Errno 2] No such file or directory: '~/.emacs'
louisli% ./client.py .emacs --destdir=/Users/louisli/
DEBUG:root:Options and arguments: {'zip': None, 'tar': None, 'stdout': None, 'destdir': '/Users/louisli/', 'nobackup': None, 'outfile': None, 'replace': None, 'append': None} / ['.emacs']
DEBUG:root:Github account: louisrli
DEBUG:root:FILE_URL: http://grabrc.heroku.com/louisrli/.emacs
[WARNING] /Users/louisli/.emacs already exists! 
Writing to: [ /Users/louisli/.emacs.gr.bak ]
DEBUG:root:(Outfile, Destination, Target)
 -- (.emacs, /Users/louisli/, /Users/louisli/.emacs)
[SUCCESS] Downloaded .emacs to /Users/louisli/.emacs.gr.bak.

Temporary directory cleanup fails with OSError

louis@cato:~/virtualenv-1.5.1/py-env0$ bin/grabrc dir:.emacs.d --destdir ~
[INFO] Preparing to download the subdirectory .emacs.d
[INFO] Creating temporary directory paths...
[WARNING] Found an existing directory /home/people/louis/.emacs.d
[WARNING] Backing up existing directory /home/people/louis/.emacs.d to /home/people/louis/.emacs.d.grbak
[INFO] Preparing repository directory at /home/people/louis/grabrc.subdir.tmpd
[INFO] Cleaning up temporary directories...
Traceback (most recent call last):
File "/nfs/home/people/louis/virtualenv-1.5.1/py-env0/bin/grabrc", line 9, in
load_entry_point('grabrc-client==0.3', 'console_scripts', 'grabrc')()
File "/nfs/home/people/louis/virtualenv-1.5.1/py-env0/lib/python2.5/site-packages/client/client.py", line 157, in main
downloader.download_subdirectory(download_name[len(DIR_PREFIX):], opts)
File "/nfs/home/people/louis/virtualenv-1.5.1/py-env0/lib/python2.5/site-packages/client/downloader.py", line 134, in download_subdirectory
TMPDIR_NAME)
File "/nfs/home/people/louis/virtualenv-1.5.1/py-env0/lib/python2.5/site-packages/client/downloader.py", line 70, in _create_grabrc_folder
map(lambda f: shutil.move(f, repo_dirpath), repofiles) # os.rmdir requires empty dir
File "/nfs/home/people/louis/virtualenv-1.5.1/py-env0/lib/python2.5/site-packages/client/downloader.py", line 70, in
map(lambda f: shutil.move(f, repo_dirpath), repofiles) # os.rmdir requires empty dir
File "/usr/lib/python2.5/shutil.py", line 196, in move
copytree(src, dst, symlinks=True)
File "/usr/lib/python2.5/shutil.py", line 110, in copytree
os.makedirs(dst)
File "/nfs/home/people/louis/virtualenv-1.5.1/py-env0/lib/python2.5/os.py", line 171, in makedirs
mkdir(name, mode)
OSError: [Errno 17] File exists: '/home/people/louis/grabrc.subdir.tmpd'

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.