GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — SyncBoostNote/syncboostnote/test.py at master · DumbMachine/SyncBoostNote

Expand file tree

/

test.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
63 lines (50 loc) · 1.92 KB
/

test.py

Copy path

File metadata and controls

63 lines (50 loc) · 1.92 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# # ! TODO: Add Highligthing shit
import json
import os
import platform
import subprocess
import time
from collections import deque
from datetime import datetime
from glob import glob
# import cson
home = os.path.expanduser("~")
def sync(
location=os.path.join(home, 'Boostnote')
):
os.chdir(location)
p = subprocess.Popen(
"git status", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
# print(p.stdout.readlines()[1].strip())
if p.stdout.readlines()[1].decode("utf=8").strip() == 'nothing to commit, working tree clean':
os.system("git push origin master")
else:
print("Adding all the things")
p = subprocess.Popen(
"git add -A", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
# print("Commiting all the things")
p1 = subprocess.Popen(
f"git commit -m '{datetime.now()}'", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
for line in p1.stdout.readlines()[2:]:
print(line.decode("utf-8"))
# print("Pushing all the things")
p2 = subprocess.Popen(
"git push origin master", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
retval = p.wait()
def boostnote_exists(location=os.path.join(home, 'Boostnote')):
if os.path.isdir(BOOSTNOTE_PATH):
return 1
else:
# ! YAML Config
return 0
# raise NotADirectoryError("BoostNode Base Directory doesn't exist. Either make sure BoostNote is installed or add PATH to it in syncboostnote.yaml")\
def boostnote_notes_exist(location=os.path.join(home, 'notes')):
if os.path.isdir(BOOSTNOTE_NOTES_PATH):
return 1
else:
# ! YAML Config
raise NotADirectoryError(
f"No NOTES were found in the {BOOSTNOTE_NOTES_PATH} directory")
def git_update(message='nothing'):
os.system('git add -A')
os.system(f"git commit -m '{message}'")
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.