You are not logged in.

#26 2009-03-01 16:30:19

seenxu
Member
Registered: 2008-08-25
Posts: 95

Re: pycp: cp and mv with a progressbar

Yannick_LM wrote:
seenxu wrote:

but I don't see any changes in git, haven't committed the code?

Just did wink

yo, many thx. big_smile

Offline

#27 2009-03-08 17:47:15

Yannick_LM
Member
Registered: 2008-12-22
Posts: 142

Re: pycp: cp and mv with a progressbar

Version 3.1 is out.

Changelog:

Now using /bin/cp instead of cp (thanks, Chris Gilles)

No more -o option. Files are now overwritten by default.
Pass a -i, --interactive option if you want to be asked
for confirmation before overwritting files
Mimic cp behaviour. (thanks, ctaf)

Offline

#28 2010-05-04 19:35:06

Yannick_LM
Member
Registered: 2008-12-22
Posts: 142

Re: pycp: cp and mv with a progressbar

(8 months later ...)

Version 4.2 is out:

Changelog:

You can now use --safe to never overwrite files.

Lots of bug fixes, introducing automatic tests

Usable on windows

Got it's pypi page:
http://pypi.python.org/pypi/pycp/4.2

Offline

#29 2010-05-05 19:39:58

Busata
Member
From: Belgium
Registered: 2010-04-04
Posts: 28
Website

Re: pycp: cp and mv with a progressbar

nice work, just tried, like how it integrates(as in not clearing the screen like vcp does)

Offline

#30 2010-05-06 06:40:05

Yannick_LM
Member
Registered: 2008-12-22
Posts: 142

Re: pycp: cp and mv with a progressbar

thanks wink

Offline

#31 2010-05-06 06:52:51

oew
Member
From: Norway
Registered: 2006-11-08
Posts: 105

Re: pycp: cp and mv with a progressbar

Excellent work! I've always missed a progressbar in cp/mv.


there's no place like ~/

Offline

#32 2010-05-13 13:43:46

Yannick_LM
Member
Registered: 2008-12-22
Posts: 142

Re: pycp: cp and mv with a progressbar

Version 4.3 is out:

now displays transfer the way git does it:

for instance:

/path/to/foo/a/bar -> /path/to/foo/b/bar

becomes

/path/to/foo/{a => b}/bar

Offline

#33 2010-05-16 10:02:34

seenxu
Member
Registered: 2008-08-25
Posts: 95

Re: pycp: cp and mv with a progressbar

issue report:
I am trying to mv a dir to a new destination, after the mv, the source still be left with a empty dir. is this a expected behaviour? thx

notes:
using python-2.6.5, pycp git-latest and python-progressbar-2.2

Last edited by seenxu (2010-05-16 10:03:12)

Offline

#34 2010-05-16 12:47:06

Yannick_LM
Member
Registered: 2008-12-22
Posts: 142

Re: pycp: cp and mv with a progressbar

I am trying to mv a dir to a new destination, after the mv, the source still be left with a empty dir. is this a expected behaviour? thx

Nope, this is a bug.

Thanks for reporting.

Fixed in version 4.3.2

Offline

#35 2010-05-16 12:55:17

seenxu
Member
Registered: 2008-08-25
Posts: 95

Re: pycp: cp and mv with a progressbar

Yannick_LM wrote:

I am trying to mv a dir to a new destination, after the mv, the source still be left with a empty dir. is this a expected behaviour? thx

Nope, this is a bug.

Thanks for reporting.

Fixed in version 4.3.2

thx for the fix, just reinstall it from git, now it works.

Offline

#36 2010-05-16 15:59:19

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: pycp: cp and mv with a progressbar

JFYI:
rsync -P gives a progress bar, too.


no place like /home
github

Offline

#37 2010-05-16 16:05:16

seenxu
Member
Registered: 2008-08-25
Posts: 95

Re: pycp: cp and mv with a progressbar

demian wrote:

JFYI:
rsync -P gives a progress bar, too.

pycp saves me to type those rsync options. smile

Offline

#38 2010-05-16 16:44:10

JohannesSM64
Member
From: Norway
Registered: 2009-10-11
Posts: 623
Website

Re: pycp: cp and mv with a progressbar

alias r='rsync -P'
?

Offline

#39 2010-06-02 09:42:26

riivo
Member
Registered: 2008-08-25
Posts: 112

Re: pycp: cp and mv with a progressbar

I found a possible bug. If I try to copy files to my memory stick, which is formatted in NTFS, cp gives warnings about operation not permitted for saving permissions. However pycp gives the same warning and a python traceback and stops from copying the rest of the files.

Offline

#40 2010-06-02 20:11:36

Yannick_LM
Member
Registered: 2008-12-22
Posts: 142

Re: pycp: cp and mv with a progressbar

However pycp gives the same warning and a python traceback and stops from copying the rest of the files.

Can you please pastebin the traceback?

Offline

#41 2010-06-03 11:53:03

riivo
Member
Registered: 2008-08-25
Posts: 112

Re: pycp: cp and mv with a progressbar

Yannick_LM wrote:

However pycp gives the same warning and a python traceback and stops from copying the rest of the files.

Can you please pastebin the traceback?

Sure. Here it is
http://pastebin.com/5t4J6gTd
It hangs after this error and I can only get out with Ctrl+C, but it does copy the file.

Offline

#42 2010-06-03 20:09:42

Yannick_LM
Member
Registered: 2008-12-22
Posts: 142

Re: pycp: cp and mv with a progressbar

It hangs after this error and I can only get out with Ctrl+C,

I'll try and fix this, there's no exception handling right now ...

Inside pycp, I just use

shutil.copy(src, dest)

which does something like:

    copyfile(src, dst)
    copymode(src, dst)

(from /usr/lib/python2.6/shutil.py)


So I'm not sure what to do.

try/except every IOError, and exit the program when the first error occurs ?

abort when copyfile fails but just print a warning if copymode fails ?

make this configurable via command-line options ?

what do you think ?

Offline

#43 2010-06-04 11:34:56

riivo
Member
Registered: 2008-08-25
Posts: 112

Re: pycp: cp and mv with a progressbar

I think the best thing to do is to imitate the behavior of the good old cp again. That is to print a warning, but continue.

Offline

#44 2010-06-04 13:28:48

cool
Member
Registered: 2008-09-12
Posts: 111
Website

Re: pycp: cp and mv with a progressbar

cp progressbar - I like it. Thanks

Offline

#45 2010-06-04 20:19:43

Yannick_LM
Member
Registered: 2008-12-22
Posts: 142

Re: pycp: cp and mv with a progressbar

@riivo

riivo wrote:

That is to print a warning, but continue.

Let it be this way smile

I'll try and push something this week end. (although there's a really nice weather here ...)

@cool

You're welcome.

Last edited by Yannick_LM (2010-06-04 20:21:13)

Offline

#46 2010-06-26 16:01:59

riivo
Member
Registered: 2008-08-25
Posts: 112

Re: pycp: cp and mv with a progressbar

Have you decided to drop the project?

Offline

#47 2010-06-26 18:55:25

Yannick_LM
Member
Registered: 2008-12-22
Posts: 142

Re: pycp: cp and mv with a progressbar

Hum, no. What makes you think that?

Last update was june 6th, right after your last post.

git log wrote:

pycp: do not hang when exception occurs during file tranfer.
   
Also, pycp a_file ro_dir now exit with non-zero status.

I can make a new upload to AUR if you want.

EDIT: AUR updated smile

Last edited by Yannick_LM (2010-06-26 19:05:07)

Offline

#48 2010-06-27 03:26:54

riivo
Member
Registered: 2008-08-25
Posts: 112

Re: pycp: cp and mv with a progressbar

My bad. I was looking at the old git and re-compiling pycp not pycp-git form AUR. Works great now. Thanks. Keep up the good work.

Offline

#49 2010-06-27 09:49:01

Yannick_LM
Member
Registered: 2008-12-22
Posts: 142

Re: pycp: cp and mv with a progressbar

Okay. Just to be sure this won't happen again, I've deleted the old gitorious project.

Sources are now on github

Offline

#50 2010-08-08 19:25:28

Yannick_LM
Member
Registered: 2008-12-22
Posts: 142

Re: pycp: cp and mv with a progressbar

Version 5.0 is out !


Changelog:

* massive refactoring (code should not be _much_ easier to read
* pycp no longer uses threading code.
  copying small files should now be painless
(no more time.sleep)
* pycp learned --all and --preserve options
* change license from GPL to BSD


Code was 73 % rewritten (!)

I got a bunch of unittest, but, please, use with care.

As usual, any feedback is welcome!

Offline

Board footer

Powered by FluxBB