Skip to content

Commit

Permalink
Pyabr 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
manijamali2003 committed Apr 13, 2021
1 parent 6f0055f commit 639a08b
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 42 deletions.
72 changes: 72 additions & 0 deletions osinstaller.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/usr/bin/python3
#######################################################################################
# In the name of God, the Compassionate, the Merciful
# Pyabr (c) 2020 Mani Jamali. GNU General Public License v3.0
#
# Official Website: http://pyabr.rf.gd
# Programmer & Creator: Mani Jamali <[email protected]>
# Gap channel: @pyabr
# Gap group: @pyabr_community
# Git source: github.com/PyFarsi/pyabr
#
#######################################################################################

from buildlibs import pack_archives as pack
from buildlibs import control
import shutil, os, sys, hashlib,getpass

os.chdir('/')

if os.path.isfile('/stor/vmabr.pyc'):

if os.path.isdir('/stor/pyabr-master'):
shutil.rmtree('/stor/pyabr-master')

if os.path.isfile ('/stor/master.zip'):
os.remove('/stor/master.zip')

if os.path.isfile('/stor/proc/0'): os.remove('/stor/proc/0')
if os.path.isfile('/stor/proc/id/desktop'): os.remove('/stor/proc/id/desktop')
if not os.path.isdir('/stor/proc/id'): os.mkdir('/stor/proc/id')

os.system(f'cd /stor && "{sys.executable}" vmabr.pyc')
else:
## pre build ##

if not os.path.isdir("/app"):
os.mkdir("/app")
os.mkdir("/app/cache")
os.mkdir("/app/cache/archives")
os.mkdir("/app/cache/archives/data")
os.mkdir("/app/cache/archives/control")
os.mkdir("/app/cache/archives/code")
os.mkdir("/app/cache/archives/build")
os.mkdir("/app/cache/gets")

if not os.path.isdir("/stor"):
os.mkdir("/stor")
os.mkdir("/stor/app")
os.mkdir("/stor/app/packages")

if not os.path.isdir("/build-packs"): os.mkdir("/build-packs")

# build #

pack.install()
pack.inst('baran')
pack.inst('setup')

# run #
if os.path.isfile('/stor/proc/0'): os.remove('/stor/proc/0')
if os.path.isfile('/stor/proc/id/desktop'): os.remove('/stor/proc/id/desktop')
if not os.path.isdir('/stor/proc/id'): os.mkdir('/stor/proc/id')

# debug app #
f = open('/stor/etc/suapp', 'w')
f.write('setup')
f.close()

os.system(f'cd /stor && "{sys.executable}" vmabr.pyc gui-desktop root toor')

if not os.path.isfile('/stor/testing'):
os.system('poweroff')
20 changes: 2 additions & 18 deletions pack-sb.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,11 @@
list.remove('AUTHERS')

if not os.path.isdir('sb'):

os.mkdir('sb')
os.mkdir('sb/pyabr')
os.mkdir('sb/pyabr/pyabr-master')
os.mkdir('sb/stor')
os.mkdir('sb/root')
os.mkdir('sb/etc')

f = open('sb/root/.xinitrc','w')
f.write('pyabr')
f.close()

f = open('sb/etc/issue.net', 'w')
f.write('Pyabr')
f.close()
Expand All @@ -52,18 +45,9 @@

for i in list:
if os.path.isdir(i):
shutil.copytree(i,'sb/pyabr/pyabr-master/'+i)
shutil.copytree(i,'sb/'+i)
else:
if i=='debug.py':
i = 'osinstaller.py'
shutil.copyfile('debug.py','osinstaller.py')

shutil.copyfile(i, 'sb/pyabr/pyabr-master/'+i)

shutil.make_archive('sb/stor/master','zip','sb/pyabr/')
shutil.rmtree('sb/pyabr')
shutil.copyfile(i, 'sb/'+i)

subprocess.call(['mksquashfs','sb','stor.sb','-comp','xz'])

os.remove('osinstaller.py')
import clean
9 changes: 4 additions & 5 deletions packs/baran/code/baran.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ def escape_act_(self):
def signout_act_(self):
app.endall()
commands.shutdown([])
subprocess.call([sys.executable, files.readall('/proc/info/boot'), "gui-login"])
subprocess.call([sys.executable, 'vmabr.pyc', "gui-login"])
sys.exit(0)

def __init__(self,ports,username):
Expand Down Expand Up @@ -1896,7 +1896,7 @@ def signout_act_ (self,yes):
if yes:
app.endall()
commands.shutdown([])
subprocess.call([sys.executable, files.readall('/proc/info/boot'), "gui-login"])
subprocess.call([sys.executable, 'vmabr.pyc', "gui-login"])
sys.exit(0)

def switchuser_act (self):
Expand All @@ -1907,8 +1907,7 @@ def switchuser_act (self):
def switchuser_act_(self,yes):
if yes:
files.create('/tmp/switched-user')
subprocess.call([sys.executable, files.readall('/proc/info/boot'), "gui-login"]) # just run the login

subprocess.call([sys.executable, 'vmabr.pyc', "gui-login"]) # just run the login

def unlock_act (self):
if self.username=='guest':
Expand All @@ -1918,7 +1917,7 @@ def unlock_act (self):
self.BtnUnlock.hide()
self.lock.hide()
else:
subprocess.call([sys.executable,files.readall('/proc/info/boot'),'gui-unlock',self.username])
subprocess.call([sys.executable,'vmabr.pyc','gui-unlock',self.username])

def showTime_lock (self):

Expand Down
4 changes: 3 additions & 1 deletion packs/baran/data/usr/share/themes/glass-dark.sa
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
cp /usr/share/themes/glass-dark-theme /etc/gui
sel /etc/gui
add /usr/share/themes/glass-dark-theme
unsel

sel /usr/share/applications/roller.desk
set folder-icon: @icon/folder
Expand Down
4 changes: 3 additions & 1 deletion packs/baran/data/usr/share/themes/glass.sa
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
cp /usr/share/themes/glass-theme /etc/gui
sel /etc/gui
add /usr/share/themes/glass-theme
unsel

sel /usr/share/applications/roller.desk
set folder-icon: @icon/folder
Expand Down
4 changes: 3 additions & 1 deletion packs/baran/data/usr/share/themes/snow.sa
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
cp /usr/share/themes/snow-theme /etc/gui
sel /etc/gui
add /usr/share/themes/snow-theme
unsel

sel /usr/share/applications/roller.desk
set folder-icon: @icon/folder
Expand Down
8 changes: 0 additions & 8 deletions packs/pyabr/code/vmabr.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,6 @@
if not (files.isdir('/usr/share/fonts') and files.isfile('/usr/share/fonts')):
os.system('ln -s /usr/share/fonts usr/share/fonts')

## @core/removeinstaller ##

if not (argv[0]=='user' or argv[0]=='login'):
if files.isfile('/master.zip'): files.remove('/master.zip')
if files.isfile('/pyabr-master.zip'): files.remove('/pyabr-master.zip')
if files.isfile('/pyabr.zip'): files.remove('/pyabr.zip')
if files.isdir('/pyabr-master'): files.removedirs('/pyabr-master')

## @core/kernel-info ##

files.write("/proc/info/kname", kernel_name)
Expand Down
1 change: 1 addition & 0 deletions packs/pyabr/data/proc/info/boot
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vmabr.pyc
1 change: 1 addition & 0 deletions packs/pyabr/data/proc/info/os
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pyabr
1 change: 1 addition & 0 deletions packs/pyabr/data/proc/info/os_su
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
root
9 changes: 3 additions & 6 deletions packs/setup/code/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ def Finish(self):

## Setting GUI Table ##

## Copying to location ##
shutil.make_archive("/stor", "zip", "/tmp/pyabr/pyabr-master/stor")
os.system('chmod 777 -R /stor')
shutil.unpack_archive("/stor.zip", '/stor', "zip")
## run pyabr ##
open('/stor/etc/suapp', 'w')

## Setting up hostname ##
file = open("/stor/etc/hostname", "w")
Expand Down Expand Up @@ -264,7 +260,8 @@ def Finish(self):
if os.path.isfile ('/stor/proc/0'):
os.system('rm /stor/proc/0')

self.Env.reboot_act()
System ('paye rm setup')
os.system('reboot')

def __init__(self,ports):
super(MainApp, self).__init__()
Expand Down
5 changes: 4 additions & 1 deletion packs/setup/control/list
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
usr/app/setup.pyc
usr/app/setup.pyc
usr/share/applications/setup.desk
usr/share/images/setup.png
usr/share/layouts/setup.ui
2 changes: 1 addition & 1 deletion packs/setup/control/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: setup
copyright: (c) 2021 Mani Jamali
license: GNU GPL v3.0
unpack: /
build: 1400-01-23
build: 1400-01-24
version: 1.3.0
description: Setup installer of Pyabr OS
compile: Yes

0 comments on commit 639a08b

Please sign in to comment.