mailru: comment out some debugging statements

This commit is contained in:
Nick Craig-Wood 2019-10-02 19:43:04 +01:00
parent 135717e12b
commit d21ddf280c
1 changed files with 21 additions and 21 deletions

View File

@ -287,7 +287,7 @@ type Fs struct {
// NewFs constructs an Fs from the path, container:path
func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error) {
fs.Debugf(nil, ">>> NewFs %q %q", name, root)
// fs.Debugf(nil, ">>> NewFs %q %q", name, root)
ctx := context.Background() // Note: NewFs does not pass context!
// Parse config into Options struct
@ -675,7 +675,7 @@ func (f *Fs) itemToDirEntry(ctx context.Context, item *api.ListItem) (entry fs.D
// dir should be "" to list the root, and should not have trailing slashes.
// This should return ErrDirNotFound if the directory isn't found.
func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error) {
fs.Debugf(f, ">>> List: %q", dir)
// fs.Debugf(f, ">>> List: %q", dir)
if f.quirks.binlist {
entries, err = f.listBin(ctx, f.absPath(dir), 1)
@ -689,7 +689,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e
names = append(names, entry.Remote())
}
sort.Strings(names)
fs.Debugf(f, "List(%q): %v", dir, names)
// fs.Debugf(f, "List(%q): %v", dir, names)
}
return
@ -1026,7 +1026,7 @@ func (rev *treeRevision) Read(data *api.BinReader) error {
// CreateDir makes a directory (parent must exist)
func (f *Fs) CreateDir(ctx context.Context, path string) error {
fs.Debugf(f, ">>> CreateDir %q", path)
// fs.Debugf(f, ">>> CreateDir %q", path)
req := api.NewBinWriter()
req.WritePu16(api.OperationCreateFolder)
@ -1088,7 +1088,7 @@ func (f *Fs) CreateDir(ctx context.Context, path string) error {
// already exists. As a workaround, users can add string "atomicmkdir" in the
// hidden `quirks` parameter or in the `--mailru-quirks` command-line option.
func (f *Fs) Mkdir(ctx context.Context, dir string) error {
fs.Debugf(f, ">>> Mkdir %q", dir)
// fs.Debugf(f, ">>> Mkdir %q", dir)
err := f.mkDirs(ctx, f.absPath(dir))
if err == ErrorDirAlreadyExists && !f.quirks.atomicmkdir {
return nil
@ -1149,7 +1149,7 @@ func (f *Fs) mkParentDirs(ctx context.Context, path string) error {
// Rmdir deletes a directory.
// Returns an error if it isn't empty.
func (f *Fs) Rmdir(ctx context.Context, dir string) error {
fs.Debugf(f, ">>> Rmdir %q", dir)
// fs.Debugf(f, ">>> Rmdir %q", dir)
return f.purgeWithCheck(ctx, dir, true, "rmdir")
}
@ -1157,7 +1157,7 @@ func (f *Fs) Rmdir(ctx context.Context, dir string) error {
// Optional interface: Only implement this if you have a way of deleting
// all the files quicker than just running Remove() on the result of List()
func (f *Fs) Purge(ctx context.Context) error {
fs.Debugf(f, ">>> Purge")
// fs.Debugf(f, ">>> Purge")
return f.purgeWithCheck(ctx, "", false, "purge")
}
@ -1219,7 +1219,7 @@ func (f *Fs) delete(ctx context.Context, path string, hardDelete bool) error {
// Will only be called if src.Fs().Name() == f.Name()
// If it isn't possible then return fs.ErrorCantCopy
func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) {
fs.Debugf(f, ">>> Copy %q %q", src.Remote(), remote)
// fs.Debugf(f, ">>> Copy %q %q", src.Remote(), remote)
srcObj, ok := src.(*Object)
if !ok {
@ -1235,7 +1235,7 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object,
srcPath := srcObj.absPath()
dstPath := f.absPath(remote)
overwrite := false
fs.Debugf(f, "copy %q -> %q\n", srcPath, dstPath)
// fs.Debugf(f, "copy %q -> %q\n", srcPath, dstPath)
err := f.mkParentDirs(ctx, dstPath)
if err != nil {
@ -1284,7 +1284,7 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object,
tmpPath := enc.ToStandardPath(response.Body)
if tmpPath != dstPath {
fs.Debugf(f, "rename temporary file %q -> %q\n", tmpPath, dstPath)
// fs.Debugf(f, "rename temporary file %q -> %q\n", tmpPath, dstPath)
err = f.moveItemBin(ctx, tmpPath, dstPath, "rename temporary file")
if err != nil {
_ = f.delete(ctx, tmpPath, false) // ignore error
@ -1314,7 +1314,7 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object,
// Will only be called if src.Fs().Name() == f.Name()
// If it isn't possible then return fs.ErrorCantMove
func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, error) {
fs.Debugf(f, ">>> Move %q %q", src.Remote(), remote)
// fs.Debugf(f, ">>> Move %q %q", src.Remote(), remote)
srcObj, ok := src.(*Object)
if !ok {
@ -1400,7 +1400,7 @@ func (f *Fs) moveItemBin(ctx context.Context, srcPath, dstPath, opName string) e
// If it isn't possible then return fs.ErrorCantDirMove
// If destination exists then return fs.ErrorDirExists
func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string) error {
fs.Debugf(f, ">>> DirMove %q %q", srcRemote, dstRemote)
// fs.Debugf(f, ">>> DirMove %q %q", srcRemote, dstRemote)
srcFs, ok := src.(*Fs)
if !ok {
@ -1414,7 +1414,7 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string
}
srcPath := srcFs.absPath(srcRemote)
dstPath := f.absPath(dstRemote)
fs.Debugf(srcFs, "DirMove [%s]%q --> [%s]%q\n", srcRemote, srcPath, dstRemote, dstPath)
// fs.Debugf(srcFs, "DirMove [%s]%q --> [%s]%q\n", srcRemote, srcPath, dstRemote, dstPath)
// Refuse to move to or from the root
if len(srcPath) <= len(srcFs.root) || len(dstPath) <= len(f.root) {
@ -1442,7 +1442,7 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string
// PublicLink generates a public link to the remote path (usually readable by anyone)
func (f *Fs) PublicLink(ctx context.Context, remote string) (link string, err error) {
fs.Debugf(f, ">>> PublicLink %q", remote)
// fs.Debugf(f, ">>> PublicLink %q", remote)
token, err := f.accessToken()
if err != nil {
@ -1484,7 +1484,7 @@ func (f *Fs) PublicLink(ctx context.Context, remote string) (link string, err er
// CleanUp permanently deletes all trashed files/folders
func (f *Fs) CleanUp(ctx context.Context) error {
fs.Debugf(f, ">>> CleanUp")
// fs.Debugf(f, ">>> CleanUp")
token, err := f.accessToken()
if err != nil {
@ -1524,7 +1524,7 @@ func (f *Fs) CleanUp(ctx context.Context) error {
// About gets quota information
func (f *Fs) About(ctx context.Context) (*fs.Usage, error) {
fs.Debugf(f, ">>> About")
// fs.Debugf(f, ">>> About")
token, err := f.accessToken()
if err != nil {
@ -1568,7 +1568,7 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options .
size: src.Size(),
modTime: src.ModTime(ctx),
}
fs.Debugf(f, ">>> Put: %q %d '%v'", o.remote, o.size, o.modTime)
// fs.Debugf(f, ">>> Put: %q %d '%v'", o.remote, o.size, o.modTime)
return o, o.Update(ctx, in, src, options...)
}
@ -1895,7 +1895,7 @@ type Object struct {
// NewObject finds an Object at the remote.
// If object can't be found it fails with fs.ErrorObjectNotFound
func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) {
fs.Debugf(f, ">>> NewObject %q", remote)
// fs.Debugf(f, ">>> NewObject %q", remote)
o := &Object{
fs: f,
remote: remote,
@ -1994,7 +1994,7 @@ func (o *Object) Storable() bool {
//
// Commits the datastore
func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error {
fs.Debugf(o, ">>> SetModTime [%v]", modTime)
// fs.Debugf(o, ">>> SetModTime [%v]", modTime)
o.modTime = modTime
return o.addFileMetaData(ctx, true)
}
@ -2067,7 +2067,7 @@ func (o *Object) addFileMetaData(ctx context.Context, overwrite bool) error {
// Remove an object
func (o *Object) Remove(ctx context.Context) error {
fs.Debugf(o, ">>> Remove")
// fs.Debugf(o, ">>> Remove")
return o.fs.delete(ctx, o.absPath(), false)
}
@ -2100,7 +2100,7 @@ func getTransferRange(size int64, options ...fs.OpenOption) (start int64, end in
// Open an object for read and download its content
func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error) {
fs.Debugf(o, ">>> Open")
// fs.Debugf(o, ">>> Open")
token, err := o.fs.accessToken()
if err != nil {