Git Product home page Git Product logo

gitissues's People

Contributors

solomonxie avatar

Stargazers

 avatar

Watchers

 avatar  avatar

gitissues's Issues

Code need to be optimised

It can't be said good on code structure.
especially in issues_fetching.py
urged to be optimised for future reviewing.

重构gitissues

需要把全部代码重构,以API形式存在。
之前的代码把简单的东西太复杂化了,完全没有必要。
而且对于Github Issues,需要用各种各样的操作运作,所以API形式更容易增量添加功能

以下是大概的重构思路。

  • 对象化:分别将这些东西作为对象
    • repo(代替issues),包含repo的基本信息,和issues-list列表信息
    • issue,包含一切对单条issue的操作,只接收一个issue-url即可生成实例,供一切相关操作
    • comment,包含一切对某个comment的分析,包括主题提取、转换为Jekyll格式Markdown、渲染为HTML等
  • RESTful:每一个对象都能单独执行、单独完成任务,而不依赖parent对象
    • repo:接收一个repo的url即可完成repo信息读取,以及下面所有issues、comments系列联动
    • issue:接收一个issue的url,即可完成issue的操作,联动下面的所有comment,提供各种公用function
    • comment:接收一个comment的url,即可完成导出、转换、渲染、分析等各种操作
  • 备份方式:取消以issue为单位的提交,改成已comment为单位的提交, git add comment.md && git commit -m "update a comment" && git push

class Comment

改为由下至上的开发,先把最底层的完善,再逐层往上开发。

  • 读取comment的主题
  • 单独更新、提交comment到备份仓库
  • 直接将本地对comment的修改提交到对应的原始issue中
  • 将全文中对于本issue内的链接,都转换成指定的链接格式(方便跳转)
  • 下载文中所有图片,并上传到指定仓库,转换为固定地址
  • 自动给图片上下加空白行
  • 生成邮件并发送
  • 实时生成提醒日期列表
  • 生成YAML格式的Front Matter,以供github pages或gitbook等使用

class Issue

调用方式:

功能列表:

  • 将数据实时备份到另外一个repo
  • 生成TOC目录(可以更换github链接为任意自己想要的链接格式,如本地格式,gitbook格式等)
  • 导出整条issue为一整本书,PDF或Markdown或HTML(在comments量很大情况下)

class Repo

testing issue 1

10 tips for working with Postman variables

Variables are a fundamental concept in programming, and in Postman, they can be your best friend. Instead of painstakingly updating individual values, use variables to cascade changes effortlessly through the rest of your code. If you’re not already using variables in Postman, get ready to have your mind blown.

image

testing issue 2

Using variables inside Postman and Collection Runner

Posted on 20 Feb, 2014Author abhinav
Variables are among the most powerful features in Postman. Using variables in your Postman requests, eliminates the need to duplicate requests, which can save a lot of time!

项目设计

初始设计Project: Git issues App

专注于issues博客功能,出发点就不同于桌面已有的和手机上鲜有的应用。
特点:

  • 每个issues笔记都算为github的contribution,美化profile工作日历
  • 自动转md文件并上传到github中的repo,更填改完全对应
  • 实时同步网络repo中的issues
  • 本地存储性,没联网也可以编辑保存,联网了再自动同步(放心)
  • 定期自动备份到多端
  • 图片上传到github自带的repo中(市面所有应用都没做到)
  • 同时支持desktop和iphone和web page
  • 界面和笔记应用相同(如note.app)

实现主要技巧:

  • 将issues映射到其repo的某一特定分支,每个comment为单独md文件
  • 图片上传到repo中并引用其raw链接
  • 建立每条comment和其md文件的对应表
  • 实时监控本地更新,并push到远端;定期查询远端更新,pull到本地。如有冲突,则跳过有冲突的文件,让用户选择方案

To do

  • 利用insomia或postman测试github api可行性
  • python抓取某指定repo的所有issue
  • 将指定repo下的所有issue保存到本地指定位置,并创建压缩包备份
  • 设置config文件,把指定repo和user或存储位置等都放到config里面
  • 测试、设计将本地的issues上建立git仓库,并与remote仓库的映射逻辑(用Bitbucket测试)
  • 自动完成.git/config的配置
  • 解决git commit, pull, 和push的逻辑设定及解决冲突
  • 实现本地issues与remote的专门仓库的映射和自动push
  • 将脚本部署在服务器和树莓派
  • 查找更新的issue,并只抓取更新了的
  • 生成运行log日志
  • 实现定时抓取
  • 按日期生成序列日志
  • 定期将打包的文章发送到邮箱
  • 在issues生成的md基础上生成博客
  • 下载多个repo下的所有issues,并分类存档好

testing 中文

总之对于这个我唯一认定的事就是:Python里要是弄不明白编码,那这个语言就放弃吧!

下面是目前收获到的一些内容,没写完,再议吧。。。

首先要在文件第一行写上编码声明

#coding:utf-8

caso sgs c 01 bdrip 1280x720 x264_aac -0005

编码声明的格式其实很随意的,coding=utf-8, -- Coding:Utf-8 -- 等等都行,
Python只识别关键的字。
如果不写编码声明,那么文件中出现的任何中文都会报错:
SyntaxError: Non-ASCII character '\xe5' in file xx.py on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

*为每个issue添加目录

在每个issue的body中识别标记符,然后按照每条comment的标题生成一个目录,插入在issue-body的标记符处。

此函数应作为issue类的方法实现。

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.