Skip to content

Commit

Permalink
Deprecating stuffs.
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosplanchon committed May 1, 2022
1 parent bd73517 commit 9ddf447
Show file tree
Hide file tree
Showing 22 changed files with 47 additions and 322 deletions.
8 changes: 7 additions & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
Public domain
Copyright <2022> <Carlos Andrés Planchón Prestes>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 changes: 0 additions & 23 deletions lubuntu_logo_numix_style/download_logo.sh

This file was deleted.

Binary file removed lubuntu_logo_numix_style/lubuntu-logo-2.png
Binary file not shown.
60 changes: 30 additions & 30 deletions pip_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from distutils import sysconfig
from distutils.version import LooseVersion
from json import loads
from os.path import join as pjoin
from os import walk
from os.path import join as pjoin
from subprocess import PIPE, run


Expand All @@ -16,11 +16,11 @@ def get_distutils_packages():
std_lib = sysconfig.get_python_lib(standard_lib=True)
for top, dirs, files in walk(std_lib):
for nm in files:
if nm != '__init__.py' and nm[-3:] == '.py':
if nm != "__init__.py" and nm[-3:] == ".py":
package = pjoin(
top, nm
)[len(std_lib) + 1:-3].replace('\\', '.')
distutils_packages.add(package.split('/')[0])
)[len(std_lib) + 1:-3].replace("\\", ".")
distutils_packages.add(package.split("/")[0])

return distutils_packages

Expand All @@ -32,7 +32,7 @@ def get_package_versions():
pip list [--outdated|--uptodate] --format=json [--not-required]
"""

cmd = 'pip list --outdated --format=json'
cmd = "pip list --outdated --format=json"
cmd_response = run(cmd, shell=True, stdout=PIPE)

if cmd_response:
Expand All @@ -45,36 +45,36 @@ def sort_packages(packages):
Sort packages into major/minor/unknown.
"""
sorted_packages = {
'major': [],
'minor': [],
'unknown': [],
"major": [],
"minor": [],
"unknown": [],
}

for package in packages:
# No version info
if 'latest_version' not in package or 'version' not in package:
sorted_packages['unknown'].append(package)
if "latest_version" not in package or "version" not in package:
sorted_packages["unknown"].append(package)

try:
latest = LooseVersion(package['latest_version'])
current = LooseVersion(package['version'])
latest = LooseVersion(package["latest_version"])
current = LooseVersion(package["version"])
except ValueError:
# Unable to parse the version into anything useful
sorted_packages['unknown'].append(package)
sorted_packages["unknown"].append(package)

# If the current version is larger than the latest
# (e.g. a pre-release is installed) put it into the unknown section.
# Technically its 'unchanged' but I guess its better to have
# Technically its "unchanged" but I guess its better to have
# pre-releases stand out more.
if current > latest:
sorted_packages['unknown'].append(package)
sorted_packages["unknown"].append(package)

# Major upgrade (first version number)
if latest.version[0] > current.version[0]:
sorted_packages['major'].append(package)
sorted_packages["major"].append(package)

# Everything else is a minor update
sorted_packages['minor'].append(package)
sorted_packages["minor"].append(package)

return sorted_packages

Expand All @@ -87,7 +87,7 @@ def upgrade_packages(major=True, minor=True):
Linux programs which depends of it.
"""

print('· Getting packages...')
print("· Getting packages...")
package_versions = get_package_versions()

if package_versions:
Expand All @@ -99,30 +99,30 @@ def upgrade_packages(major=True, minor=True):
total_upgrades = 0

if major:
print('- - - Checking major updates - - -')
for package in sorted_packages['major']:
package_name = package['name']
print("- - - Checking major updates - - -")
for package in sorted_packages["major"]:
package_name = package["name"]
if package_name not in distutils_packages:
packages_to_upgrade.add(package_name)
total_upgrades += 1
print(f'{package_name} will be upgraded.')
print(f"{package_name} will be upgraded.")

if minor:
print('- - - Checking minor updates - - -')
for package in sorted_packages['minor']:
package_name = package['name']
print("- - - Checking minor updates - - -")
for package in sorted_packages["minor"]:
package_name = package["name"]
if package_name not in distutils_packages:
packages_to_upgrade.add(package_name)
total_upgrades += 1
print(f'{package_name} will be upgraded.')
print(f"{package_name} will be upgraded.")

print('- - - Upgrading packages - - -')
print("- - - Upgrading packages - - -")
for package in packages_to_upgrade:
run(f'sudo -H pip install -U {package}', shell=True)
run(f"sudo -H pip install -U {package}", shell=True)

else:
print('Packages could not be obtained.')
print("Packages could not be obtained.")


if __name__ == '__main__':
if __name__ == "__main__":
upgrade_packages()
89 changes: 0 additions & 89 deletions ubuntu_minecraft_installer/install_minecraft.sh

This file was deleted.

1 change: 0 additions & 1 deletion ubuntu_minecraft_installer/launch_official_minecraft.sh

This file was deleted.

1 change: 0 additions & 1 deletion ubuntu_minecraft_installer/launch_pirated_minecraft.sh

This file was deleted.

Binary file not shown.
11 changes: 0 additions & 11 deletions ubuntu_minecraft_installer/minecraft_official_launcher.desktop

This file was deleted.

11 changes: 0 additions & 11 deletions ubuntu_minecraft_installer/minecraft_pirated_launcher.desktop

This file was deleted.

Binary file not shown.
22 changes: 10 additions & 12 deletions urucrafters_fixlog.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
#!/usr/bin/env python3

from os import system
system('touch converted.log')
HOUR_DIFFERENCE = 5

hour_difference = 5

with open('latest.log', 'r') as log:
with open('converted.log', 'w') as converted:
with open("latest.log", "r") as log:
with open("converted.log", "w") as converted:
for line in log.readlines():
if line[0] == '[':
hour = int(line[1:3]) - hour_difference
if line[0] == "[":
hour = int(line[1: 3]) - HOUR_DIFFERENCE

if int(hour) < 0:
if int(hour) < 0:
hour += 24

hour = str(hour)

if len(hour) == 1:
hour = '0' + hour
hour = "0" + hour

line = '[' + hour + line[3:]
line = "[" + hour + line[3:]

if not '[Server thread/WARN]' in line:
converted.write(line)
if "[Server thread/WARN]" not in line:
converted.write(line)
Loading

0 comments on commit 9ddf447

Please sign in to comment.