GithubHelp home page GithubHelp logo

哥们~~help me... about bcloud HOT 4 CLOSED

xushaohua avatar xushaohua commented on August 24, 2024
哥们~~help me...

from bcloud.

Comments (4)

LiuLang avatar LiuLang commented on August 24, 2024

On 09/11/2014 09:40 PM, hbykdx2014 wrote:

我有一个小小的想法,纵观全网,只有你可能能help me 了~~.
你帮忙开发一个展示百度网盘内容结构的软件或者插件吧~~

就是软件夹套叠关系...

比如  树枝结构~~  类似/ home var etc....

我不是搞it的,所以表达很不清楚~~希望你能明白我的意思

就是让别人清楚知道我这个盘里有什么...能自动生成关系图那就是屌爆了..

O(∩_∩)O谢谢   [email protected]等待你的回复哦~~


Reply to this email directly or view it on GitHub:
#47

像这样的?
file:///proc
|-- 1
| |-- attr
| | |-- current
| | |-- exec
| | |-- fscreate
| | |-- keycreate
| | |-- prev
| | `-- sockcreate
| |-- autogroup
| |-- auxv
| |-- cgroup
| |-- clear_refs
| |-- cmdline
| |-- comm
| |-- coredump_filter
| |-- cpuset
| |-- cwd -> (null)
| |-- environ
| |-- exe -> (null)
| |-- fd
| | [Permission denied]
| |-- fdinfo
| | [Permission denied]
| |-- gid_map
| |-- io
| |-- limits
| |-- loginuid
| |-- map_files
| | [Permission denied]
| |-- maps
| |-- mem
| |-- mountinfo
| |-- mounts
| |-- mountstats
| |-- net

from bcloud.

hbykdx2014 avatar hbykdx2014 commented on August 24, 2024

√,非常对~~ 能表示这种关系就行.

2014-09-11 21:58 GMT+08:00 LiuLang [email protected]:

On 09/11/2014 09:40 PM, hbykdx2014 wrote:

我有一个小小的想法,纵观全网,只有你可能能help me 了~~.
你帮忙开发一个展示百度网盘内容结构的软件或者插件吧~~

就是软件夹套叠关系...

比如 树枝结构~~ 类似/ home var etc....

我不是搞it的,所以表达很不清楚~~希望你能明白我的意思

就是让别人清楚知道我这个盘里有什么...能自动生成关系图那就是屌爆了..

O(∩_∩)O谢谢 [email protected]等待你的回复哦~~


Reply to this email directly or view it on GitHub:
#47

像这样的?
file:///proc
|-- 1
| |-- attr
| | |-- current
| | |-- exec
| | |-- fscreate
| | |-- keycreate
| | |-- prev
| | `-- sockcreate
| |-- autogroup
| |-- auxv
| |-- cgroup
| |-- clear_refs
| |-- cmdline
| |-- comm
| |-- coredump_filter
| |-- cpuset
| |-- cwd -> (null)
| |-- environ
| |-- exe -> (null)
| |-- fd
| | [Permission denied]
| |-- fdinfo
| | [Permission denied]
| |-- gid_map
| |-- io
| |-- limits
| |-- loginuid
| |-- map_files
| | [Permission denied]
| |-- maps
| |-- mem
| |-- mountinfo
| |-- mounts
| |-- mountstats
| |-- net


Reply to this email directly or view it on GitHub
#47 (comment).

from bcloud.

LiuLang avatar LiuLang commented on August 24, 2024

写了一个小脚本, 使用方法是:
先安装bcloud, 然后把下面的脚本保成bcloud-tree.py, 然后在终端里运行它:
$ python3 bcloud-tree.py
会弹出登录窗口, 登录后就自动遍历你的网盘目录, 并将内容输入到终端, 你也可以将输出的内容重定向到一个文件里, 比如:
$ python3 bcloud-tree.py > my-bcloud-tree
如果需要, 也可以自定义输入格式, 只需要修改一下tree()函数就行了.

#!/usr/bin/env python3

# Copyright (C) 2014 LiuLang <[email protected]>
# Use of this source code is governed by GPLv3 license that can be found
# in http://www.gnu.org/licenses/gpl-3.0.html

'''
Traverse directories of Baidu Pan
'''

import sys

from gi.repository import Gtk

from bcloud import gutil
from bcloud import pcs
from bcloud.SigninDialog import SigninDialog


class App(object):

    def __init__(self):
        self.app = Gtk.Application.new('org.liulang.bcloud_tree', 0)
        self.app.connect('startup', self.on_app_startup)
        self.app.connect('activate', self.on_app_activate)
        self.app.connect('shutdown', self.on_app_shutdown)
        self.profile = None

    def run(self):
        self.app.run([])

    def on_app_startup(self, app):
        self.window = Gtk.ApplicationWindow.new(app)
        self.window.set_default_size(200, 200)
        self.app.add_window(self.window)

        self.label = Gtk.Label()
        self.label.set_text('Signin ...')
        self.window.add(self.label)

    def on_app_activate(self, app):
        self.window.show_all()
        dialog = SigninDialog(self, auto_signin=False)
        dialog.run()
        dialog.destroy()
        if self.cookie and self.tokens:
            self.label.set_text('Fetching directory tree now...')
            gutil.async_call(self.tree, callback=self.on_list_dir_finished)
        else:
            self.label.set_text('Failed to sign in')

    def on_app_shutdown(self, app):
        pass

    def tree(self, parent='/', indent=0):
        parent_, files = pcs.list_dir_all(self.cookie, self.tokens, parent)
        indent_str = ' ' * indent
        for file_ in files:
            suf = '/' if file_['isdir'] else ''
            print(indent_str, file_['server_filename'], suf, sep='')
            if file_['isdir']:
                self.tree(file_['path'], indent + 2)

    def on_list_dir_finished(self, *args):
        self.label.set_text('Finished!')

if __name__ == '__main__':
    app = App()
    app.run()

from bcloud.

hbykdx2014 avatar hbykdx2014 commented on August 24, 2024

钦佩,感激[?]

On Fri, Sep 12, 2014 at 1:04 PM, LiuLang [email protected] wrote:

写了一个小脚本, 使用方法是:
先安装bcloud, 然后把下面的脚本保成bcloud-tree.py, 然后在终端里运行它:
$ python3 bcloud-tree.py
会弹出登录窗口, 登录后就自动遍历你的网盘目录, 并将内容输入到终端, 你也可以将输出的内容重定向到一个文件里, 比如:
$ python3 bcloud-tree.py > my-bcloud-tree
如果需要, 也可以自定义输入格式, 只需要修改一下tree()函数就行了.

#!/usr/bin/env python3

Copyright (C) 2014 LiuLang [email protected]

Use of this source code is governed by GPLv3 license that can be found

in http://www.gnu.org/licenses/gpl-3.0.html

'''
Traverse directories of Baidu Pan
'''

import sys

from gi.repository import Gtk

from bcloud import gutil
from bcloud import pcs
from bcloud.SigninDialog import SigninDialog

class App(object):

def __init__(self):
    self.app = Gtk.Application.new('org.liulang.bcloud_tree', 0)
    self.app.connect('startup', self.on_app_startup)
    self.app.connect('activate', self.on_app_activate)
    self.app.connect('shutdown', self.on_app_shutdown)
    self.profile = None

def run(self):
    self.app.run([])

def on_app_startup(self, app):
    self.window = Gtk.ApplicationWindow.new(app)
    self.window.set_default_size(200, 200)
    self.app.add_window(self.window)

    self.label = Gtk.Label()
    self.label.set_text('Signin ...')
    self.window.add(self.label)

def on_app_activate(self, app):
    self.window.show_all()
    dialog = SigninDialog(self, auto_signin=False)
    dialog.run()
    dialog.destroy()
    if self.cookie and self.tokens:
        self.label.set_text('Fetching directory tree now...')
        gutil.async_call(self.tree, callback=self.on_list_dir_finished)
    else:
        self.label.set_text('Failed to sign in')

def on_app_shutdown(self, app):
    pass

def tree(self, parent='/', indent=0):
    parent_, files = pcs.list_dir_all(self.cookie, self.tokens, parent)
    indent_str = ' ' * indent
    for file_ in files:
        suf = '/' if file_['isdir'] else ''
        print(indent_str, file_['server_filename'], suf, sep='')
        if file_['isdir']:
            self.tree(file_['path'], indent + 2)

def on_list_dir_finished(self, *args):
    self.label.set_text('Finished!')

if name == 'main':
app = App()
app.run()


Reply to this email directly or view it on GitHub
#47 (comment).

from bcloud.

Related Issues (20)

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.